Macros related to compiler option settings
The following macros can be tested for various features, including source input characteristics, output file characteristics, and optimization. All of these macros are predefined by a specific compiler option or suboption, or any invocation or pragma that implies that suboption. If the suboption enabling the feature is not in effect, then the macro is undefined.
Predefined macro name | Description | Predefined value | Predefined when the following compiler option or equivalent pragma is in effect |
---|---|---|---|
__64BIT__ | Indicates that 64-bit compilation mode is in effect. | 1 | -q64 |
__ALTIVEC__ | Indicates support for vector data types. (unprotected) | 1 | -qaltivec |
_CHAR_SIGNED, __CHAR_SIGNED__ | Indicates that the default character type is signed char. | 1 | -qchars=signed |
_CHAR_UNSIGNED, __CHAR_UNSIGNED__ | Indicates that the default character type is unsigned char. | 1 | -qchars=unsigned |
__DEBUG_ALLOC__ | Indicates that debug versions of the standard memory management functions are being used. | 1 | -qheapdebug |
__IBM_GCC_ASM | Indicates support for GCC inline asm statements. | 1 | -qasm=gcc and -qlanglvl=extc99 | extc89 | extended or -qkeyword=asm |
0 | -qnoasm and -qlanglvl=extc99 | extc89 | extended or -qkeyword=asm |
||
__IBM_DFP__ | Indicates support for decimal floating-point types. | 1 | -qdfp |
__IBM_DFP_SW_EMULATION__ | Indicates that decimal floating-point computations are implemented through software emulation rather than in hardware instructions. | 1 | -qfloat=dfpemulate |
_IBMSMP | Indicates that IBM SMP directives are recognized. | 1 | -qsmp |
__IBM_UTF_LITERAL | Indicates support for UTF-16 and UTF-32 string literals. | 1 | -qlanglvl=extended |
__LONGDOUBLE64 | Indicates that the size of a long double type is 64 bits. | 1 | -qnoldbl128 |
__LONGDOUBLE128 | Indicates that the size of a long double type is 128 bits. | 1 | -qldbl128 |
__OPTIMIZE__ | Indicates the level of optimization in effect. | 2 | -O | -O2 |
3 | -O3 | -O4 | -O5 | ||
__OPTIMIZE_SIZE__ | Indicates that optimization for code size is in effect. | 1 | -O | -O2 | -O3 | -O4 | -O5 and -qcompact |
__VEC__ | Indicates support for vector data types. | 10206 | -qaltivec |