What's new for z/OS V2R1 XL C/C++

The IBM® z/OS® XL C/C++ compiler delivers the following performance and usability enhancements for the z/OS V2R1 release:

Anonymous structures
The z/OS V2R1 XL C/C++ compiler enables anonymous structures under the EXTC1X extended language level. For more information, see Anonymous structures (C11) in z/OS XL C/C++ Language Reference.
Automonitor type support for XL C/C++ applications
Starting with z/OS V2R1, specifying DEBUG(FORMAT(DWARF)) with OPTIMIZE or NOOPTIMIZE generates automonitor debug information for XL C/C++ applications. For more information, see DEBUG | NODEBUG.
Behavior enhancements
The z/OS V2R1 XL C/C++ compiler introduces the following behavior enhancement:
  • When option LIST() is specified with option IPA, the listing file name will be based on the name of the output file. For detailed information, see LIST | NOLIST.
  • The default of the SUPPRESS option for C++ compilation is changed to SUPPRESS(CCN5900, CCN5922), and NOSUPPRESS accepts suboptions. For detailed information, see SUPPRESS | NOSUPPRESS.
Changes to default ARCH and TUNE level
Starting with z/OS V2R1, the default ARCH level is changed from ARCH(5) to ARCH(7), and the default TUNE level is changed from TUNE(5) to TUNE(7). For detailed information, see ARCHITECTURE and TUNE.
Complex type initialization
Starting with z/OS V2R1, the C11 feature, complex type initialization, is enabled under the EXTC1X extended language level by C and LANGLVL(COMPLEXINIT) by C++. For more information, see Initialization of complex types (C11) in z/OS XL C/C++ Language Reference.
Debug information for parameters and local variables of inlined procedures
Starting with z/OS V2R1, inline debug information can be generated for parameters and local variables of inline procedures. For more information, see DEBUG | NODEBUG.
Explicit conversion operators
Starting with z/OS V2R1, a new C++11 function, explicit conversion operators, is introduced to the z/OS XL C/C++ compiler. You can specify the LANGLVL(EXPLICITCONVERSIONOPERATORS) option to enable this feature. For more information, see LANGLVL.
Extension for __builtin_expect
Starting with z/OS V2R1, the __builtin_expect built-in function is available to aid in portability with the GNU C/C++ __builtin_expect function. For more information, see Extension for __builtin_expect in z/OS XL C/C++ Language Reference.
Generalized constant expressions
The C++11 standard generalizes the concept of constant expressions and introduces a new keyword constexpr as a declaration specifier. For more information, see Generalized constant expressions (C++11) in z/OS XL C/C++ Language Reference.
Generic selection
Generic selection provides a mechanism to choose an expression according to a given type name at compile time, a common usage of which is to define type generic macros. For more information, see Generic selection (C11) in z/OS XL C/C++ Language Reference.
Metal C enhancements
The z/OS V2R1 XL C/C++ compiler introduces the following behavior enhancement for Metal C programs:
  • A Metal C program can have an alternate entry point name for function "main" while maintaining all the characteristics of function "main". For detailed information, see Defining an alternative name for function "main" in z/OS Metal C Programming Guide and Reference.
  • AMODE-switching is supported at IPA link.
  • When option RENT is specified, the LIST form macros (the "XL:DS" constraint) are now placed in the read-only static area instead of the WSA. This means that the data defined by "XL:DS" should not be altered to maintain reentrancy.
  • When the members of a struct are provided as constraints for a coded assembler macro, the same base register with different offsets are now used to represent the address of each struct member, so that less registers are needed for passing constraints into an __asm statement.
Name change of suboption OBJECTMODEL(COMPAT)
Starting with z/OS V2R1, suboption OBJECTMODEL(COMPAT) is changed to OBJECTMODEL(CLASSIC), but COMPAT is still accepted as the synonym of CLASSIC. For detailed information, see OBJECTMODEL (C++ only).
New compiler options and suboptions
The z/OS V2R1 XL C/C++ compiler introduces support for the following new compiler options and suboptions:
  • DEBUG(LEVEL(level)). For detailed information, see DEBUG | NODEBUG.
  • INCLUDE | NOINCLUDE. For detailed information, see INCLUDE | NOINCLUDE.
  • LANGLVL(C1XNORETURN | CONSTEXPR | DEFAULTANDDELETE | EXTC1X | EXPLICITCONVERSIONOPERATORS | REFERENCECOLLAPSING | RIGHTANGLEBRACKET | RVALUEREFERENCES | SCOPEDENUM). For detailed information, see LANGLVL.
  • NAMEMANGLING(zOSV2R1_ANSI). For detailed information, see NAMEMANGLING (C++ only).
  • SMP | NOSMP. For detailed information, see SMP | NOSMP.
  • STRICT(SUBSCRIPTWRAP). For detailed information, see STRICT | NOSTRICT.
  • SYSSTATE. For detailed information, see SYSSTATE (Metal C only).
  • TARGET(zOSV2R1). For detailed information, see TARGET.
  • THREADED | NOTHREADED. For detailed information, see THREADED | NOTHREADED.
