Next: , Previous: , Up: Conditional Syntax   [Contents][Index]


4.2.8 __has_c_attribute

The special operator __has_c_attribute (operand) may be used in ‘#if’ and ‘#elif’ expressions in C code to test whether the attribute referenced by its operand is recognized by GCC in attributes using the ‘[[]]’ syntax. GNU attributes must be specified with the scope ‘gnu’ or ‘__gnu__’ with __has_c_attribute. When operand designates a supported standard attribute it evaluates to an integer constant of the form YYYYMM indicating the year and month when the attribute was first introduced into the C standard, or when the syntax of operands to the attribute was extended in the C standard.