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]
Other format: [Raw text]

Re: nonnull attribute (was: Re: Couldn't `function(arg[static 3])` imply nonnull and array size in C?)


On Fri, 8 May 2015, Martin Uecker wrote:

> From reading the documentation, it seems that attributes originally
> were supposed to only go with declarations and were not meant to be a
> general extension to the type system. But then there is the example:
> 
> char *__attribute__((aligned(8))) *f;
> 
> which implies that now (some) attributes could work similar to type 
> qualifiers. Is this the idea?

Yes (keeping in mind that many type attributes can only apply to a limited 
subset of types - if the attribute is only meaningful for structures or 
unions, for example, the syntactic binding inside nested declarators is 
fairly irrelevant to it).  Make sure to distinguish the binding of GNU 
attributes (as defined in the manual) and the binding of C++11 attributes 
(as defined in C++11).

-- 
Joseph S. Myers
joseph@codesourcery.com


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