cobol: Allow larger REDEFINES for -dialect ibm.
COBOL compiler now allows larger REDEFINES areas for IBM dialect, aligning with IBM's relaxed standard.
GCC’s COBOL compiler has been updated to permit larger data areas in REDEFINES clauses when using the -dialect ibm option. The ISO standard restricts REDEFINES if the redefining area is larger than the redefined area, with exceptions for level 01 data. The IBM dialect, however, does not impose this size restriction. Additionally, this commit refines the parsing of the -preprocess argument.
In Details
The COBOL compiler's valid_redefine check in parse_ante.h previously enforced the ISO standard's restriction on REDEFINES (B cannot be larger than A unless A is level 01 and not external). This commit modifies this check to conditionally disable the size restriction when the -dialect ibm option is active, mirroring IBM COBOL's behavior. It also corrects and simplifies the argument parsing for the -preprocess option in lexio.cc.
- REDEFINES
- A COBOL clause that allows multiple data items to occupy the same memory area. It's used for interpreting a block of data in different ways.
- -dialect ibm
- A GCC command-line option for the COBOL compiler that selects a dialect conforming to IBM's COBOL standard, which may differ from the ISO standard in certain features.
- level 01
- In COBOL, a level number indicating a top-level record description. Level 01 items have specific rules and are often treated differently in standards.
- preprocess
- In the context of the COBOL compiler, this refers to handling preprocessor directives (like COPY statements or macro expansions) before the main compilation phase.