Resolving conflicting compiler options

In general, if more than one variation of the same option is specified (with the exception of -qxref and -qattr), 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.

Two exceptions to the rules of conflicting options are the -Idirectory and -Ldirectory options, which have cumulative effects when they are specified more than once.

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. Rules for resolving conflicts between compiler mode and architecture-specific options are discussed in Specifying compiler options for architecture-specific, 32-bit or 64-bit compilation.

Option Conflicting options Resolution
-qalias=allptrs -qalias=noansi -qalias=noansi
-qalias=typeptr -qalias=noansi -qalias=noansi
-qhalt Multiple severities specified by -qhalt Lowest severity specified
-qnoprint -qxref, -qattr, -qsource, -qlistopt, -qlist -qnoprint
-qfloat=rsqrt -qnoignerrno Last option specified
-qxref -qxref=full -qxref=full
-qattr -qattr=full -qattr=full
-qfloat=hsflt -qfloat=spnans -qfloat=hsflt
-qfloat=hssngl -qfloat=spnans -qfloat=hssngl
-E -P, -o, -S -E
-P -c, -o, -S -P
-# -v -#
-F -B, -t, -W, -qpath -B, -t, -W, -qpath
-qpath -B, -t -qpath
-S -c -S
-qnostdinc -qc_stdinc, -qcpp_stdinc -qnostdinc