Selecting an invocation command

The basic compiler invocation commands appear as the first entry of each line in Table 3. Select a basic invocation using the following criteria:

Table 3. Compiler invocations
Invocation Criteria
xlC
xlc++
Both invoke the compiler so that source files are compiled as C++ language source code. If any of your source files are C++, you must use this invocation to link with the correct runtime libraries. Source files are compiled with -qalias=ansi set.

Files with .c suffixes, assuming you have not used the -+ compiler option, are compiled as C language source code when -qlanglvl=extc89 is in effect.

xlc Invokes the compiler for C source files. The following compiler options are implied with this invocation:
  • -qlanglvl=extc89
  • -qalias=ansi
  • -qcpluscmt
  • -qkeyword=inline
cc Invokes the compiler for C source files. The following compiler options are implied with this invocation:
  • -qlanglvl=extended
  • -qnoro
  • -qnoroconst
c99 Invokes the compiler for C source files, with support for ISO C99 language features. Full ISO C99 (ISO/IEC 9899:1999) conformance requires the presence of C99-compliant header files and runtime libraries. The following options are implied with this invocation:
  • -qlanglvl=stdc99
  • -qalias=ansi
  • -qstrict_induction
  • -D_ANSI_C_SOURCE
  • -D_ISOC99_SOURCE
  • -D__STRICT_ANSI__
Use this invocation for strict conformance to the ANSI standard (ISO/IEC 9899:1999).
c89 Invokes the compiler for C source files, with support for ISO C89 language features. The following options are implied with this invocation:
  • -qlanglvl=stdc89
  • -qalias=ansi
  • -qstrict_induction
  • -qnolonglong
  • -D_ANSI_C_SOURCE
  • -D__STRICT_ANSI__
Use this invocation for strict conformance to the ANSI standard (ISO/IEC 9899:1990).
gxlc++ You can use this utility to compile C++ files. It accepts many common GNU C/C++ options, maps them to their XL C/C++ option equivalents, and then invokes xlc. For more information, refer to Reusing GNU C/C++ compiler options with glxc and glxc++.
gxlc You can use this utility to compile C files. It accepts many common gcc options, maps them to their xlc option equivalents, and then invokes xlc. For more information, refer to Reusing GNU C/C++ compiler options with glxc and glxc++.