Invoking the compiler

Different forms of the XL C compiler invocation commands support various levels of the C language. In most cases, you use the xlc command to compile C source files.

You can use other forms of the command if your particular environment requires it. Table 1 lists the different basic commands, with the special versions of each basic command. Special commands are described in Table 2.

Note: For each invocation command, the compiler configuration file defines default option settings and, in some cases, macros; for information about the defaults implied by a particular invocation, see the /etc/vac.cfg for your system..
Table 1. Compiler invocations
Basic invocations Description Equivalent special invocations
xlc Invokes the compiler for C source files. This command supports all of the ISO C99 standard features, and most IBM language extensions. This invocation is recommended for all applications. xlc_r, xlc_r7, xlc128, xlc128_r, xlc128_r4, xlc128_r7
c99 Invokes the compiler for C source files. This command supports all ISO C99 language features, but does not support IBM language extensions. Use this invocation for strict conformance to the C99 standard. c99_r, c99_r4, c99_r7, c99_128, c99_128_r, c99_128_r4, c99_128_r7
c89 Invokes the compiler for C source files. This command supports all ANSI C89 language features, but does not support IBM language extensions. Use this invocation for strict conformance to the C89 standard. c89_r, c89_r4, c89_r7, c89_128, c89_128_r, c89_128_r4, c89_128_r7
cc Invokes the compiler for C source files. This command supports pre-ANSI C, and many common language extensions. You can use this command to compile legacy code that does not conform to standard C. cc_r, cc_r4, cc_r7, cc128, cc128_r, cc128_r4, cc128_r7
gxlc Invokes the compiler for C source files. This command accepts many common GNU C options, maps them to their XL C option equivalents, and then invokes xlc. For more information, refer to Reusing GNU C compiler options with gxlc.  
Table 2. Suffixes for special invocations
128-suffixed invocations All 128-suffixed invocation commands are functionally similar to their corresponding base compiler invocations. They specify the -qldbl128 option, which increases the length of long double types in your program from 64 to 128 bits. They also link with the 128-bit versions of the C runtime libraries.
_r-suffixed invocations All _r-suffixed invocations allow for threadsafe compilation and you can use them to link the programs that use multi-threading. Use these commands if you want to create threaded applications.

The _r7 invocations are provided to help migrate programs based on Posix Draft 7 to Posix Draft 10. The _r4 invocations should be used for DCE threaded applications. For more information about DCE, see What is DCE? in CICS® Transaction Server for z/OS® Information Center.