Flag options

XL C/C++ supports a number of common conventional flag options used on UNIX® systems. Lowercase flags are different from their corresponding uppercase flags. For example, -c and -C are two different compiler options: -c specifies that the compiler should only preprocess and compile and not invoke the linker, while -C can be used with -P or -E to specify that user comments should be preserved.

XL C/C++ also supports flags directed to other programming tools and utilities (for example, the ld command). The compiler passes on those flags directed to ld at link time.

Some flag options have arguments that form part of the flag. For example:
xlc stem.c -F/home/tools/test3/new.cfg:xlc
where new.cfg is a custom configuration file.
You can specify flags that do not take arguments in one string. For example:
xlc -Ocv file.c
has the same effect as:
xlc -O -c -v file.c

and compiles the C source file file.c with optimization (-O) and reports on compiler progress (-v), but does not invoke the linker (-c).

A flag option that takes arguments can be specified as part of a single string, but you can only use one flag that takes arguments, and it must be the last option specified. For example, you can use the -o flag (to specify a name for the executable file) together with other flags, only if the -o option and its argument are specified last. For example:
xlc -Ovo test test.c
has the same effect as:
xlc -O -v -otest test.c

Most flag options are a single letter, but some are two letters. Note that specifying -pg (extended profiling) is not the same as specifying -p -g (-p for profiling, and -g for generating debug information). Take care not to specify two or more options in a single string if there is another option that uses that letter combination.