Skip to content
Tcl Source Code View Ticket
Login

View Ticket

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: