| |||
| Home > ARM Compiler Reference > Predefined macros | |||
Table 3.5 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.5. Predefined macros
| Name | Value | When defined |
|---|---|---|
__arm__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
The example given results in 220841. 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 |
__APCS_SWST | – | 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. |
c_plusplus | – | In C++ compiler mode, but not in strict mode. |
__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 | When date of translation of source file is required. |
__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 3.0 is represented as 300. |
__EXCEPTIONS | 1 | In C++ mode when you specify the |
__FEATURE_SIGNED_CHAR | – | When you specify the |
__FILE__ | name | The name of the current source file. |
__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 |
__FUNCTION__ | name | The name of the current function. This holds the function name, even if the function is inlined. |
__GNUC__ | ver | When you specify the For RVCT v2.2, the value is 3. |
__GNUC_MINOR__ | ver | When you specify the For RVCT v2.2, the value is 0. |
__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. |
__PRETTY_FUNCTION__ | name | The unmangled name of the current function. This holds the unmangled function name, even if the function is inlined. |
__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_HALFWORD | – | If the target architecture supports halfword and signed byte access instructions, for example ARMv4T and later. |
__TARGET_FEATURE_MULTIPLY | – | If the target architecture supports the
long multiply instructions |
__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__thumb__ | – | When the compiler is in Thumb mode. That
is, you have either specified the Note
|
__TIME__ | time | When time of translation of the source file is required. |
__VERSION__ | ver | When you specify the For
RVCT v2.2, the value is |
_WCHAR_T | – | In C++ compiler mode, to specify that wchar_t is a keyword. |
Where you specify macro 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.