New debug information format
Starting with z/OS V2R1, when the DEBUG option is in effect, the compiler generates debug information based on the DWARF Version 4 debugging information format. For more information, see DEBUG | NODEBUG.
New macros
The z/OS V2R1 XL C/C++ compiler introduces support for the following new macros:
  • __IBMC_GENERIC
  • __IBMC_COMPLEX_INIT
  • __IBMC_NORETURN
  • __IBMC_STATIC_ASSERT
  • __IBMCPP_COMPLEX_INIT
  • __IBMCPP_CONSTEXPR
  • __IBMCPP_RIGHT_ANGLE_BRACKET
  • __IBMCPP_RVALUE_REFERENCES
  • __IBMCPP_SCOPED_ENUM
  • __LP64__
For further information about the predefined macros related to language levels, see Macros related to language levels in z/OS XL C/C++ Language Reference.
New hardware built-in functions
The z/OS V2R1 XL C/C++ compiler introduces support for the following new hardware built-in functions:
  • Compare Decimal (CP)
  • Add Decimal (AP)
  • Subtract Decimal (SP)
  • Multiply Decimal (MP)
  • Divide Decimal (DP)
  • Shift and Round Decimal (SRP)
  • Perform Processor Assist (PPA)
  • Zoned to DFP conversion (CDZT)
  • Zoned to DFP conversion (CXZT)
  • DFP to Zoned conversion (CZDT)
  • DFP to Zoned conversion (CZXT)
  • Hardware Transactional Memory Assist Abort (PPA)
For more information, see Using hardware built-in functions in z/OS XL C/C++ Programming Guide.
Right angle brackets
The z/OS V2R1 XL C/C++ compiler removes white space requirement for nested right angle brackets (>>) in C++. You can specify the LANGLVL(RIGHTANGLEBRACKET) option to enable this feature. For more information, see LANGLVL.
Scoped enumerations
The z/OS V2R1 XL C/C++ compiler introduces support for scoped enumerations under the EXTENDED0X language level. You can specify the LANGLVL(SCOPEDENUM) option to enable this feature. For more information, see LANGLVL.
Static assertions
The z/OS V2R1 XL C/C++ compiler introduces support for static assertions to the C/C++ language. You can declare static assertions to check important program invariants at compile time. For more information, see _Static_assert declaration (C11) and static_assert declaration (C++11) in z/OS XL C/C++ Language Reference.
Support for debugging optimized programs
The z/OS V2R1 XL C/C++ compiler supports debugging at a high optimization level. The compiler creates different levels of debugging information depending on the specified optimization and debugging level. For detailed information, see the LEVEL suboption of DEBUG | NODEBUG.
Support for parallel programming
The z/OS V2R1 XL C/C++ compiler introduces support for OpenMP parallelization directives. For more information, see SMP | NOSMP.
The _Noreturn function specifier
Starting with z/OS V2R1, you can use the _Noreturn function specifier to declare a function that does not return to its caller. For more information, see The _Noreturn function specifier in z/OS XL C/C++ Language Reference.
z/OS V1R13 XL C/C++ September 2012 PTF new features

z/OS V1R13 XL C/C++ September 2012 PTF introduces features to support IBM zEnterprise® EC12 (zEC12) systems. These features are inherited by z/OS V2R1 XL C/C++.

z/OS V1R13 XL C/C++ September 2012 PTF introduces support for the following new compiler suboptions:
  • ARCH(10). For detailed information, see ARCHITECTURE.
  • TUNE(10). For detailed information, see TUNE.
z/OS V1R13 XL C/C++ September 2012 PTF introduces support for the following hardware built-in functions to support transaction execution for ARCH(10):
  • __TM_simple_begin
  • __TM_begin
  • __TM_end
  • __TM_abort
  • __TM_named_abort
  • __TM_nesting_depth
  • __TM_non_transactional_store
  • __TM_is_user_abort
  • __TM_is_named_user_abort
  • __TM_is_illegal
  • __TM_is_footprint_exceeded
  • __TM_is_nested_too_deep
  • __TM_is_conflict
  • __TM_is_failure_persistent
  • __TM_failure_address
  • __TM_failure_code
For more information, see Using hardware built-in functions in z/OS XL C/C++ Programming Guide.

For information about the changes that the Language Environment® element has made for z/OS V2R1, see "What's New in Language Environment for z/OS" in z/OS Language Environment Concepts Guide.