IBM C and C++ Compilers
Usage:
xlC [ option | inputfile ]...
xlc [ option | inputfile ]...
cc [ option | inputfile ]...
c89 [ option | inputfile ]...
xlC128 [ option | inputfile ]...
xlc128 [ option | inputfile ]...
cc128 [ option | inputfile ]...
xlC_r [ option | inputfile ]...
xlc_r [ option | inputfile ]...
cc_r [ option | inputfile ]...
xlC_r4 [ option | inputfile ]...
xlc_r4 [ option | inputfile ]...
cc_r4 [ option | inputfile ]...
CC_r4 [ option | inputfile ]...
xlC_r7 [ option | inputfile ]...
xlc_r7 [ option | inputfile ]...
cc_r7 [ option | inputfile ]...
Description:
The xlC and related commands compile C and C++ source files.
They also processes assembler source files and object files. Unless the
-c option is specified, xlC calls the linkage editor to produce a
single object file. Input files may be any of the following:
1. file name with .C suffix: C++ source file
2. file name with .i suffix: preprocessed C or C++ source file
3. file name with .c suffix: C source file
4. file name with .o suffix: object file for ld command
5. file name with .s suffix: assembler source file
6. file name with .so suffix: shared object file
Options:
Options can be flag options or keyword options:
1. Flag options:
-# Display language processing commands but do
not invoke them; output goes to stdout.
-+ Treat .c files as C++ source code.
-bdynamic, -bstatic
Determines which types of library files are searched by
the linkage editor.
-brtl Tells the linkage editor to accept both .so and .a
library file types.
-B
Construct alternate compiler/assembler/linkage editor
program names. is added to the beginning of
the standard program names.
-c Do not send object files to the linkage editor.
-C Write comments to output when doing preprocessing,
used with -E and -P.
-D[=]
Define as in #define directive. If is
not specified, 1 is assumed.
-E Preprocess but do not compile; output goes to stdout
-F[:]
Use alternate configuration file with optional
. If is not specified, xlC is
assumed.
-g Produce information for the debugger.
-I Search in directory for include files that
do not start with an absolute path.
-l Search the specified library file,
where selects the file lib.a.
-L Search in directory for files specified by -l.
-ma Generate inline calls to the "alloca" function as if
"#pragma alloca" directives were in the source file.
-M Generate information to be included in a "make"
description file; output goes to .u file.
-o Name the executable file instead of a.out.
When used with the -c option and one source file,
name the object file instead of filename.o.
If is the name of a directory, files generated by
the compiler will be placed into that directory.
-O Optimize generated code.
-O2 Equivalent level of optimization as -O in the
previous release.
-O3 Perform some memory and compile time intensive
optimizations in addition to those executed with -O2.
The -O3 specific optimizations have the potential to
alter the semantics of a user's program.
The compiler guards against these optimizations at -O2
and the option -qstrict is provided at -O3 to turn off
these aggressive optimizations.
-O4 (C) Equivalent to -O3 -qipa with automatic generation of
architecture and tuning option ideal for that platform.
-p Generate profiling support code.
-pg Generate profiling support code including BSD
profiling support.
-P Preprocess but do not compile; output goes to .i file.
-Q (C++) Requests inlining of inline routines.
-Q! (C++) Turns off inlining.
-Q, -qinline
(C) Inline all appropriate functions where x can be
one of the following:
! Not inline any function
= Inline if number of source statement in
function is less than the number specified
in .
- Not inline function listed by names in
+ Attempt to inline function listed by names
in .
-r Permits the output file to be produced even if it
contains unresolved symbols.
-S Produce a .s file for any source file processed by the
compiler.
-t Apply prefix from the -B option to the specified program ,
where x can be one or more of the following:
p = preprocessor
c = compiler frontend
b = compiler backend
i = compiler inliner
a = assembler
l = linkage editor.
m = 'munch' utility
f = C++ name demangler utility
I = inter procedural analysis compile phase
L = inter procedural analysis link phase
-U Undefine name as in #undef directive.
-v Displays language processing commands as they
are invoked by xlC; output goes to stdout.
-w Suppress informational, language-level, and
warning messages.
-W Give the options to the compiler program
where x can be one or more of the following:
-y Specify compile-time rounding of constant floating-point
expressions, where can be one of the following:
n = round to nearest
m = round toward minus infinity
p = round toward positive infinity
z = round toward zero.
2. Keyword options:
Keyword options are specified in one of the following ways:
-q
-q =
-q=:
where is an option name and is a
parameter value.
Keyword options with no parameters represent switches
that may be either on or off. The keyword by itself turns
the switch on, and the keyword preceded by the letters NO
turns the switch off. For example, -qLIST tells the
compiler to produce a listing and -qNOLIST tells the
compiler not to produce a listing. If an option that
represents a switch is set more than once, the compiler
uses the last setting.
Keyword option and parameter names may appear in either
UPPER CASE or lower case letters in the xlC command.
Options without parameters:
32 Selects 32-bit compiler mode.
64 Selects 64-bit compiler mode.
ansialias Use type-based aliasing during optimization.
attr Produce an attribute listing containing only
referenced names; output goes to .lst file.
compact Reduce code size where possible, at the expense
of execution speed. Code size is reduced by
inhibiting optimizations that replicate or expand
code inline.
cpluscmt (C) Permit "//" to introduce a comment that lasts
until the end of the current source line, as in C++.
dbcs String literals and comments can contain DBCS
characters (same as mbcs option).
dbxextra Generate symbol table information for unreferenced
variables. By default such information is not generated
thus reducing the size of the executable compiled with
the "-g" option.
digraph Allow special digraph
dollar Allow '$' as an identifier character
extchk Perform external name type-checking and function
call checking.
fdpr Collect information about programs for use with
the AIX fdpr (Feedback Directed Program Restructuring)
performance-tuning utility.
funcsect Place instructions for each function in a separate csect.
flttrap Generate instructions to trap floating-point
exceptions.
fold Specifies that constant floating-point expressions
are to be evaluated at compile time.
fullpath Specifies the path information stored for files when
you use "-g" and the symbolic debugger (dbx).
heapdebug Enables debug versions of memory management functions.
idirfirst Specify the search order for files included with
the #include "file_name" directive. Use -qidirfist
with the -Idirectory option. If -qidirfirst option
is specified, the directories specified by the
-Idirectory option are searched before the directory
where the current file resides.
ignerrno Tell the optimizer that the program will never
refer to or set errno. This allows additional
optimizations.
inlglue Generate fast external linkage by inlining the
code (pointer glue code) necessary at calls
via a function pointer and calls to external
procedures.
ldbl128 Increase long double size from 64 to 128 bits.
libansi Assumes that all functions with the names of an
ANSI C library functions are in fact the system functions.
linedebug Generates abbreviated line number and source file name
information for the debugger.
list Produce an object listing; output goes to .lst file.
listopt Display the settings of all options; output goes
to .lst file.
longdouble Increase long double size from 64 to 128 bits.
longlong Allow long long integers.
macpstr Allow '\p' as the first character of a string constant
which will be replaced by the length in bytes.
makedep Creates an output file that contains targets suitable for
inclusion in a description file for the AIX make command.
mbcs String literals and comments can contain DBCS
characters (same as dbcs option).
noprint Direct listing to /dev/null.
nostdinc Specify which files are included with the #include
"file_name" and #include directives.
If -qnostdinc is specified, the /usr/include (C) or
/usr/ibmcxx/include & /usr/include (C++) directories
are not searched.
once Only process each include file one time.
The default is -qnoonce.
optimize Same as O, and O2. Perform optimization that is the
mix between speed and size.
pascal Accept and ignore the keyword 'pascal' as a
type modifier.
pdf1, pdf2 Perform aggressive optimizations with profile
directed feedback.
phsinfo Produce compiler phase information; output goes to
stdout.
proto (C) Assert that procedure call points agree
with their declarations even if the procedure has
not been prototyped. This allows the caller to
pass floating point arguments in floating point
registers instead of general purpose registers.
ro Put string literals in read only area.
roconst Put constant values in read only area.
rwvftable (C++) Place virtual function tables into
read/write memory.
showinc Include the source of all included files in the
source listing, if the SOURCE option is in effect.
source Produce a source listing; output goes to .lst file.
srcmsg Reconstruct source lines in error along with the
diagnostic messages in the stderr file.
statsym Adds user-defined, nonexternal names that have a
persistent storage class, such as initialized and
uninitialized static variables, to the name list
(the symbol table of xcoff objects).
strict Valid only at -O3. This option turns off aggresive
optimizations which have the potential to alter the
semantics of a user's program. This option also sets
-qfloat=nofltint:norsqrt.
strict_induc This option turns off induction variable optimizations
that have the potential to alter the semantics of a
user's program. The default is "nostrict_induc" at
-O3 and higher and "strict_induc" otherwise. "nostrict_induc"
is recomended if your program does not have overflows or
wrap arounds of loop induction variables.
tempinc Automatically generate template functions in the
"tempinc" subdirectory. Use the "notempinc" option to
suppress this behaviour.
twolink (C++) Link twice in order to minimize the number
of static constructors included from libraries (default
with langlvl=compat).
unique (C++) Generates unique names for static
constructor/destructor file compilation units.
syntaxonly Causes the compiler to perform syntax checking without
generating an object file.
upconv (C) Preserves the unsigned specification when performing
integral promotions.
vftable (C++) Force virtual function tables to be generated
in this compilation unit. The default is to define the
virtual function table for a class where the first
non-inline virtual member function is declared. If
-qnovftable is specified, then no virtual function tables
are produced.
warn64 Enables checking for possible long-to-integer or
pointer-to-int truncation.
xcall Generate code to static routines within a compilation
unit as if they were external routines.
xref Produce a cross-reference listing containing
only referenced names.
Options with parameters:
alias=
Specifies the aliasing assertion to be applied to
your compilation unit.
The available options are:
typ Pointers to different types are never aliased.
allp Pointers are never aliased.
addr Variables are disjoint from pointers
unless their address is taken.
ansi Pointers can only point to an object of the
same type. Require -O option.
align=
power The compiler uses the RISC System/6000
alignment rules.
full The compiler uses the RISC System/6000
alignment rules. This is the same as power.
mac68k The compiler uses the Macintosh**
alignment rules.
twobyte The compiler uses the Macintosh alignment rules.
The mac68k option is the same as twobyte.
packed The compiler uses the packed alignment rules.
natural The compiler maps structure members to
their natural boundaries.
arch=
Specifies the architecture on which the executable
program will be run.
The available options are:
com Produce an object that contains instructions
that will run on all the POWER and PowerPC
hardware platforms.
pwr Produce an object that contains instructions
that will run on the POWER hardware
platform.
pwr2 Produce an object that contains instructions
that will run on the POWER2 hardware
platform.
pwrx Same as pwr2.
ppc Produce an object that contains instructions
that will run on any of the 32-bit PowerPC
hardware platforms.
ppcgr Produce an object that contains optional
graphics instructions for PowerPC processors.
pwr2s Produce an object that contains instructions
that will run on a pwr2s chip.
p2sc Produce an object that contains instructions
that will run on a p2sc chip.
601 Produce an object that contains instructions
that will run on a 601 chip.
602 Produce an object that contains instructions
that will run on a 602 chip.
603 Produce an object that contains instructions
that will run on a 603 chip.
604 Produce an object that contains instructions
that will run on a 604 chip.
403 Produce an object that contains instructions
that will run on a 403 chip.
rs64a Produce an object that contains instructions
that will run on a rs64a chip.
The default is -qarch=com. If the -qarch option is
specified without the -qtune= , the compiler
uses -qtune=pwr.
assert=
Specifies the aliasing assertion to be applied to
your compilation unit.
The available options are:
typ Pointers to different types are never aliased.
allp Pointers are never aliased.
addr Variables are disjoint from pointers
unless their address is taken.
attr=full
Produce an attribute listing containing all names,
whether referenced or not; output goes to .lst file.
bitfields=signed
bitfields=unsigned
Specify whether bitfields will be signed or unsigned.
chars=signed
chars=unsigned
Specify whether the data type char will be signed
or unsigned.
check=
Generate code to check for run-time checks.
nullptr Runtime checking of addresses
contained in pointer variables used to
reference storage.
bounds Runtime checking of addresses when
subscripting within an object of known size.
divzero Runtime checking of integer division.
A trap will occur if an attempt is made to
divide by zero.
all Switches on all the above suboptions.
cinc=
(C++) Include files from directories starting with
have the tokens 'extern "C" {' inserted
before the file and '}' after it.
datalocal=:: ...
Specify which data items are local. If no names are
specified, all data items are assumed to be local.
dataimported=:: ...
Specify which data items are imported. If no names are
specified, all data items are assumed to be imported.
This is the default.
enum=
Specify whether minimum-sized enumerated types will be
produced or not. can be either small, int,
(C++)intlong, 1, 2, 4 or 8.
small denotes that either one, two or four bytes of
storage will be allocated for enum variables
based on the range of the enum constants.
int is the default, and causes enum variables to be
treated as though they were of type signed int
depending on the range of the enum constants.
depending on the range of the enum constants.
intlong (C++) specifies that enumerations occupy 8
bytes of storage and are represented by long,
if -q64 is specified and the range of the
enum constants exceed the limit for int.
1 will cause enum variables to be packed into 1 byte.
2 will cause enum variables to be packed into 2 bytes.
4 will cause enum variables to be packed into 4 bytes.
8 will cause enum variables to be packed into 8 bytes.
flag=
Specify severity level of diagnostics to be reported
in source listing and stderr; the severity level
is one of .
flag=:
Specify severity level of diagnostics to be reported
in source listing (), and stderr ();
the severity levels are one of .
float=::...:
The available options are:
emulate Function calls are emitted in place of
PowerPC floating-point instructions.
Use this option only in a single-threaded
stand-alone environment, targeting the
PowerPC 403 processor.
Do not use this suboption with any of the
following:
o -qarch=pwr, -qarch=pwr2, -qarch=pwrx
o -qlongdouble, -qldbl128
o xlC128, xlc128 invocation commands
fltint Specify whether range checking of floating
point to integer conversions is done.
Default at -O2: -qfloat=nofltint.
Default at -O3: -qfloat=fltint.
hsflt Never round single-precision expressions,
and don't perform range checking for
floating-point to integer conversions.
hssngl Round single-precision expressions only
when the results are stored into REAL*4 memory
locations.
nans Detect conversion of single-precision NaNS to
double precision call checking.
nomaf Suppress generation of multiply-add
instructions.
nofold Suppress compile-time evaluation of constant
floating-point expressions.
rndsngl Ensure strict adherence to IEEE standard.
all operations on single-precision values
produce results that remain in single
precision.
rrm Specify run-time rounding mode. Compile with
this option if the run-time rounding mode
is round toward minus infinity, round toward
positive infinity, or not known.
rsqrt Specify whether a division by the result of a
square root can be replaced with a multiply
by the reciprocal of the square root.
Default at -O2: -qfloat=norsqrt.
Default at -O3: -qfloat=rsqrt.
spnans Generate extra instructions to detect signalling
NaN on conversion from single precision to
double precision. Obsolete; use the equivalent
-qfloat=nans option.
flttrap=::...:
Generate instructions to detect and trap floating-point.
The available options are: overflow, underflow,
zerodivide, invalid, inexact, enable, imprecise.
halt=
Stop compiler after first phase if severity of errors
detected equals or exceeds ; the severity
level is one of i, w, e, s, u.
genpcomp[=dirname]
Generate precompiled include files. See IBM C and C++
Compilers User's Guide for details.
genproto=
Produces ANSI prototypes from K&R function definitions.
ignprag=disjoint
ignprag=isolated
ignprag=all
Ignore the aliasing pragmas disjoint and/or
isolated_call.
info
info=all
Produce additional lint-like messages. Turns on all
diagnostic messages for all groups.
info=
Produce additional lint-like messages based on .
cmp Possible redundancies in unsigned comparisons
cnd Possible redundancies or problems in conditional
expressions
cns Operations involving constants.
cnv Conversions
dcl Consistency of declarations
eff Statements with no effect
enu Consistency of enum variables
ext Unused external definitions
gen General diagnostic messages
gnr Generation of temporary variables
got Use of goto statements
ini Possible problems with initialization
inl Functions not inlined
lan Language level effects
obs Obsolete features
ord Unspecified order of evaluation
par Unused parameters
por Nonportable language constructs
ppc Possible problems with using the preprocessor
ppt Trace of preprocessor actions
pro Missing function prototypes
rea Code that cannot be reached
ret Consistency of return statements
trd Possible truncation or loss of data or precision
tru Variable names truncated by the compiler
uni Unitialized variables
use Unused auto and static variables
vft (C++) Generation of virtual function tables
initauto=
Initialialize automatic storage to . is a
hexadecimal value. This generates extra code and
should only be used for error determination.
inline[=]
This is functionally equivalent to the -Q option.
ipa[=]
(C) Turn on inter-procedural analysis. See IBM C and C++
Compilers User's Guide for details.
isolated_call=:: ...
Specify that the calls to the functions listed have no
side effects. and are function names.
The user may specify as many function names as
necessary.
langlvl=
Specify language level to be used during compilation.
can be ansi, saal2, saa, extended, or classic.
maxerr=[:]
Instructs the compiler to halt compilation when
errors of or greater severity is reached. The
default for is current value of the -qhalt option.
maxmem=
Limit the amount of memory used by space intensive
optimizations to . specified in kilobytes.
prioriry=NNN
priority=
(C++) Specifies the priority level for the initialization
of static constructors.
optimize
Same as -O. Optimize generated code using the best
best combination for speed and size.
optimize=
Enables different levels of optimization.
2 Same as -O and -qoptimize.
3 Same as -O3. Aggresive optimization.
4 (C) Same as -O4. Internally generates -O3 -qipa
with with automatic architecture and tuning option
generation.
proclocal=:: ...
Specify which functions are local.
If no filenames are specified, all invoked functions
are assumed to be defined whithin the current file.
The last explicit specification for a function takes
precedence.
procimported=:: ...
Specify which functions are imported. If no filenames
are specified, all invoked functions are assumed to be
defined outside the current file. The last explicit
specification for a function takes precedence.
procunknown=:: ...
Specify which functions are unknown to be local or
imported. If no filenames are specified, all functions
called are assumed to be unknown. This is the default
when no user options are specified. The last explicit
specification for a function takes precedence.
rtti=
(C++) Use this option to generate run-time type
identification (RTTI) information for the typeid
operator and the dynamic_cast operator.
all The compiler generates the
information needed for the RTTI typeid
and dynamic_cast operators.
type | typeinfo The compiler generates the information
needed for the RTTI typeid operator,
but the information needed for
dynamic_cast operator is not generated.
dyna | dynamiccast
The compiler generates the information
needed for the RTTI dynamic_cast
operator, but the information needed for
typeid operator is not generated.
spill=
Specify the size of the register allocation spill
area.
tabsize=
Changes the length of tabs in your source file.
tbtable=
Generate a traceback table for each function and
place it in the text segment at the end of the
function code.
The available options are:
none No traceback table is generated.
full A full traceback table is generated.
This is the default with -g specified.
small A traceback table is generated with no name or
parameter information.
This is the default when -g is NOT specified.
tune=
Specifies the architecture system for which the
executable program is optimized.
The available options are:
403 Produce an object optimized for all the
PowerPC 403 processors.
Use -qfloat=emulate to emulate the floating-point
instructions omitted by the 403 processor.
601 Produce an object optimized for all the
PowerPC 601 processors.
602 Produce an object optimized for all the
PowerPC 602 processors.
603 Produce an object optimized for all the
PowerPC 603 processors.
604 Produce an object optimized for all the
PowerPC 604 processors.
p2sc Produce an object optimized for all the
p2sc processors.
pwr Produce an object optimized for the POWER
hardware platform.
pwr2 Produce an object optimized for the
POWER2 hardware platform.
pwr2s Produce an object optimized for the
POWER2 hardware platform, avoiding certain
quadruple-precision instructions that would
slow program performance.
pwrx Same as pwr2.
rs64a Produce an object optimized for all the
rs64a processors.
tempinc[=]
(C++) Automatically generate template functions in the
specified directory. Use the "notempinc" option
to suppress this behaviour.
tempmax=
(C++) Specify the maximum number of files to be created
in the tempinc directory for each template file. The
default is 1.
unroll[=n]
Allow the optimizer to unroll loops.
usepcomp[=dirname]
Use precompiled include files. See IBM C and C++
Compilers User's Guide for details.
wait[=]
Specify the number of seconds to wait for a LUM
license to become available. The default is to wait
forever.
xref=full
Produce a cross-reference listing containing
all names, whether referenced or not; output goes
to .lst file.
Environment Variables
1.OBJECT_MODE changes the compilation-mode behavior, unless overridden by
configuration file or command-line options
Setting
not set 32-bit compiler mode.
32 32-bit compiler mode.
64 64-bit compiler mode.
32_64 Fatal error and stop, unless an explicit configuration
file or command-line compiler-mode setting exists.
any other Fatal error and stop, unless an explicit configuration
file or command-line compiler-mode setting exists.
For a detailed description of each option, please refer to the
IBM C and C++ Compilers User's Guide.