https://bugs.llvm.org/show_bug.cgi?id=35378
Bug ID: 35378
Summary: save-temps causes new bitwise parenthesis warning
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: nikhg...@codeaurora.org
CC: llvm-bugs@lists.llvm.org
Created attachment 19456
--> https://bugs.llvm.org/attachment.cgi?id=19456&action=edit
test.cc
Building the above code with
-Wall -Wextra -Werror -O2 -g -fno-exceptions -o test.o -c test.cc
emits no warnings
however, with:
-Wall -Wextra -Werror -O2 -g -save-temps -fno-exceptions -o test.o -c test.cc
We get:
test.cc:16:101: error: '&' within '|' [-Werror,-Wbitwise-op-parentheses]
if ((dbg_buffer[i] & ~(0xFFFF)) == (uint32)(((uint32)0xC1 << 24) |
(((module_id) & 0xFF) << 16) & ~(0xFFFF)))
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
test.cc:16:101: note: place parentheses around the '&' expression to silence
this warning
if ((dbg_buffer[i] & ~(0xFFFF)) == (uint32)(((uint32)0xC1 << 24) |
(((module_id) & 0xFF) << 16) & ~(0xFFFF)))
^
(
)
When looking into this further I noticed that in the case of -save-temps the
sourceLocation for the expression is not being considered as a macro.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs