Conflicting compiler options

The COBOL for AIX compiler can encounter conflicting compiler options in either of two ways: both the positive and negative form of an option are specified at the same level in the hierarchy of precedence of options, or mutually exclusive options are specified at the same level.

The compiler recognizes options in the following order of precedence from highest to lowest:

  1. Options specified in the PROCESS (or CBL) statement
  2. Options specified in the cob2, cob2_j, or cob2_r command invocation
  3. Options set in the COBOPT environment variable
  4. Options set in the compopts attribute of the configuration (.cfg) file
  5. IBM default options

If you specify conflicting options at the same level in the hierarchy, the option specified last takes effect.

If you specify mutually exclusive compiler options at the same level, the compiler forces one of the options to a nonconflicting value, and generates an error message. For example, if you specify both OPTIMIZE and TEST in the PROCESS statement in any order, TEST takes effect and OPTIMIZE is ignored, as shown in the following table.

Table 1. Mutually exclusive compiler options
Specified Ignored Forced on
CICS ADDR(64) ADDR(32)
DYNAM NODYNAM
NOLIB LIB
THREAD NOTHREAD
MDECK NOLIB LIB
SQL NOLIB LIB
TEST OPTIMIZE NOOPTIMIZE

However, options specified at a higher level of precedence override options specified at a lower level of precedence. For example, if you code TEST in the COBOPT environment variable but OPTIMIZE in the PROCESS statement, OPTIMIZE takes effect because the options coded in the PROCESS statement and any options forced on by an option coded in the PROCESS statement have higher precedence.

related tasks  
Compiling programs