On Wed, 13 Nov 2013, Richard Biener wrote:

> On Wed, Nov 13, 2013 at 1:39 AM, Joseph S. Myers
> <jos...@codesourcery.com> wrote:
> > <stdatomic.h> contains what C11 describes as "generic functions".
> > Although DR#419 makes clear that users cannot #undef these macros (or
> > otherwise suppress use of a macro definition) and expect to find an
> > underlying function, they still need to behave like functions as
> > regards evaluating their arguments exactly once (see C11 7.1.4).
> >
> > I noted when adding <stdatomic.h> to mainline that some of the macro
> > definitions there failed that requirement in the case where the
> > pointer argument had variably modified type, because then typeof
> > evaluates its argument and so that argument would be evaluated twice.
> > Avoiding such double evaluation requires defining the type of a
> > temporary variable, and initializing it with the pointer argument,
> > with a single evaluation.  To achieve this, this patch adds a new GNU
> > C extension __auto_type, essentially a restricted version of C++11
> > auto, and uses it in <stdatomic.h>.
> 
> I suppose you didn't use '__auto' because that's much more likely
> used elsewhere than '__auto_type'?

My reasoning was that it's normal in other cases for "__keyword" to mean 
the same as plain "keyword", so it would be confusing for "__auto" to mean 
something different from standard C "auto".

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to