6.34 Specifying Attributes of Variables

You can use attributes to specify special properties of variables, function parameters, or structure, union, and, in C++, class members. Some attributes are currently defined generically for variables. Other attributes are defined for variables on particular target systems. Other attributes are available for functions (see Declaring Attributes of Functions), labels (see Label Attributes), enumerators (see Enumerator Attributes), statements (see Statement Attributes), and for types (see Specifying Attributes of Types). Other front ends might define more attributes (see Extensions to the C++ Language).

GCC provides two different ways to specify attributes: the traditional GNU syntax using ‘__attribute__ ((...))’ annotations, and the newer standard C and C++ syntax using ‘[[...]]’ with the ‘gnu::’ prefix on attribute names. Note that the exact rules for placement of attributes in your source code are different depending on which syntax you use. See Attribute Syntax, for details.