<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - clang -Wunknown-pragmas shouldn't warn about a '#pragma GCC diagnostic' it doesn't know"
href="https://llvm.org/bugs/show_bug.cgi?id=25436">25436</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang -Wunknown-pragmas shouldn't warn about a '#pragma GCC diagnostic' it doesn't know
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sean@rogue-research.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>If clang r252202 encounters this:
#pragma GCC diagnostic ignored "-Wlarger-than="
it warns:
test.c:1:32: warning: unknown warning group '-Wlarger-than=', ignored
[-Wunknown-pragmas]
#pragma GCC diagnostic ignored "-Wlarger-than="
^
GCC has a -Wlarger-than= warning, clang does not (itself <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang should support -Wlarger-than-num warning, like gcc"
href="show_bug.cgi?id=10623">bug #10623</a>).
I realize I'm sorta asking for such warnings by specifying -Wunknown-pragmas,
but I think this is a bit different. Ordinarily, I would guard
complier/platform-specific pragmas with something like:
#if __GNUC__
but that won't help because clang (incompletely) pretends to be GCC. (And
-Wlarger-than= is in gcc 4.2, so adding version checks won't help.)
I guess the only workaround for portable code is something like:
#if __GNUC__ && !__clang__
Basically, I see little value in -Wunknown-pragmas warning that clang's GCC
emulation is not 100%. Perhaps a special case for "#pragma GCC"? Or whitelist
known GCC warning flags that clang doesn't support?</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>