Compiler Modes

Several forms of VisualAge C++ compiler invocation commands support various version levels of the C and C++ languages. Normally, you should use the xlc command to compile your C source files and the xlC command to compile your C++ source files. You can, however, use other forms of the command if your particular environment and file systems require it. The various compiler invocation commands are:

Batch Invocation Commands for IBM VisualAge C++

xlC xlC128 xlC_r xlC128_r xlC_r4 xlC_r7 xlC128_r7

xlc xlc128 xlc_r xlc128_r xlc_r4 xlc_r7 xlc128_r7

cc cc128 cc_r cc_r4 cc_r7 cc128_r7

CC_4 CC_r4

c89

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

xlC
Invokes the compiler so that source files are compiled as C++ language source code.

Files with .c suffixes, assuming you have not used the -+ compiler option, are compiled as C language source code with a default language level of ansi, and compiler option -qansialias to allow type-based aliasing.

If any of your source files are C++, you must use this invocation to link with the correct runtime libraries.

xlc
Invokes the compiler for C source files with a default language level of ansi, and compiler option -qansialias to allow type-based aliasing.
cc 
Invokes the compiler for C or C++ source files with a default language level of extended and compiler options -qnoro and -qnoroconst (to provide compatibility with the RT compiler and placement of string literals or constant values in read/write storage). Use this invocation for legacy C code that does not require compliance with ANSI C.
c89
Invokes the compiler for C or C++ source files, with a default language level of ansi, and specifies compiler options -qansialias (to allow type based aliasing) and -qnolonglong (disabling use of long long), and sets -D_ANSI_C_SOURCE (for ANSI-conformant headers). Use this invocation for strict conformance to the ANSI standard (ISO/IEC 9899:1990).

IBM VisualAge C++ provides variations on the four basic batch compiler invocations. These variations are described below:

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 versions of the C and C++ runtimes.
_r-suffixed Invocations All _r-suffixed invocations additionally set the macro names -D_THREAD_SAFE and add the libraries -L/usr/lib/threads-lc_r and -lpthreads. The compiler option -qthreaded is also added. Use these commands if you want to create Posix threaded applications.

AIX 4.1 and 4.2 support Posix Draft 7. AIX 4.3 supports Draft 10. The _r7 invocations are provided on AIX 4.3 to help with migration to Draft 10. See -qthreaded for additional information.

The _r4 invocations should be used for DCE threaded applications.

Migrating AIX Version 3.2.5 DCE Applications to AIX Version 4.1
The main invocation commands (except c89) have additional _r4-suffixed forms. These forms provide compatibility between DCE applications written for AIX Version 3.2.5 and AIX Version 4. They link your application to the correct AIX Version 4 DCE libraries, providing compatibility between the latest version of the pthreads library and the earlier versions supported on AIX Version 3.2.5.



Invoke the Batch Compiler


/etc/vac.cfg - Default Batch Configuration File