This is the mail archive of the gcc@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]

Re: Prefix attributes vs. grammar


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...


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