Red Hat ENTERPRISE LINUX 4 Manual page 169

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 6. Extensions to the C Language Family
An attribute specifier list may appear immediately before the comma,
declaration of an identifier other than a function definition. At present, such attribute specifiers apply
to the declared object or function, but in future they may attach to the outermost adjacent declarator.
In simple cases there is no difference, but, for example, in
void (****f)(void) __attribute__((noreturn));
at present the
noreturn
future it may apply to the function
apply to are not yet specified. Where an assembler name for an object or function is specified (Sec-
tion 6.37 Controlling Names Used in Assembler Code), at present the attribute must follow the
specification; in future, attributes before the
and those after it to the declared object or function.
An attribute specifier list may, in future, be permitted to appear after the declarator in a function
definition (before any old-style parameter declarations or the function body).
Attribute specifiers may be mixed with type qualifiers appearing inside the
declarator, in the C99 construct by which such qualifiers are applied to the pointer to which the array
is implicitly converted. Such attribute specifiers apply to the pointer, not to the array, but at present
this is not implemented and they are ignored.
An attribute specifier list may appear at the start of a nested declarator. At present, there are some lim-
itations in this usage: the attributes correctly apply to the declarator, but for most individual attributes
the semantics this implies are not implemented. When attribute specifiers follow the
declarator, they may be mixed with any type qualifiers present. The following describes the formal
semantics of this syntax. It will make the most sense if you are familiar with the formal specification
of declarators in the ISO C standard.
Consider (as in C99 subclause 6.7.5 paragraph 4) a declaration
specifiers that specify a type
. The type specified for
ident
specifier is as in the ISO C standard.
If
has the form
D1
type "
derived-declarator-type-list Type
"
derived-declarator-type-list attribute-specifier-list Type
If
has
the
D1
the
declaration
T D
for
,
then
ident
type-qualifier-and-attribute-specifier-list Type
For example,
void (__attribute__((noreturn)) ****f) (void);
specifies the type "pointer to pointer to pointer to pointer to non-returning function returning
As another example,
char *__attribute__((aligned(8))) *f;
specifies the type "pointer to 8-byte-aligned pointer to
most attributes; for example, the usage of
supported.
attribute applies to
. The precise semantics of what attributes in such cases will
****f
(such as
Type
for derived declarators whose type does not include an attribute
ident
(
attribute-specifier-list
form
*
type-qualifier-and-attribute-specifier-list
specifies
the
specifies
T D1
, which causes a warning since
f
specification may apply to the adjacent declarator,
asm
) and
is a declarator that contains an identifier
int
D1
, and the declaration
D )
" for
ident
type
"
derived-declarator-type-list
the
type
"
derived-declarator-type-list
". Note again that this does not work with
char
and
aligned
noreturn
or semicolon terminating the
=
is not a function, but in
f
of a parameter array
[]
, where
contains declaration
T D1
T
T D
, then
specifies the type
T D1
" for
ident
" for
.
ident
attributes given above is not yet
161
asm
of a pointer
*
specifies the
.
,
and
D
"
Type
".
void

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Table of Contents