Resolving conflicting compiler options

In general, if more than one variation of the same option is specified, the compiler uses the setting of the last one specified. Compiler options specified on the command line must appear in the order you want the compiler to process them. However, some options have cumulative effects when they are specified more than once; examples are the -Idirectory, -Ldirectory, and -Rdirectory_path options.

When options such as -qcheck, -qfloat, and -qstrict are specified with suboptions for multiple times, each suboption overrides previous specifications of that suboption, but different suboptions are cumulative.

In most cases, the compiler uses the following order in resolving conflicting or incompatible options:

  1. Pragma statements in source code override compiler options specified on the command line.
  2. 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 on the command line, the option appearing later on the command line takes precedence.
  3. Compiler options specified as environment variables override compiler options specified in a configuration file.
  4. Compiler options specified in a configuration file override compiler default settings.

Not all option conflicts are resolved using the preceding rules. The following table summarizes exceptions and how the compiler handles conflicts between them.

Option Conflicting options Resolution
-qfloat=rsqrt -qnoignerrno Last option specified
-qfloat=hsflt -qfloat=spnans -qfloat=hsflt
-E -P, -S -E
-P -c, -o, -S -P
-# -v -#
-F -B, -t, -W, -qpath -B, -t, -W, -qpath
-qpath -B, -t -qpath
-S -c -S
-nostdinc, -nostdinc++ (-qnostdinc) -isystem (-qc_stdinc, -qcpp_stdinc, -qgcc_c_stdinc, -qgcc_cpp_stdinc) -nostdinc, -nostdinc++ (-qnostdinc)


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us