This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60932] make stdatomic.h compatible with C++
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 09 Apr 2017 21:01:28 +0000
- Subject: [Bug c++/60932] make stdatomic.h compatible with C++
- Auto-submitted: auto-generated
- References: <bug-60932-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Patrick Pelissier from comment #12)
> Is the status really "wontfix"?
>
> This makes any C library which uses stdatomic.h incompatible with g++ (and
<stdatomic.h> is not part of the C++ standard.
> more and more C code uses stdatomic.h) which is rather bothersome. clang
> doesn't have this issue.
Clang allows the C keyword _Atomic in C++. That's not part of the C++ standard
either
> What prevent stdatomic.h to detect if it is included in C++ mode and
> includes C++ <atomic> instead?
Even if it did that, it wouldn't guarantee that C's atomic_int and C++'s
std::atomic_int are compatible. So you'd still need to rely on non-portable
implementation-specific assumptions.