<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 - -w does not suppress warnings promoted to errors with -Werror=…"
href="https://bugs.llvm.org/show_bug.cgi?id=38231">38231</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-w does not suppress warnings promoted to errors with -Werror=…
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bbaren@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When run with -w, GCC disables all warnings, including those which have been
explicitly promoted to errors with -Werror=warningname. Clang’s -w disables all
warnings *except* those which have been so promoted. For example:
$ cat <<EOF >c.c
> void f() {
> int x;
> if (x = 1) {}
> }
> EOF
$ gcc -Werror=parentheses -w -c -o /dev/null c.c
$ clang -Werror=parentheses -w -c -o /dev/null c.c
c.c:3:9: error: using the result of an assignment as a condition without
parentheses [-Werror,-Wparentheses]
if (x = 1) {}
~~^~~
c.c:3:9: note: place parentheses around the assignment to silence this
warning
if (x = 1) {}
^
( )
c.c:3:9: note: use '==' to turn this assignment into an equality comparison
if (x = 1) {}
^
==
1 error generated.
This is already a FIXME in DiagnosticIDs.cpp
(<a href="https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?revision=331834&view=markup#l460">https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?revision=331834&view=markup#l460</a>).</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>