Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d300e1dce470e1e06da9070f7b9aeffda1a041b84494ae08cdf3fcc70ec5dbd1
Ticket: aa6624c6292064e76efe93bfb810545a82ad1d3d
tclExecute.c: Avoid false-positive warning
User & Date: chrstphrchvz on 2024-02-16 12:13:26
Changes

  1. comment changed to:
    LLVM.org Clang 17 emits is a false positive <tt>-Wconstant-logical-operand</tt> warning when using <tt>-std=c2x</tt> (reported at [https://github.com/llvm/llvm-project/issues/64356]):
    
    <pre>
    tcl86/generic/tclExecute.c:9192:4: warning: use of logical '||' with constant operand &#91;-Wconstant-logical-operand&#93;
     9192 |                         || (sizeof(Tcl_WideInt) &lt; 2*sizeof(long))) {
          |                         ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    tcl86/generic/tclExecute.c:9192:4: note: use '|' for a bitwise operation
     9192 |                         || (sizeof(Tcl_WideInt) &lt; 2*sizeof(long))) {
          |                         ^~
          |                         |
    </pre>
    
    This will be fixed in future Clang, but I would suggest reordering affected expressions as a workaround to avoid anyone else complaining about this. See attached patch.
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/plain"