This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Prefix attributes vs. grammar
- To: mark at codesourcery dot com
- Subject: Re: Prefix attributes vs. grammar
- From: Marc Espie <espie at quatramaran dot ens dot fr>
- Date: Thu, 26 Jul 2001 03:01:37 +0200
- Cc: gcc at gcc dot gnu dot org
- Organization: Ecole Normale Superieure (quatramaran)
In old versions of gcc, before attribute, attribute((const)) was const,
and attribute((noreturn)) was volatile.
This does explain the weird placement of attribute in function declarations.
Not surprisingly, around the time attribute appeared, some people replaced
those volatile and const with macros, e.g., __dead and __pure.
The point being that these macros are used in front of the whole
declaration, where they're very readable and less ugly than attribute.
I expect that you are going to have to deal with a lot of legacy code.
In fact, changing __dead or __pure definition is no big deal. Having
to change the position of hundreds of __dead and __pure in actual cod
doesn't look very palatable...