[Main]
Title=Specifying Attributes of Types
Subsections=SEC92_aligned, SEC92_packed, SEC92_transparent_union, SEC92_may_alias, SEC92_unused, SEC92_deprecated
Index=__attribute__

[Top]
The keyword <CODE>__attribute__</CODE> allows you to specify special
attributes of <CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A></CODE> and <CODE><A HREF="$$INFOLINK(keywords/union)">union</A></CODE> types when you define such
types.  This keyword is followed by an attribute specification inside
double parentheses.
The following attributes are currently defined for types:

[Bottom]
Other attributes are defined for
functions (see <A HREF="$$LINK(SEC85)">Function Attributes</A>) and for variables
(see <A HREF="$$LINK(SEC91)">Variable Attributes</A>).
<BR><BR>
You may also specify any one of these attributes with <CODE>__</CODE>
preceding and following its keyword.  This allows you to use these
attributes in header files without being concerned about a possible
macro of the same name.  For example, you may use <CODE>__aligned__</CODE>
instead of <CODE>aligned</CODE>.
<BR><BR>
You may specify the <CODE>aligned</CODE> and <CODE>transparent_union</CODE>
attributes either in a <CODE>typedef</CODE> declaration or just past the
closing curly brace of a complete enum, struct or union type
<I>definition</I> and the <CODE>packed</CODE> attribute only past the closing
brace of a definition.
<BR><BR>
You may also specify attributes between the enum, struct or union
tag and the name of the type rather than after the closing brace.
<BR><BR>
See <A HREF="$$LINK(SEC85a)">Attribute Syntax</A> for details of the exact syntax for using
attributes.
<BR><BR>
To specify multiple attributes, separate them by commas within the
double parentheses: for example, <CODE>__attribute__&nbsp;((aligned&nbsp;(16),
packed))</CODE>.
