Skip to main content

Software > Software Development > C and C++ Compilers >

z/OS XL C/C++

Features and benefits

With the C/C++ compiler feature of z/OS, you can produce high-performing z/OS-based C/C++ programs to provide optimized business software solutions. This z/OS C/C++ compiler is part of the family of IBM C/C++ compilers that adhere to international standards to allow for easier portability of applications to z/OS from both IBM and non-IBM platforms.

 

Common C/C++ Compiler features
z/OS C Compiler
C and C++ Industry Standards
z/OS C++ Compiler
Documentation
 

Common XL C/C++ Compiler features
IBM z/OS XL C/C++ provides the following features, common to both compilers:

  • z/OS UNIX System Services (z/OS UNIX) support, including the use of the z/OS UNIX Hierarchical File System (HFS) for storage of compiler source and output. (z/OS UNIX was formerly known as OpenEdition.) The z/OS UNIX Shell and Utilities feature provides the c89, c99, and cxx commands for invoking the z/OS XL C/C++ compilers, the Language Environment Prelinker, and the system binder.
  • Coded character set (code page) support; the compiler can process C and C++ syntax characters (such as square brackets) regardless of which Latin-1 EBCDIC coded character set is used to create the source file.
  • DSECT Conversion Utility for converting descriptive data produced by the High Level Assembler licensed program into C/C++ data structures, for C/C++ programs that interface with assembler programs.
  • DLL support for generating Dynamic Link Libraries (DLLs) similar to the way Windows® DLLs are generated. DLLs allow a function call or a variable reference in one load module to use a definition located in another load module at run time. DLL support is also available in the z/OS UNIX environment.
  • Full program reentrancy for C/C++ programs.
  • Interlanguage calls between C and C++ programs, and between C or C++ programs and assembler, COBOL, PL/I or FORTRAN programs.
  • Language Environment preinitialized interface support for greater efficiencies when invoking a C or C++ program repeatedly from a PL/I or assembler program.
  • Longname support so external names can be mixed case and up to 1024 characters long.
  • Optimization of C and C++ code, using the OPT compiler option, in which the compiler changes unoptimized or inefficient code sequences. This includes such things as:
    • Inlining, or replacing of certain function calls with the actual code of the function being performed
    • Value numbering, which involves local constant propagation, local expression elimination, and folding several instructions into a single instruction
    • Straightening, which rearranges program code to minimize branch logic, and combines physically separate blocks of code
    • Common (or duplicate) expression elimination
    • Code motion, or performing calculations outside a loop (if the variables in a loop are not altered within that loop) and using the results within that loop
    • Strength reduction, in which less efficient instructions are replaced with more efficient ones
    • Constant propagation, where the compiler combines constants used in an expression and generates new ones
    • Instruction scheduling, where the compiler reorders instructions to minimize program execution time
    • Dead store elimination, where the compiler eliminates stores when the value stored is never referred to again
    • Dead code elimination, where the compiler eliminates code for calculations that is not required
  • The compiler also performs both intraprocedural and interprocedural analysis. Intraprocedural analysis is a mechanism for performing optimization on each function in a compile unit, using only the information available for that function and compilation unit. Interprocedural analysis is a mechanism for performing optimization across source file boundaries. You can invoke interprocedural analysis by using a compiler option. It performs optimizations that are not otherwise available with the C/C++ compiler.
  • C/C++ support for the z/OS UNIX environment, allowing application developers to use C or C++ to build z/OS UNIX applications.
  • National Language Support to allow dynamic switching between English and Japanese messages.
Back to top

The z/OS XL C Compiler
In addition to the features common to z/OS XL C and XL C++, the z/OS XL C compiler provides you with the following capabilities:

  • The ability to write portable code that supports the following standards:
    • ISO/IEC 9899:1999
    • ANSI/ISO 9899:1990[1992] (formerly ANSI X3.159-1989 C)
    • X/Open Specification Programming Language Issue 3, Common Usage C
    • FIPS-160
  • System programming capabilities, which allow you to use z/OS XL C in place of assembler
  • Additional optimization capabilities through the INLINE compile-time option
  • Extensions of the standard definitions of the C language to provide programmers with support for the z/OS environment, such as fixed-point (packed) decimal data support
The z/OS XL C++ Compiler
In addition to the features common to z/OS XL C and XL C++, the z/OS C++ compiler supports the International Standard for the C++ Programming Language (ISO/IEC 14882:1998) specification.  Also, it further conforms to the Programming languages - C++ (ISO/IEC 14882:2003(E)) standard, which incorporates the latest Technical Corrigendum 1.
Back to top

C and C++ Industry Standards
When used with z/OS UNIX System Services and z/OS Language Environment, the z/OS XL C/C++ compilers provide support for the following standards at the system level:

  • A subset of ISO/IEC 9899:1999
  • ISO/IEC 9945-1:1990 (POSIX-1)/IEEE POSIX 1003.1-1990
  • A subset of IEEE POSIX 1003.1a, Draft 6, July 1991
  • IEEE Portable Operating System Interface (POSIX) Part 2, P1003.2
  • A subset of IEEE POSIX 1003.4a, Draft 6, February 1992 (the IEEE POSIX committee has renumbered POSIX.4a to POSIX.1c)
  • X/Open CAE Specification, System Interfaces and Headers, Issue 4 Version 2
  • A subset of IEEE 754-1985 (R1990) IEEE Standard for Binary Floating-Point Arithmetic (ANSI), as applicable to the S/390® environment.
  • X/Open CAE Specification, Network Services, Issue 4

Documentation
Displayable BookManager and PDF (softcopy) versions of most publications are available on CD with the z/OS Software Products Collection (SK3T-4270).

For a fee, you can order additional copies of the softcopy collection from the IBM Publications Center at:
http://www.ibm.com/shop/publications/order

For other publication ordering options, see:
http://www.ibm.com/servers/eserver/zseries/zos/bkserv/order_books.html

Back to top
We're here to help
Easy ways to get the answers you need.
Request a quote
E-mail IBM

or call us at
877-426-3774
Priority code:
104CBW67


Technical details

Announcing z/OS V1R9

z/OS V1R9.0, Planning for Installation

What's new in z/OS V1R9 XL C/C++


Upgrades/Migrations

Latest PTFs for C/C++ on z/OS, OS/390

Compiler Versions and Marketing/Service Dates

Migrating to z/OS