Skip to main content

Module gnu

Module gnu 

Source
Expand description

The GNU extensions’ name tables.

Two questions are asked of this module, and it matters that both are answered from the same place: the parser and sema ask “what does this attribute or builtin mean?”, and the preprocessor answers __has_attribute, __has_builtin, __has_feature and __has_extension from it — so a program that guards a construct with #if __has_attribute(packed) gets an answer that is true of this implementation rather than of GCC’s.

The one set of names that is not here is the atomic builtins’, which live beside the code that implements them in crate::sema::is_atomic_builtin — for the same reason: one table, asked by both.

doc/gnu-extensions.md is the prose version of the same tables.

Enums§

Attribute
What an __attribute__ (or a C23 [[…]]) asks for.

Constants§

CINRS_ATTRIBUTES
The names [[cinrs::…]] knows, for the diagnostic that lists them.
LIBRARY_BUILTINS
The library functions __builtin_X may name.
SPECIAL_BUILTINS
The builtins the front end implements itself.
UNSUPPORTED_ATTRIBUTES
The attributes that are refused rather than ignored, with the reason.

Functions§

attribute
The attribute a name spells, accepting both the name and the __name__ forms GCC does.
cinrs_attribute
What a [[cinrs::name]] attribute asks for.
has_attribute
Whether __has_attribute(name) answers yes.
has_builtin
Whether __has_builtin(name) answers yes.
has_c_attribute
The value __has_c_attribute(name) answers with.
has_feature
Whether __has_feature(name) / __has_extension(name) answers yes.
long_double_math
The maths functions whose long double form is the double one here.
typed_overflow
The operation a typed overflow builtin performs, if the name spells one.
unsupported_reason
The reason an Attribute::Unsupported one is refused.