https://bugs.llvm.org/show_bug.cgi?id=45405

            Bug ID: 45405
           Summary: __sigsetjmp declared twice only with libstdc++
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to