https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119887
Bug ID: 119887
Summary: runtime-switches are not documented / implemented (and
don't pass NC211A and others)
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: cobol
Assignee: unassigned at gcc dot gnu.org
Reporter: simonsobisch at gnu dot org
Target Milestone: ---
Switches are a feature defined in COBOL 2023. The implementor-defined list
(annex A) says that the imlementor should defined the supported switch-names as
well as if they are able to be toggled via SET and how they may be set
otherwise (GnuCOBOL uses an environment variable, other compilers use switches
to the module-runner - which gcobol does not have).
NIST tests in NC the support for some switches explicit (if I remember
correctly their names can be changed via configuration). The GnuCOBOL config
for NIST85 use the commonly available names SWITCH-1 to SWITCH-9 (supporting
and documenting much more, including the RM/COBOL / ACUCOBOL SWITCH-A...-Z.
gcobol.1 should document what is supported, and it is likely very reasonable to
support at least SWITCH-0 to SWITCH-9 (and possibly provide a way outside of
COBOL to set those switches).
Example from NC211A
003500 SPECIAL-NAMES.
NC2114.2
003600 SWITCH-1
NC2114.2
003700 IS WRK-SWITCH-1
NC2114.2
003800 ON STATUS IS ON-WRK-SWITCH-1
NC2114.2
003900 OFF STATUS IS OFF-WRK-SWITCH-1
NC2114.2
004000 SWITCH-2
NC2114.2
004100 IS WRK-SWITCH-2
NC2114.2
004200 OFF STATUS IS OFF-WRK-SWITCH-2.
NC2114.2
currently leading to
NC211A.CBL:36:12: error: is not a device name
36 | 003600 SWITCH-1
NC2114.2
| ^
NC211A.CBL:38:12: error: syntax error, unexpected ON, expecting '.'
38 | 003800 ON STATUS IS ON-WRK-SWITCH-1
NC2114.2
| ^
cobol1: error: failed compiling NC211A.CBL