Macros related to language levels
The following macros except
__cplusplus, __STDC__
, and
__STDC_VERSION__
are predefined to a value of 1 by a
specific language level, represented by a suboption of the -std
compiler option, or any invocation or pragma that implies that suboption.
If the suboption enabling the feature is not in effect, the macro is undefined. For descriptions of the features related to these macros, see the C and C++ language standards.
| Predefined macro name | Description | Predefined when the following language level or compiler option is in effect |
|---|---|---|
__cplusplus |
The numeric value that indicates the supported language standard as defined by that specific standard. | Always predefined. The format is yyyymmL. (For example, the format is 201103L for C++11.) |
| __STDC__ | Indicates that the compiler conforms to the ANSI/ISO C standard. |
|
| __STDC_HOSTED__ | Indicates that the implementation is a hosted implementation of the ANSI/ISO C standard. (That is, the hosted environment has all the facilities of the standard C available). |
Predefined to 1 by default Predefined to 0 if -ffreestanding is specified. |
__STDC_NO_ATOMICS__ |
Indicates that the implementation does not have the full support of the atomics feature. | -std=c11 | -std=gnu11 |
__STDC_NO_THREADS__ |
Indicates that the implementation does not have the full support of the threads feature. | -std=c11 | -std=gnu11 |
__STDC_VERSION__ |
Indicates the version of ANSI/ISO C standard which the compiler conforms to. | Always predefined. The format is yyyymmL. (For example, the format is
199901L for C99.) |
__STDC_NO_ATOMICS__