2.6.3. Generic Compiler Pre-Defined Macro Symbols¶
Version-Related Predefined Macro Symbols
Symbol |
Value Kind |
Value / Description |
---|---|---|
__clang__ |
<constant> |
Defined to 1 if compiler uses Clang- based front-end. |
__clang_major__ |
<version> |
12 |
__clang_minor__ |
<version> |
0 |
__clang_patchlevel__ |
<version> |
0 |
__clang_version__ |
<string> |
String representation of Clang front- end version identification. |
__GNUC_MINOR__ |
<version> |
2 |
__GNUC_PATCHLEVEL__ |
<version> |
1 |
__GNUC__ |
<version> |
4 |
__GXX_ABI_VERSION__ |
<version> |
1002 |
__llvm__ |
<constant> |
Defined to 1 if compiler uses LLVM back-end. |
__VERSION__ |
<string> |
String representation of full Clang front-end version identification. |
C Language-Related Predefined Macro Symbols
Symbol |
Value Kind |
Value / Description |
---|---|---|
__GNUC_GNU_INLINE__ |
<constant> |
Defined to 1 if functions declared inline are defined and externally visible in compiler generated object files if such functions are not declared static or extern. |
__GNUC_STDC_INLINE__ |
<constant> |
Defined to 1 if functions declared inline are defined and externally visible in compiler generated object files only if such functions are declared extern. |
__STDC__ |
<constant> |
Defined to 1 if the compiler conforms to ISO Standard C. |
__STDC_HOSTED__ |
<constant> |
Defined to 1 if the target of the compiler is a hosted environment in which the compier package will supply standard C runtime libraries. |
__STDC_UTF_16__ |
<constant> |
Defined to 1 if char16_t type values are UTF-16 encoded. |
__STDC_UTF_32__ |
<constant> |
Defined to 1 if char32_t type values are UTF-32 encoded. |
__STDC_VERSION__ |
<version> |
Defined to the C Standard being applied for a given compilation based on the -std=<language> option. By default, tiarmclang assumes “-std=gnu17” for C source files (<version>=2017010L). |
__STRICT_ANSI__ |
<constant> |
Defined to 1 if a strictly-conforming C language variant is specified as the argument to the -std option (c89/90/99/9x/11/1x/17/18). |
C++ Language Standard Predefined Macro Symbol (__cplusplus)
Symbol |
Value Kind |
Value / Description |
---|---|---|
__cplusplus |
<standard> |
Indicates the C++ <standard> that is in effect for a given compilation, where <standard> is one of the following values: value => C++ Standard ——- ———— 199711L C++98 199711L C++03 201103L C++11 201402L C++14 201703L C++17 |
C++ Language Feature Test Predefined Macro Symbols
Symbol / Feature |
Available |
Value / Adoption |
---|---|---|
__cpp_aggregate_bases |
C++17 |
201603L |
__cpp_aggregate_nsdmi |
C++14 |
201304L |
__cpp_alias_templates |
C++11 |
200704L |
__cpp_aligned_new |
C++17 |
201606L |
__cpp_attributes |
C++11 |
200809L |
__cpp_binary_literals |
C++14 |
201304L |
__cpp_capture_star_this |
C++17 |
201603L |
__cpp_constexpr |
C++11 C++14 C++17 |
200704L 201304L 201603L |
__cpp_contexpr_in_decltype |
C++11 |
201711L |
__cpp_decltype |
C++11 |
200707L |
__cpp_decltype_auto |
C++14 |
201304L |
__cpp_deduction_guides |
C++17 |
201703L |
__cpp_delegating_constructors |
C++11 |
200604L |
__cpp_digit_separators |
C++14 |
201309L |
__cpp_enumerator_attributes |
C++17 |
201411L |
__cpp_fold_expressions |
C++17 |
201603L |
__cpp_generic_lambdas |
C++14 |
201304L |
__cpp_guaranteed_copy_elision |
C++17 |
201606L |
__cpp_hex_float |
C++17 |
201603L |
__cpp_if_constexpr |
C++17 |
201606L |
__cpp_impl_destroying_delete |
C++98 |
201806L |
__cpp_inheriting_constructors |
C++11 |
201511L |
__cpp_init_captures |
C++14 |
201304L |
__cpp_initializer_lists |
C++11 |
200806L |
__cpp_inline_variables |
C++17 |
201606L |
__cpp_lambdas |
C++11 |
200907L |
__cpp_namespace_attributes |
C++17 |
201411L |
__cpp_nested_namespace_definitions |
C++17 |
201411L |
__cpp_noexcept_function_type |
C++17 |
201510L |
__cpp_nontype_template_args |
C++17 |
201411L |
__cpp_nontype_template_parameter_auto |
C++17 |
201606L |
__cpp_nsdmi |
C++11 |
200809L |
__cpp_range_based_for |
C++11 C++17 |
200907L 201603L |
__cpp_raw_strings |
C++11 |
200710L |
__cpp_ref_qualifiers |
C++11 |
200710L |
__cpp_return_type_deduction |
C++14 |
201304L |
__cpp_rvalue_references |
C++11 |
200610L |
__cpp_static_assert |
C++11 C++17 |
200410L 201411L |
__cpp_structured_bindings |
C++17 |
201606L |
__cpp_template_auto |
C++17 |
201606L |
__cpp_threadsafe_static_init |
C++98 |
200806L |
__cpp_unicode_characters |
C++11 |
200704L |
__cpp_unicode_literals |
C++11 |
200710L |
__cpp_user_defined_literals |
C++11 |
200809L |
__cpp_variable_templates |
C++14 |
201304L |
__cpp_variadic_templates |
C++11 |
200704L |
__cpp_variadic_using |
C++17 |
201611L |
Compiler Generated Object Format (__ELF__)
Symbol |
Value Kind |
Value / Description |
---|---|---|
__ELF__ |
<constant> |
Defined to 1 if compiler generates object code that conforms to the ELF object file format (default). |
Predefined Macro Symbols Related to Endian-ness
Symbol |
Value Kind |
Value / Description |
---|---|---|
__BIG_ENDIAN__ |
<constant> |
Defined to 1 if compiler has been instructed to generate big-endian object code. |
__LITTLE_ENDIAN__ |
<constant> |
Defined to 1 if compiler has been instructed to generate little- endian object code (default). |
__BYTE_ORDER__ |
<constant> |
Matches the value of either the __ORDER_BIG_ENDIAN__ (4321) or __ORDER_LITTLE_ENDIAN__ (1234) pre-defiend macro symbol depending on which endian-ness the compiler assumes for a given compilation. |
__ORDER_BIG_ENDIAN__ |
<constant> |
4321 |
__ORDER_LITTLE_ENDIAN__ |
<constant> |
1234 |
Predefined Macro Symbols Related to Optimization
Symbol |
Value Kind |
Value / Description |
---|---|---|
__FAST_MATH__ |
<constant> |
Defined to 1 if the -ffast-math or or -ffp-mode=fast option is enabled (-ffast-math is implied when the -Ofast optimization level is specifid on the compiler command- line). |
_INLINE |
<constant> |
Defined to 1 if automatic inlining optimizations are enabled. |
__NO_INLINE__ |
<constant> |
Defined to 1 if automatic inlining optimizations are disabled. |
__OPTIMIZE__ |
<constant> |
Defined to 1 if optimization is in use (-O[123fastszg]). |
__OPTIMIZE_SIZE__ |
<constant> |
Defined to 1 if optimizations intended to reduce compiler- generated code size are in use (-Os or -Oz option). |
Predefined Macro Symbols Related to Scalar Types
Symbol |
Value Kind |
Value / Description |
---|---|---|
__BIGGEST_ALIGNMENT__ |
<bytes> |
Indicates the largest alignment in <bytes> ever used for any data type on the Arm processor being compiled for. For Cortex-M0/M0+/ M3/M4/M33/R4/R5, <bytes> = 8. |
__CHAR16_TYPE__ |
<type> |
unsigned short |
__CHAR32_TYPE__ |
<type> |
unsigned int |
__CHAR_BIT__ |
<bits> |
8 |
__CHAR_UNSIGNED__ |
<constant> |
Defined to 1 if “plain” char types (not qualified with a “signed” or “unsigned” keyword) are interpreted by the compiler to be unsigned. |
__INT8_FMTd__ |
<string> |
“hhd” |
__INT8_FMTi__ |
<string> |
“hhi” |
__INT8_MAX__ |
<constant> |
127 |
__INT8_TYPE__ |
<type> |
signed char |
__UINT8_FMTX__ |
<string> |
“hhX” |
__UINT8_FMTo__ |
<string> |
“hho” |
__UINT8_FMTu__ |
<string> |
“hhu” |
__UINT8_FMTx__ |
<string> |
“hhx” |
__UINT8_MAX__ |
<constant> |
255 |
__UINT8_TYPE__ |
<type> |
unsigned char |
__SCHAR_MAX__ |
<constant> |
127 |
__INT_FAST8_FMTd__ |
<string> |
“hhd” |
__INT_FAST8_FMTi__ |
<string> |
“hhi” |
__INT_FAST8_MAX__ |
<constant> |
127 |
__INT_FAST8_TYPE__ |
<type> |
signed char |
__UINT_FAST8_FMTX__ |
<string> |
“hhX” |
__UINT_FAST8_FMTo__ |
<string> |
“hho” |
__UINT_FAST8_FMTu__ |
<string> |
“hhu” |
__UINT_FAST8_FMTx__ |
<string> |
“hhx” |
__UINT_FAST8_MAX__ |
<constant> |
255 |
__UINT_FAST8_TYPE__ |
<type> |
unsigned char |
__INT_LEAST8_FMTd__ |
<string> |
“hhd” |
__INT_LEAST8_FMTi__ |
<string> |
“hhi” |
__INT_LEAST8_MAX__ |
<constant> |
127 |
__INT_LEAST8_TYPE__ |
<type> |
signed char |
__UINT_LEAST8_FMTX__ |
<string> |
“hhX” |
__UINT_LEAST8_FMTo__ |
<string> |
“hho” |
__UINT_LEAST8_FMTu__ |
<string> |
“hhu” |
__UINT_LEAST8_FMTx__ |
<string> |
“hhx” |
__UINT_LEAST8_MAX__ |
<constant> |
255 |
__UINT_LEAST8_TYPE__ |
<type> |
unsigned char |
__INT16_FMTd__ |
<string> |
“hd” |
__INT16_FMTi__ |
<string> |
“hi” |
__INT16_MAX__ |
<constant> |
32767 |
__INT16_TYPE__ |
<type> |
short |
__UINT16_FMTX__ |
<string> |
“hX” |
__UINT16_FMTo__ |
<string> |
“ho” |
__UINT16_FMTu__ |
<string> |
“hu” |
__UINT16_FMTx__ |
<string> |
“hx” |
__UINT16_MAX__ |
<constant> |
65535 |
__UINT16_TYPE__ |
<type> |
unsigned short |
__SHRT_MAX__ |
<constant> |
32767 |
__SIZEOF_SHORT__ |
<bytes> |
4 |
__INT_FAST16_FMTd__ |
<string> |
“hd” |
__INT_FAST16_FMTi__ |
<string> |
“hi” |
__INT_FAST16_MAX__ |
<constant> |
32767 |
__INT_FAST16_TYPE__ |
<type> |
short |
__UINT_FAST16_FMTX__ |
<string> |
“hX” |
__UINT_FAST16_FMTo__ |
<string> |
“ho” |
__UINT_FAST16_FMTu__ |
<string> |
“hu” |
__UINT_FAST16_FMTx__ |
<string> |
“hx” |
__UINT_FAST16_MAX__ |
<constant> |
65535 |
__UINT_FAST16_TYPE__ |
<type> |
unsigned short |
__INT_LEAST16_FMTd__ |
<string> |
“hd” |
__INT_LEAST16_FMTi__ |
<string> |
“hi” |
__INT_LEAST16_MAX__ |
<constant> |
32767 |
__INT_LEAST16_TYPE__ |
<type> |
short |
__UINT_LEAST16_FMTX__ |
<string> |
“hX” |
__UINT_LEAST16_FMTo__ |
<string> |
“ho” |
__UINT_LEAST16_FMTu__ |
<string> |
“hu” |
__UINT_LEAST16_FMTx__ |
<string> |
“hx” |
__UINT_LEAST16_MAX__ |
<constant> |
65535 |
__UINT_LEAST16_TYPE__ |
<type> |
unsigned short |
__INT32_FMTd__ |
<string> |
“d” |
__INT32_FMTi__ |
<string> |
“i” |
__INT32_MAX__ |
<constant> |
2147483647 |
__INT32_TYPE__ |
<type> |
int |
__UINT32_C_SUFFIX__ |
<text> |
U |
__UINT32_FMTX__ |
<string> |
“X” |
__UINT32_FMTo__ |
<string> |
“o” |
__UINT32_FMTu__ |
<string> |
“u” |
__UINT32_FMTx__ |
<string> |
“x” |
__UINT32_MAX__ |
<constant> |
4294967295U |
__UINT32_TYPE__ |
<type> |
unsigned int |
__INT_MAX__ |
<constant> |
2147483647 |
__SIZEOF_INT__ |
<bytes> |
4 |
__LONG_MAX__ |
<constant> |
2147483647 |
__SIZEOF_LONG__ |
<bytes> |
4 |
__INT_FAST32_FMTd__ |
<string> |
“d” |
__INT_FAST32_FMTi__ |
<string> |
“i” |
__INT_FAST32_MAX__ |
<constant> |
2147483647 |
__INT_FAST32_TYPE__ |
<type> |
int |
__UINT_FAST32_FMTX__ |
<string> |
“X” |
__UINT_FAST32_FMTo__ |
<string> |
“o” |
__UINT_FAST32_FMTu__ |
<string> |
“u” |
__UINT_FAST32_FMTx__ |
<string> |
“x” |
__UINT_FAST32_MAX__ |
<constant> |
4294967295U |
__UINT32_TYPE__ |
<type> |
unsigned int |
__INT_LEAST32_FMTd__ |
<string> |
“d” |
__INT_LEAST32_FMTi__ |
<string> |
“i” |
__INT_LEAST32_MAX__ |
<constant> |
2147483647 |
__INT_LEAST32_TYPE__ |
<type> |
int |
__UINT_LEAST32_FMTX__ |
<string> |
“X” |
__UINT_LEAST32_FMTo__ |
<string> |
“o” |
__UINT_LEAST32_FMTu__ |
<string> |
“u” |
__UINT_LEAST32_FMTx__ |
<string> |
“x” |
__UINT_LEAST32_MAX__ |
<constant> |
4294967295U |
__UINT_LEAST32_TYPE__ |
<type> |
unsigned int |
__INT64_C_SUFFIX__ |
<text> |
LL |
__INT64_FMTd__ |
<string> |
“lld” |
__INT64_FMTi__ |
<string> |
“lli” |
__INT64_MAX__ |
<constant> |
9223372036854775807LL |
__INT64_TYPE__ |
<type> |
long long int |
__UINT64_C_SUFFIX__ |
<text> |
ULL |
__UINT64_FMTX__ |
<string> |
“llX” |
__UINT64_FMTo__ |
<string> |
“llo” |
__UINT64_FMTu__ |
<string> |
“llu” |
__UINT64_FMTx__ |
<string> |
“llx” |
__UINT64_MAX__ |
<constant> |
18446744073709551615ULL |
__UINT64_TYPE__ |
<type> |
long long unsigned int |
__LONG_LONG_MAX__ |
<constant> |
9223372036854775807LL |
__SIZEOF_LONG_LONG__ |
<bytes> |
8 |
__INT_FAST64_FMTd__ |
<string> |
“lld” |
__INT_FAST64_FMTi__ |
<string> |
“lli” |
__INT_FAST64_MAX__ |
<constant> |
9223372036854775807LL |
__INT_FAST64_TYPE__ |
<type> |
long long int |
__UINT_FAST64_FMTX__ |
<string> |
“llX” |
__UINT_FAST64_FMTo__ |
<string> |
“llo” |
__UINT_FAST64_FMTu__ |
<string> |
“llu” |
__UINT_FAST64_FMTx__ |
<string> |
“llx” |
__UINT_FAST64_MAX__ |
<constant> |
18446744073709551615ULL |
__UINT_FAST64_TYPE__ |
<type> |
long long unsigned int |
__INT_LEAST64_FMTd__ |
<string> |
“lld” |
__INT_LEAST64_FMTi__ |
<string> |
“lli” |
__INT_LEAST64_MAX__ |
<constant> |
9223372036854775807LL |
__INT_LEAST64_TYPE__ |
<type> |
long long int |
__UINT_LEAST64_FMTX__ |
<string> |
“llX” |
__UINT_LEAST64_FMTo__ |
<string> |
“llo” |
__UINT_LEAST64_FMTu__ |
<string> |
“llu” |
__UINT_LEAST64_FMTx__ |
<string> |
“llx” |
__UINT_LEAST64_MAX__ |
<constant> |
18446744073709551615ULL |
__UINT_LEAST64_TYPE__ |
<type> |
long long unsigned int |
__INTMAX_C_SUFFIX__ |
<text> |
LL |
__INTMAX_FMTd__ |
<string> |
“lld” |
__INTMAX_FMTi__ |
<string> |
“lli” |
__INTMAX_MAX__ |
<constant> |
9223372036854775807LL |
__INTMAX_TYPE__ |
<type> |
long long int |
__INTMAX_WIDTH__ |
<bits> |
64 |
__UINTMAX_C_SUFFIX__ |
<text> |
ULL |
__UINTMAX_FMTX__ |
<string> |
“llX” |
__UINTMAX_FMTo__ |
<string> |
“llo” |
__UINTMAX_FMTu__ |
<string> |
“llu” |
__UINTMAX_FMTx__ |
<string> |
“llx” |
__UINTMAX_MAX__ |
<constant> |
18446744073709551615ULL |
__UINTMAX_TYPE__ |
<type> |
long long unsigned int |
__INTPTR_FMTd__ |
<string> |
“d” |
__INTPTR_FMTi__ |
<string> |
“i” |
__INTPTR_MAX__ |
<constant> |
2147483647 |
__INTPTR_TYPE__ |
<type> |
int |
__INTPTR_WIDTH__ |
<bits> |
32 |
__UINTPTR_FMTX__ |
<string> |
“X” |
__UINTPTR_FMTo__ |
<string> |
“o” |
__UINTPTR_FMTu__ |
<string> |
“u” |
__UINTPTR_FMTx__ |
<string> |
“x” |
__UINTPTR_MAX__ |
<constant> |
4294967295U |
__UINTPTR_TYPE__ |
<type> |
unsigned int |
__UINTPTR_WIDTH__ |
<constant> |
32 |
__POINTER_WIDTH__ |
<constant> |
32 |
_ILP32 |
<constant> |
Defined to 1 if pointer type width and long type width is 32-bits. |
__ILP32__ |
<constant> |
Defined to 1 if pointer type width and long type width is 32-bits. |
__SIZEOF_POINTER__ |
<bytes> |
4 |
__PTRDIFF_FMTd__ |
<string> |
“d” |
__PTRDIFF_FMTi__ |
<string> |
“i” |
__PTRDIFF_MAX__ |
<constant> |
2147483647 |
__PTRDIFF_TYPE__ |
<type> |
int |
__PTRDIFF_WIDTH__ |
<bits> |
32 |
__SIZEOF_PTRDIFF_T__ |
<bytes> |
4 |
__SIZE_FMTX__ |
<string> |
“X” |
__SIZE_FMTo__ |
<string> |
“o” |
__SIZE_FMTu__ |
<string> |
“u” |
__SIZE_FMTx__ |
<string> |
“X” |
__SIZE_MAX__ |
<constant> |
4294967295U |
__SIZE_TYPE__ |
<type> |
unsigned int |
__SIZE_WIDTH__ |
<bits> |
32 |
__SIZEOF_SIZE_T__ |
<bytes> |
4 |
__WCHAR_MAX__ |
<constant> |
2147483647 |
__WCHAR_TYPE__ |
<constant> |
int |
__WCHAR_WIDTH__ |
<bits> |
32 |
__SIZEOF_WCHAR_T__ |
<bytes> |
4 |
__WINT_MAX__ |
<constant> |
2147483647 |
__WINT_TYPE__ |
<constant> |
int |
__WINT_WIDTH__ |
<bits> |
32 |
__SIZEOF_WINT_T__ |
<bytes> |
4 |
__FLT_DECIMAL_DIG__ |
<digits> |
9 |
__FLT_DENORM_MIN__ |
<constant> |
1.40129846e-45F |
__FLT_DIG__ |
<digits> |
6 |
__FLT_EPSILON__ |
<constant> |
1.19209290e-7F |
__FLT_MANT_DIG__ |
<bits> |
24 |
__FLT_MAX_10_EXP__ |
<constant> |
38 |
__FLT_MAX_EXP__ |
<constant> |
128 |
__FLT_MAX__ |
<constant> |
3.40282347e+38F |
__FLT_MIN_10_EXP__ |
<constant> |
-37 |
__FLT_MIN_EXP__ |
<constant> |
-125 |
__FLT_MIN__ |
<constant> |
1.17549435e-38F |
__FLT_RADIX__ |
<constant> |
2 |
__SIZEOF_FLOAT__ |
<bytes> |
4 |
__DBL_DECIMAL_DIG__ |
<digits> |
17 |
__DBL_DENORM_MIN__ |
<constant> |
4.9406564584124654e-324 |
__DBL_DIG__ |
<digits> |
15 |
__DBL_EPSILON__ |
<constant> |
2.2204460492503131e-16 |
__DBL_MANT_DIG__ |
<bits> |
53 |
__DBL_MAX_10_EXP__ |
<constant> |
308 |
__DBL_MAX_EXP__ |
<constant> |
1024 |
__DBL_MAX__ |
<constant> |
1.7976931348623157e+308 |
__DBL_MIN_10_EXP__ |
<constant> |
-307 |
__DBL_MIN_EXP__ |
<constant> |
-1021 |
__DBL_MIN__ |
<constant> |
2.2250738585072014e-308 |
__DECIMAL_DIG__ |
<constant> |
__LDBL_DECIMAL_DIG__ |
__LDBL_DECIMAL_DIG__ |
<digits> |
17 |
__LDBL_DENORM_MIN__ |
<constant> |
4.9406564584124654e-324 |
__LDBL_DIG__ |
<digits> |
15 |
__LDBL_EPSILON__ |
<constant> |
2.2204460492503131e-16 |
__LDBL_MANT_DIG__ |
<bits> |
53 |
__LDBL_MAX_10_EXP__ |
<constant> |
308 |
__LDBL_MAX_EXP__ |
<constant> |
1024 |
__LDBL_MAX__ |
<constant> |
1.7976931348623157e+308 |
__LDBL_MIN_10_EXP__ |
<constant> |
-307 |
__LDBL_MIN_EXP__ |
<constant> |
-1021 |
__LDBL_MIN__ |
<constant> |
2.2250738585072014e-308 |