The following macros can be tested for various features, including source input characteristics, output file characteristics, optimization, and so on. 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: |
|---|---|---|---|
| __ALTIVEC__ | Indicates support for vector data types. (unprotected) | 1 | -qaltivec |
| __64BIT__ | Indicates that 64-bit compilation mode is in effect. | 1 | -q64 |
| _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 |
__EXCEPTIONS |
Indicates that C++ exception handling is enabled. | 1 | -qeh |
| __IBM_GCC_ASM | Indicates support for GCC inline asm statements. | 1 |
|
| 0 |
|
||
__IBM_STDCPP_ASM |
Indicates that support for GCC inline asm statements is disabled. | 0 | -qnoasm=stdcpp |
__IGNERRNO__ |
Indicates that system calls do not modify errno, thereby enabling certain compiler optimizations. | 1 | -qignerrno |
__INITAUTO__ |
Indicates the value to which automatic variables which are not explicitly initialized in the source program are to be initialized. | The two-digit hexadecimal value specified in the -qinitauto compiler option. | -qinitauto=hex value |
__INITAUTO_W__ |
Indicates the value to which automatic variables which are not explicitly initialized in the source program are to be initialized. | An eight-digit hexadecimal corresponding to the value specified in the -qinitauto compiler option repeated 4 times. | -qinitauto=hex value |
__LIBANSI__ |
Indicates that calls to functions whose names match those in the C Standard Library are in fact the C library functions, enabling certain compiler optimizations. | 1 | -qlibansi |
| __LONGDOUBLE64 | Indicates that the size of a long double type is 64 bits. | 1 | -qnoldbl128 |
| __LONGDOUBLE128, __LONG_DOUBLE_128__ | 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 |
__RTTI_DYNAMIC_CAST__ |
Indicates that runtime type identification information for the dynamic_cast operator is generated. | 1 | -qrtti |
__RTTI_TYPE_INFO__ |
Indicates that runtime type identification information for the typeid operator is generated. | 1 | -qrtti |
__NO_RTTI__ |
Indicates that runtime type identification information is disabled. | 1 | -qnortti |
__TEMPINC__ |
Indicates that the compiler is using the template-implementation file method of resolving template functions. | 1 | -qtempinc |
| __VEC__ | Indicates support for vector data types. | 10205 | -qaltivec |