This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61625] _Atomic should create a new type
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Jun 2014 20:26:40 +0000
- Subject: [Bug c/61625] _Atomic should create a new type
- Auto-submitted: auto-generated
- References: <bug-61625-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61625
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
_Atomic is a qualifier. ISO C11 requires that assignments between atomic
and non-atomic versions of the same type work, and that lvalue conversion
produces the non-atomic version of the type, and that assignment to an
_Atomic variable has memory_order_seq_cst semantics. You appear to be
requesting something contradicting the requirements of ISO C.
ATOMIC_VAR_INIT is required for certain classes of implementation
permitted by ISO C but not relevant to GCC (those that include lock data
as part of the representation of an atomic type, so that undefined
behavior would result from assignment to the type without special
initialization - assignment from the non-atomic type must work, but *only*
given that the object has been properly initialized first).