[Bug c++/60932] make stdatomic.h compatible with C++

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 23 13:23:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Sebastian Huber from comment #4)
> I don't think this is the spirit of the atomics provided
> by the recent C/C++ standards.

The atomics are supposed to be roughly source-compatible, in that the relevant
headers for each language define types and functions and macros with the same
names and equivalent effects. But the two languages define those features in
different headers.

If you want to use atomics in C, use <stdatomic.h>, and if you want to use them
in C++, use <atomic> and appropriate using-declarations or a using-directive.

I've created Bug 60940 for the libstdc++ issue.



More information about the Gcc-bugs mailing list