Compiler options perform a wide variety of functions, such as setting
compiler characteristics, describing the object code and compiler
output to be produced, and performing some preprocessor functions.
You can specify compiler options in one or more of the following ways:
- On the command line
- In a custom configuration file, which is a file with a .cfg extension
- In your source program
- As system environment variables
- In a makefile
The compiler assumes default settings for most compiler options
not explicitly set by you in the ways listed above.
When specifying compiler options, it is possible for option conflicts
and incompatibilities to occur. The XL C/C++ compiler
resolves most of these conflicts and incompatibilities in a consistent
fashion, as follows:
In most cases, the compiler uses the following order in resolving
conflicting or incompatible options:
- Pragma statements in source code override compiler
options specified on the command line.
- Compiler options specified on the command line override compiler
options specified as environment variables
or in a configuration file. If conflicting or incompatible compiler
options are specified in the same command line compiler invocation,
the subsequent option in the invocation takes precedence.
- Compiler options specified as environment
variables override compiler options specified in a configuration file.
- Compiler options specified in a configuration file, command line
or source program override compiler default settings.
See the following topics for further
details: