INITCHECK
Use the INITCHECK option to have the compiler
check for uninitialized data items and issue warning messages when
they are used without being initialized.
Default is: NOINITCHECK
Suboption default is: INITCHECK(LAX) if INITCHECK is
specified with no suboption
Abbreviations are: IC |
NOIC
NOINITCHECKIf
NOINITCHECKis in effect, the compiler will not issue any warning messages for uninitialized data items.INITCHECK(LAX | STRICT)If
INITCHECKorINITCHECK(LAX)is in effect, the compiler will check for uninitialized data items and issue a warning message when a data item is used without being initialized. However, if a data item is initialized on at least one logical path to a statement, no warning message will be issued.If
INITCHECK(STRICT)is in effect, the compiler will still check for uninitialized data items and issue a warning message when a data item is used without being initialized. However, unlikeINITCHECK(LAX),INITCHECK(STRICT)will issue a warning message about uninitialized data for a data item used in a statement unless the data item is initialized on all logical paths to the statement.Here is a sample program to illustrate the behavior differences between specifyingINITCHECK(LAX)versusINITCHECK(STRICT). Y and Z represent some data items, with no value clauses:
Z is initialized on one path to thePROCEDURE DIVISION. IF Y > 5 MOVE 2 TO Z END-IF DISPLAY ZDISPLAYstatement but not the other, so ifINITCHECK(LAX)is in effect, a warning message will be issued for Y only, whileINITCHECK(STRICT)will also issue a warning message for Z.
- The
INITCHECKoption analyzes data items in theWORKING-STORAGE SECTIONandLOCAL-STORAGE SECTIONonly. In particular, it does not analyze data items in theLINKAGE SECTIONorFILE SECTION. - The
INITCHECKanalysis does not track external or global data items. - The
INITCHECKanalysis does not track individual elements in tables independently. Instead, if one element of a table is initialized, all corresponding elements of the table are considered to be initialized. This applies to both fixed-length and variable-length tables. - The
INITCHECKanalysis does not track the initialization of items if it happens through a pointer. For example, if a pointer to an uninitialized data item is created by usingADDRESS-OF, and that data item is initialized through that pointer, theINITCHECKanalysis might also issue a warning message. - For uninitialized data items being passed
BY REFERENCE, no warning messages will be issued. However, theINITCHECKanalysis will warn about uninitialized data items being passedBY CONTENTandBY VALUE. - The
INITCHECKoption does not track individual bytes of reference-modified data items accurately. Instead, if a data item is accessed by using a reference modification, this data item is considered to be initialized. - If a data item is in a group with other items that have had their address taken, for example, as the result of being an SQL host variable, then that data item will also be considered to have its address taken, and the set of all address taken data items is always considered to be set by any call to an external function.
- All of the
INITCHECKanalyses occur at compile time only. - The
INITCHECKoption has no effect on the behavior or performance of the program after it has been compiled. - Use of the
INITCHECKoption might increase compile time and memory consumption. - The
INITCHECKoption reports and prints only the first uninitialized data item in a group. Subsequent data items that are also uninitialized will not be printed. INITCHECKis more accurate when used withOPT(1)orOPT(2), but it is also helpful when used withOPT(0).
