The implementation in GV/OC 2.0 is currently wrong as all directives are handled simultaneously:
::cobolfree
>> IF nothing DEFINED
>> DEFINE something AS 42
>> END-IF
>> IF something DEFINED
ERROR-OUT. ERROR-OUT. ERROR-OUT.
>> END-IF
result:
$>cobc -W -free prog.cob
prog.cob: 5: Error: PROGRAM-ID header missing
prog.cob: 5: Error: ENVIRONMENT DIVISION header missing
prog.cob: 5: Error: CONFIGURATION SECTION header missing
prog.cob: 5: Error: SPECIAL-NAMES header missing
prog.cob: 5: Error: Invalid system-name 'ERROR-OUT'
prog.cob: 5: Error: syntax error, unexpected ., expecting CRT or Identifier
Fixed in [r955]. This was duplicated by [bugs:#248].
Related
Bugs:
#248