<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 --- - intrin.h says "static __inline__" twice, triggering -Wduplicate-decl-specifier"
href="https://llvm.org/bugs/show_bug.cgi?id=26675">26675</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>intrin.h says "static __inline__" twice, triggering -Wduplicate-decl-specifier
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>sfinae@hotmail.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><a href="http://llvm.org/svn/llvm-project/cfe/trunk/lib/Headers/Intrin.h">http://llvm.org/svn/llvm-project/cfe/trunk/lib/Headers/Intrin.h</a> contains:
[...]
static __inline__
unsigned long __cdecl _lrotr(unsigned long, int);
static __inline__
static __inline__
void _ReadBarrier(void);
static __inline__
void _ReadWriteBarrier(void);
[...]
The duplicated line before _ReadBarrier() triggers -Wduplicate-decl-specifier.
This is usually suppressed because it's a system header, but preprocessing
without linemarkers will reveal the warning. Here's what that looks like (with
Clang/C2, but this should repro with Clang/LLVM on Windows too):
C:\Temp>type meow.cpp
#include <intrin.h>
C:\Temp>clang -c meow.cpp
C:\Temp>clang -E -P meow.cpp > meow.ii
C:\Temp>clang -c -Wno-ignored-attributes meow.ii
meow.ii:6865:1: warning: duplicate 'static' declaration specifier
[-Wduplicate-decl-specifier]
static __inline__
^~~~~~~
meow.ii:6865:8: warning: duplicate 'inline' declaration specifier
[-Wduplicate-decl-specifier]
static __inline__
^
2 warnings generated.</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>