THURSDAY, SEPTEMBER 17, 2026
cobol
Cobol: Include passing method in error diagnostics
Cobol compiler now specifies passing method (BY REF/VAL/CONTENT) in error messages.
The cobol compiler now includes the passing method (e.g., BY REFERENCE, BY VALUE) in error messages related to argument type compatibility. This provides clearer diagnostics to developers, especially when data types appear compatible but an error occurs due to the passing mechanism.
In Details
This change in the COBOL parser (parse.y) augments error messages to include the parameter passing mechanism (BY REF, BY VALUE, BY CONTENT). This is useful when data types are identical (same size, signedness) but the passing method leads to an incompatibility, making the error more actionable.
For Context
- BY REF
- Abbreviation for BY REFERENCE, a parameter passing mechanism in COBOL where the address of the argument is passed.
- BY VALUE
- A parameter passing mechanism in COBOL where a copy of the argument's value is passed.
- BY CONTENT
- A parameter passing mechanism in COBOL where a copy of the argument is passed, and modifications within the called program do not affect the original.