Contents|Index|Previous|Next
 Specifying attributes of types   

The keyword, __attribute__, allows you to specify special attributes of struct and union types when you define such types. This keyword is followed by an attribute specification inside double parentheses. Three attributes are currently defined for types: aligned, packed, and transparent_union. Other attributes are defined for functions (see Declaring attributes of functions) and for variables (see Specifying attributes of variables).

You may also specify any one of these attributes with ‘__’ 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 __aligned__ instead of aligned.

You may specify the aligned and transparent_union attributes either in a typedef declaration or just past the closing curly brace of a complete enum, struct or union type definition and the packed attribute only past the closing brace of a definition.


Top|Contents|Index|Previous|Next