Compiler options perform a variety of functions, such as setting compiler characteristics, describing the object code to be produced, controlling the diagnostic messages emitted, and performing some preprocessor functions.
- On the command-line with command-line compiler options
- In your source code using directive statements
- In a makefile
- In the stanzas found in a compiler configuration file
- Or by using any combination of these techniques
Generally, if the same compiler option is specified more than once on a command-line when invoking the compiler, the last option specified prevails.
- Directive statements in your source file override command-line settings
- Command-line compiler option settings override configuration file settings
- Configuration file settings override default settings
For example, the -I compiler option is a special case. The compiler searches any directories specified with -I in the vac.cfg file before it searches the directories specified with -I on the command-line. The option is cumulative rather than preemptive.
See the XL C/C++ Compiler Reference for more information about compiler options and their usage.
Other options with cumulative behavior are -R and -l (lowercase L).
You can also pass compiler options to the linker, assembler, and preprocessor. See Compiler options reference for more information about compiler options and how to specify them.