<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - save-temps causes new bitwise parenthesis warning"
href="https://bugs.llvm.org/show_bug.cgi?id=35378">35378</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>save-temps causes new bitwise parenthesis warning
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nikhgupt@codeaurora.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=19456" name="attach_19456" title="test.cc">attachment 19456</a> <a href="attachment.cgi?id=19456&action=edit" title="test.cc">[details]</a></span>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>