Support SET of NUMERIC type with GnuCOBOL emulation.
GCC's cobol front-end adds support for the `SET` statement with `NUMERIC` types in GnuCOBOL emulation.
GCC’s COBOL front-end now supports the SET statement when used with NUMERIC data types, specifically for emulating GnuCOBOL behavior. This involves adding new diagnostic messages, handling a corresponding compiler option (-Wset-numeric), and updating documentation and internal language specifications to reflect this capability.
In Details
This change introduces support for the SET statement targeting NUMERIC types within the GnuCOBOL emulation of the GCC COBOL front-end. It adds a new diagnostic identifier MfSetNumeric (and its dialect-specific variants), integrates the -Wset-numeric option handling in cobol1.cc, updates the man page (gcobol.1), and registers the option in lang.opt and lang-specs.h. The change also refines error reporting in parse_ante.h to be dialect-specific.
- COBOL
- A compiled high-level programming language with an English-like syntax, primarily used in business applications. GCC includes a COBOL front-end.
- GnuCOBOL
- An open-source compiler that implements the COBOL programming language, formerly known as OpenCOBOL. GCC's COBOL front-end includes emulation modes for GnuCOBOL.
- SET statement
- A COBOL statement used to assign values to variables, often involving specific data types or conditions. In this context, it's extended for NUMERIC types in GnuCOBOL emulation.
- NUMERIC type
- In COBOL, a data type used to store numeric values, often with specified precision and scale. It differs from standard integer or floating-point types in its internal representation and arithmetic rules.
- diagnostic message
- An informational message, warning, or error issued by the compiler to the user regarding the source code or the compilation process.