[Bug c++/71789] atomic_int incompatibility warning between C and C++ [-Wlto-type-mismatch]
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 7 10:12:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71789
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The original intention of the C++ committee was that std::atomic_int would be
compatible with the corresponding C type, but that design was changed during
the C11 process when the _Atomic qualifier was added. They are distinct types
with no relation.
In libstdc++ we *try* to make them have the same size and alignment as the
corresponding C types, but there are bugs on (at least) x86.
More information about the Gcc-bugs
mailing list