Specifying compiler options
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
- Most options specified on the command line override both the default settings of the option and options set in the configuration file. Similarly, most options specified on the command line are in turn overridden by pragma directives, which provide you a means of overriding compiler options right in the source file.
- In your source code
- You can specify some compiler options within your source code by using pragma directives.
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 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 directives in source code override compiler options specified on the command line.
- Compiler options specified on the command line override compiler options specified 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 in a configuration file, command line or source code override compiler default settings.