This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Attributes
- From: Ian Lance Taylor <iant at google dot com>
- To: Sean Hunt <rideau3 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 10 Jul 2010 14:56:25 -0700
- Subject: Re: Attributes
- References: <4C3263A6.1070804@gmail.com>
Sean Hunt <rideau3@gmail.com> writes:
> void foo () __attribute__((noreturn)); // right per spec
> void foo __attribute__((noreturn)) (); // works
> __attribute__((noreturn)) void foo (); // works
>
> It's obvious that the first example of each kind (noreturn appearing
> after the function declarator) must be accepted if it's a GCC
> attribute and not if it's a C++0x attributes. The later two (noreturn
> appearing before the declaration or after the identifier) must be
> accepted for C++0x attributes, but it's not clear if the GCC syntax
> being accepted is an accident or by design.
As far as I can see they are both documenated as working at
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Attribute-Syntax.html , so I
think it is by design.
> Is anyone currently working on C++0x attributes in GCC and, if not, is
> there anyone who can help me through what we should and shouldn't
> accept in clang?
I don't know the answer to this. It's clear that C++0x attributes are
not the same as GNU attributes.
Ian