IBM® z/OS C/C++ compiler feature reference
The following table describes the usage of the supported features by the z/OS® XL C/C++ and Open XL C/C++ for z/OS compilers.
| Feature | z/OS XL C/C++ | Open XL C/C++ for z/OS |
|---|---|---|
| 31-bit addressing mode | Specify ILP32 to select the 31-bit addressing mode, under which the compiler generates AMODE 31 code. | Specify -m32n, -m32n-dll, or -m32 to select the 31-bit addressing mode, under which the compiler generates AMODE 31 code. |
| 64-bit addressing mode | Specify LP64 to select the 64-bit addressing mode, under which the compiler generates AMODE 64 code. | Specify -m64 to select the 64-bit addressing mode, under which the compiler generates AMODE 64 code. |
| C11 standard based compilation | Specify LANGLVL(EXTC1X) for C11 standard-based compilation, invoking all the currently supported C11 features and other implementation-specific language extensions. | Specify -std=c11 for ISO C 2011 standard based compilation or -std=gnu11 for ISO C 2011 standard based compilation with GNU extensions. |
C++ exception handling |
C++ exception handling is enabled by default. Specify NOEXH to disable C++ exception handling support. | C++ exception handling is enabled by default. You can disable C++ exception
handling support with the -fignore-exceptions option.![]() |
| Compiler option to define macros | Specify DEFINE to define a macro. . | Specify -D to define a macro. |
| Extended language level | Specify LANGLVL(EXTENDED) to enable the extended language level. See detail. | Additional z/OS library functions are available only when the macro _EXT is defined. |
| Generate object code for DLLs or DLL applications | Specify DLL to generate object code for DLLs or DLL applications. | Specify -m32 or -m64 to enable the XPLINK linkage, which supports DLL by default; or specify -m32n to enable the DLL linkage in 31-bit addressing mode. |
| Generate reentrant code | Specify NORENT to not generate reentrant code from non-reentrant code. Any naturally reentrant code remains reentrant. | Specify -mno-rent to not generate reentrant code from non-reentrant code. Any naturally reentrant code remains reentrant. |
| Hexadecimal floating-point representation | Specify FLOAT(HEX) for hexadecimal floating-point representation. | Specify -mzos-float-kind=hex for hexadecimal floating-point representation. |
| IEEE decimal floating-point types | Specify DFP to enable support for decimal floating-point types. | Not supported. |
| IEEE floating-point representation | Specify FLOAT(IEEE) for IEEE floating-point representation. | Specify -mzos-float-kind=ieee for IEEE floating-point representation. |
| ISO C/C++ compliant | Specify LANGLVL(ANSI) and later ISO standards and extensions to compile code that is ISO C/C++ compliant. | Supports specific language standards under the -std=<standard_version> option. |
| List stored line numbers | Specify GONUMBER to generate line number tables that correspond to the input source file for Debug Tool and CEEDUMP processing. | Not supported. |
| List function relative offset addresses | Specify OFFSET to list offset addresses relative to entry points of functions. | Not supported. |
| Long external names | Specify LONGNAME or any language level that supports the long
long data type (such as C99 and later) to support external names of mixed case and up to
1024 characters long. |
The compiler supports long external names by default. Specify -mshort-name to enable support for short names. |
long long data type support |
Specify LANGLVL(LONGLONG) or any language level of C99 and
newer to support the long long data type. |
Always supported. |
| MVS environment | Compile your programs in a batch environment, which runs a batch job and uses dataset-based files for input or output. | Compile your programs in a batch environment, which runs a batch job and uses dataset-based files for input or output. |
| Operating system parameter list | Specify PLIST(OS) to make the original operating system parameter list available. | Not supported. |
| Processor architecture | Specify ARCHITECTURE to generate code for a specific processor architecture. | Specify -march to generate code for a specific processor architecture. |
| Round-to-nearest rounding mode | Specify ROUND(N) to enable the round-to-nearest rounding mode. | Specify -fno-rounding-math and -march=zEC12 or higher to enable the round-to-nearest rounding mode. |
| Runtime library extensions | Additional z/OS library functions are available only when the macro _EXT is defined or LANGLVL(EXTENDED) is specified. | Additional z/OS library functions are available only when the macro _EXT is defined. |
| SAA-based language constructs | Specify LANGLVL(SAA) or LANGLVL(SAAL2) to enable the SAA or SAAL2 language level. | Not supported. |
| Target operating system release | Specify TARGET to generate an object module for the target operating system or runtime library. | Specify -mzos-target to control which z/OS level is assumed for running your program. |
| Vector programming support | See VECTOR on how to enable vector programming support. | Specify the following options to enable vector programming support: -mvx, -mzvector, -fvectorize, or -fslp-vectorize. |
| XPLINK linkage | Specify XPLINK to use the XPLINK linkage that is designed to increase performance on z/OS. | Specify -m32 and -m64 to generate XPLINK linkage code. |
| z/OS UNIX invocation commands | Provides two basic invocation commands, xlc and xlC (xlc++), along with several other compiler invocation commands to support various C/C++ language levels and compilation environments under z/OS UNIX. | Provides the ibm-clang and ibm-clang64 invocation commands to compile and link C programs and the ibm-clang++ and ibm-clang++64 invocation commands to compile and link C++ programs. . |
Related information
- For more information about the features and options that are supported by the Open XL C/C++ for z/OS compiler, see the Open XL C/C++ for z/OS documentation.
C++ exception handling
C++ exception handling is enabled by default. You can disable C++ exception
handling support with the 