| |||
| Home > ARM Compiler Reference > Predefined macros | |||
Table 3.3 lists the macro names predefined by the ARM compiler for C and C++. Where the value field is empty, the symbol is only defined.
Table 3.3. Predefined macros
| Name | Value | When defined |
|---|---|---|
__arm__ | – | Always defined for the ARM compiler,
even when you specify the See
also NoteThese macros are also defined if you invoke the ARM compiler using the commands, armcpp, tcc, and tcpp. |
__ARMCC_VERSION | ver | Always defined. It is a decimal number,
and is guaranteed to increase between releases. The format is
See Table 3.4 for values in current release. NoteUse this to distinguish between RVCT and other tools that
define |
__APCS_ADSABI | – | When you specify the |
__APCS_INTERWORK | – | When you specify the |
__APCS_ROPI | – | When you specify the |
__APCS_RWPI | – | When you specify the |
__APCS_FPIC | – | When you specify the |
__ARRAY_OPERATORS | – | In C++ compiler mode, to specify that array new and delete are enabled. |
__BASE_FILE__ | name | Always defined. Similar to |
__BIG_ENDIAN | – | If compiling for a big-endian target. |
_BOOL | – | In C++ compiler mode, to specify that bool is a keyword. |
__cplusplus | – | In C++ compiler mode. |
__CC_ARM | 1 | Always set to 1 for the ARM compiler,
even when you specify the NoteThis macro is also defined if you invoke the ARM compiler using armcpp, tcc, and tcpp. |
__DATE__ | date | Always defined. |
__EDG__ | – | Always defined. |
__EDG_IMPLICIT_USING_STD | – | In C++ compiler mode when you specify
the |
__EDG_VERSION__ | – | Always set to an integer value that represents
the version number of the EDG front end. For example, version 36
is represented as The version number of the EDG front-end does not necessarily match the RVCT or RVDS version number. |
__EXCEPTIONS | 1 | In C++ mode when you specify the |
__FEATURE_SIGNED_CHAR | – | When you specify the |
__FILE__ | name | Always defined as a string literal. |
__FP_FAST | – | When you specify the |
__FP_FENV_EXCEPTIONS | – | When you specify the |
__FP_FENV_ROUNDING | – | When you specify the |
__FP_IEEE | – | When you specify the |
__FP_INEXACT_EXCEPTION | – | When you specify the |
__GNUC__ | ver | When you specify the See Table 3.4 for value in current release. |
__GNUC_MINOR__ | ver | When you specify the See Table 3.4 for value in current release. |
__IMPLICIT_INCLUDE | – | When you specify the |
__LINE__ | num | Always set. It is the source line number of the line of code containing this macro. |
__MODULE__ | mod | Contains the filename part of the value
of |
__NO_INLINE__ | – | When you specify the |
__OPTIMISE_LEVEL | num | Always set to 2 by default, unless you
change the optimization level using the |
__OPTIMISE_SPACE | – | When you specify the |
__OPTIMISE_TIME | – | When you specify the |
__OPTIMIZE__ | – | When |
__OPTIMIZE_SIZE__ | – | When |
__PLACEMENT_DELETE | – | In C++ compiler mode to specify that placement delete is enabled. This is only relevant when using exceptions. |
__RTTI | – | In C++ compiler mode when RTTI is enabled. |
__sizeof_int | 4 | For |
__sizeof_long | 4 | For |
__sizeof_ptr | 4 | For |
__SOFTFP__ | – | If compiling to use the software floating-point
calling standard and library. Set when you specify the |
__STDC__ | – | In all compiler modes. |
__STDC_VERSION__ | – | Standard version information. |
__STRICT_ANSI__ | – | When you specify the |
__TARGET_ARCH_ARM | num | The number of the ARM base architecture of the target CPU (irrespective of whether the compiler is compiling for ARM or Thumb). |
__TARGET_ARCH_THUMB | num | The number of the Thumb base architecture of the target CPU (irrespective of whether the compiler is compiling for ARM or Thumb). The value is defined as zero if the target does not support Thumb. |
__TARGET_ARCH_ | – |
|
__TARGET_CPU_ | – |
If you specify the target architecture, then If the processor name contains hyphen (-) characters,
these are mapped to an underscore ( |
__TARGET_FEATURE_DOUBLEWORD | – | If the target architecture supports the |
__TARGET_FEATURE_DSPMUL | – | If the DSP-enhanced multiplier is available, for example ARMv5TE. |
__TARGET_FEATURE_MULTIPLY | – | If the target architecture supports the
long multiply instructions |
__TARGET_FEATURE_DIVIDE | – | If the target architecture supports the hardware divide instruction (that is, ARMv7-M or ARMv7-R). |
__TARGET_FEATURE_THUMB | – | If the target architecture supports Thumb (ARMv4T or later). |
__TARGET_FPU_ | – | One of the following is set to indicate the FPU usage:
In
addition, if compiling See the description of the |
__thumb__ | – | When the compiler is in Thumb mode. That
is, you have either specified the Note
|
__TIME__ | time | Always defined. |
__VERSION__ | ver | When you specify the See Table 3.4 for value in current release. |
_WCHAR_T | – | In C++ compiler mode, to specify that wchar_t is a keyword. |
Table 3.4 lists the values of predefined macros in the current release of the compiler. These values might change if you upgrade your installation.
Table 3.4. Macro values in current release
| Name | Value |
|---|---|
__ARMCC_VERSION | Guaranteed to increase between releases,
the format is
The example given results in 300503. |
__GNUC__ | Major version of the GNU mode = 3. |
__GNUC_MINOR__ | Minor version of the GNU mode = 3. |
__VERSION__ | Current version of the GNU mode = |
Where you specify macro command-line options, the compiler defines and undefines macros in the following order:
Compiler predefined macros.
Macros defined explicitly, using -D.name
Macros explicitly undefined, using -U.name
See Setting preprocessor options for details.