Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-02-16
14:56 • Closed ticket [aa6624c629]: tclExecute.c: Avoid false-positive warning plus ... artifact: 812691b32f user: jan.nijtmans
12:23
Fix [aa6624c629]: tclExecute.c: Avoid false-positive warning check-in: 87d01188e3 user: jan.nijtmans tags: core-8-6-branch
12:16 • Add attachment aa6624c62920.diff to ticket [aa6624c6292064e7|aa6624c629... artifact: 27e1f79956 user: chrstphrchvz
12:13 • Ticket [aa6624c629] tclExecute.c: Avoid false-positive warning status still ... artifact: d300e1dce4 user: chrstphrchvz
12:12 • New ticket [aa6624c629]. artifact: 7c7fa40830 user: chrstphrchvz

tclExecute.c: Avoid false-positive warning

Closed / Fixedaa6624c6292064e76efe93bfb810545a82ad1d3dCreated 3 years agoUpdated 3 years ago
Descriptionwiki2024-02-16 12:12:45
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.

Referenced by1
chrstphrchvz Ticket [aa6624c629]: 3 changes [History diff]2024-02-16 12:13:26
jan.nijtmanswiki2024-02-16 14:56:12

Fixed [here]

Thanks for the report and the patch!

Log in (anonymous is fine) to add a comment.

Attachments: