[Bug c/65455] typeof _Atomic fails

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 18 17:48:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65455

--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
stdatomic.h uses both __auto_type and __typeof__.  In the cases where 
__typeof__ is used, (a) const and _Atomic (and maybe volatile) must be 
removed and (b) __auto_type would not be correct (the type in question is 
not the type of the initializer, and if the types are different then the 
conversions from the type of the initializer to the type given with 
__typeof__ are required).

The dropping of qualifiers only when _Atomic was present was the 
conservative minimal change that could not affect any existing code using 
typeof.  It may well be that __typeof__ should always treat its argument 
as being an rvalue and so as having no qualifiers, but it wasn't necessary 
to resolve that issue at that time.

__auto_type and __typeof__ should be consistent with each other to avoid 
making the language even more confusing.



More information about the Gcc-bugs mailing list