This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add atomic type qualifier
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, <hp at bitrange dot com>
- Date: Fri, 26 Jul 2013 23:21:57 +0000
- Subject: Re: [PATCH] Add atomic type qualifier
- References: <51F2AEB1 dot 60408 at redhat dot com>
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