This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add atomic type qualifier


On Fri, 26 Jul 2013, Andrew MacLeod wrote:

> This patch adds an atomic type qualifier to GCC.   It can be accessed via
> __attribute__((atomic)) or in C11 mode via the _Atomic keyword.

Why the attribute - why not just the keyword?

I'll review the patch in detail later (which will involve checking each 
reference to "atomic" or "qualified" in the language part of C11, checking 
for appropriate implementation and complaining if it appears to be 
missing, and checking for appropriate testcases and complaining if those 
appear to be missing).  But some comments now:

* pedwarns for using a C11 feature in previous standard modes should as 
per usual practice be pedwarns-if-pedantic.

* I don't see anything obvious in the parser changes to implement the 
_Atomic ( type-name ) version of the syntax for atomic types (6.7.2.4).

* When C11 refers to qualified types, by default it does not include 
atomic types (6.2.5#27).  What's your rationale for including "atomic" in 
TYPE_QUALS rather than making it separate?  With either approach, a review 
of every reference to qualifiers in the front end is needed to determine 
what's correct for "atomic"; did you find that including "atomic" in 
qualifiers in the implementation made for fewer changes?

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]