Tcl Source Code

View Ticket
Login
Ticket UUID: aa6624c6292064e76efe93bfb810545a82ad1d3d
Title: tclExecute.c: Avoid false-positive warning
Type: Patch Version: core-8-6-branch
Submitter: chrstphrchvz Created on: 2024-02-16 12:12:45
Subsystem: 53. Configuration and Build Tools Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-02-16 14:56:12
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-02-16 14:56:12
Description:

LLVM.org Clang 17 emits is a false positive -Wconstant-logical-operand warning when using -std=c2x (reported at https://github.com/llvm/llvm-project/issues/64356):

tcl86/generic/tclExecute.c:9192:4: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
 9192 |                         || (sizeof(Tcl_WideInt) < 2*sizeof(long))) {
      |                         ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcl86/generic/tclExecute.c:9192:4: note: use '|' for a bitwise operation
 9192 |                         || (sizeof(Tcl_WideInt) < 2*sizeof(long))) {
      |                         ^~
      |                         |

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.

User Comments: jan.nijtmans added on 2024-02-16 14:56:12:

Fixed [87d01188e388c6c2|here]

Thanks for the report and the patch!


Attachments: