Skip to main content

Attributes, Annotations & Decorators

This section is focused on specific examples (like the Deprecated/Obsolete) and how to create your own Attributes, Annotations or Decorators.

For Class Specific Annotations/Decorators like "Override", "Staticmethod" and so on, check the Class Section.

// No Standard Attribute System before C23.
// Compilers commonly provide extensions such as GCC attributes.

__attribute__((deprecated))
void old_function()
{
// ...
}

__attribute__((unused))
static int my_variable;

More Info: