Macros indicating the XL C/C++ compiler

Macros related to the XL C/C++ compiler are always predefined, and they are protected, which means that the compiler will issue a warning if you try to undefine or redefine them. You can use the -dM (-qshowmacros) -E compiler options to view the values of the predefined macros.

Table 1. Compiler-related predefined macros
Predefined macro name Description Predefined value
C only begins__IBMC__1 Indicates the level of the XL C compiler. An integer in format VRM, where:
V
Represents the version number
R
Represents the release number
M
Represents the modification number
C++ only begins__IBMCPP__1 Indicates the level of the XL C++ compiler. An integer in format VRM, where:
V
Represents the version number
R
Represents the release number
M
Represents the modification number
C++ only begins__xlC__1 Indicates the VR level of the XL C and XL C++ compilers in hexadecimal format. The XL C compiler predefines this macro. A 4-digit hexadecimal integer in format 0xVVRR, where:
V
Represents the version number
R
Represents the release number
C++ only begins__xlC_ver__1 Indicates the MF level of the XL C and XL C++ compilers in hexadecimal format. The XL C compiler predefines this macro. An 8-digit hexadecimal integer in format 0x0000MMFF, where:
M
Represents the modification number
F
Represents the fix level
C only begins__xlc__1 Indicates the level of the XL C compiler. A string in format V.R.M.F, where:
V
Represents the version number
R
Represents the release number
M
Represents the modification number
F
Represents the fix level
__clang__ Indicates that Clang compiler is used. 1
__clang_major__ Indicates the major version number of the Clang compiler. 3
__clang_minor__ Indicates the minor version number of the Clang compiler. 4
__clang_patchlevel__ Indicates the patch level number of the Clang compiler. 0
__clang_version__ Indicates the full version of the Clang compiler. 3.4 (tags/RELEASE_34/final)
__ibmxl__ Indicates the XL C/C++ compiler is being used. 1
__ibmxl_vrm__ Indicates the VRM level of the XL C/C++ compiler using a single integer for sorting purposes. A hexadecimal integer whose value is as follows:
(((__ibmxl_version__) << 24) | \
 ((__ibmxl_release__) << 16) | \ 
 ((__ibmxl_modification__) << 8) \
)
__ibmxl_version__ Indicates the version number of the XL C/C++ compiler. An integer that represents the version number
__ibmxl_release__ Indicates the release number of the XL C/C++ compiler. An integer that represents the release number
__ibmxl_modification__ Indicates the modification number of the XL C/C++ compiler. An integer that represents the modification number
__ibmxl_ptf_fix_level__ Indicates the PTF fix level of the XL C/C++ compiler. An integer that represents the fix number
__llvm__ Indicates that an LLVM backend is used. 1
Note:
  1. This macro is predefined by the compiler with the -qxlcompatmacros option. The option helps you migrate programs from IBM® XL C/C++ for Linux V13.1 or earlier for big endian distributions to IBM XL C/C++ for Linux V13.1.3 for little endian distributions. However, it is recommended that you use the -qnoxlcompatmacros option to undefine these legacy macros when you migrate programs from V13.1.1 Linux for little endian distributions to V13.1.3 Linux for little endian distributions.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us