<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 - __sigsetjmp declared twice only with libstdc++"
href="https://bugs.llvm.org/show_bug.cgi?id=45405">45405</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__sigsetjmp declared twice only with libstdc++
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>djdjhildreth@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The actual third-party library I was using that caused the bug was more
complicated, but this is a minimal program that will replicate the issue:
#include <string>
namespace {
#include <setjmp.h>
}
int main(int argc, char* argv[]) {
return 0;
}
As you can see below, this program fails to compile when using clang and the
default libstdc++. If you specify libc++ it will compile. g++ compiles fine
(with libstdc++, as that's all it uses), however.
---
$ clang++ --version
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
$ clang++ test.cpp -stdlib=libstdc++
In file included from test.cpp:3:
/usr/include/setjmp.h:54:12: error: conflicting types for '__sigsetjmp'
extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
__THROWNL;
^
/usr/include/pthread.h:744:12: note: previous declaration is here
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
^
1 error generated.
$ clang++ test.cpp -stdlib=libc++
$ g++ --version
g++ (Ubuntu 8.3.0-26ubuntu1~18.04) 8.3.0
$ g++ test.cpp
---
Note: I ran this on WSL (Ubuntu 18.04) on Windows 10.</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>