The following diagram shows the gxlc or gxlc++ syntax:

>>-+-gxlc---+--+------+--+-----------------------------+--+----------------------+--filename-><
+-gxlc++-+ +- -v--+ '- -Wx,--xlc_or_xlc++_options-' '- -gcc_or_g++_options-'
'-gxlC---' '- -vv-'
where:
- filename
- Is the name of the file to be compiled.
- -v
- Verifies the command that is used to invoke XL C/C++.
The utility displays the XL C/C++ invocation
command that it has created, before using it to invoke the compiler.
- -vv
- Runs a simulation. The utility displays the XL C/C++ invocation
command that it has created, but does not invoke the compiler.
- -Wx, xlc_or_xlc++_
options
- Sends the given XL C/C++ options
directly to the xlc or xlc++ invocation command. The utility adds the given
options to the XL C/C++ invocation
it is creating, without attempting to translate them. Use this option
with known XL C/C++ options
to improve the performance of the utility. Multiple xlc_or_xlc++_options are
delimited by a comma.
- -gcc_or_g++_options
- The GNU C/C++ options
that are translated to XL C/C++ options.
The utility emits a warning for any option it cannot translate. The
GNU C/C++ options that are currently recognized
by gxlc or gxlc++ are
in the configuration file gxlc.cfg. Multiple -gcc_or_g++_options are
delimited by the space character.
Examples
To use the GCC
-fstrict-aliasing option
to compile the C version of the Hello World program, you can use:
gxlc -fstrict-aliasing hello.c
which
translates into:
xlc -qalias=ansi hello.c
This command
is then used to invoke the XL C compiler.