https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119776
Bug ID: 119776
Summary: COBOL '-fmax-errors', 'Separate'
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: cobol
Assignee: unassigned at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
CC: jklowden at gcc dot gnu.org, rdubner at gcc dot gnu.org
Target Milestone: ---
I've noted this a few weeks ago, but only now getting to file a PR.
The 'gcc/cobol/lang.opt' file of commit
r15-7938-g3c5ed996ac94a15bc2929155f2c69cc85eef89f7 "COBOL: Frontend", added:
+fmax-errors
+Cobol Joined Separate
+; Documented in C
..., but the (actually "Common", not "C") existing one is, 'gcc/common.opt':
fmax-errors=
Common Joined RejectNegative UInteger Var(flag_max_errors)
-fmax-errors=<number> Maximum number of errors to report.
That is, '-fmax-errors=[...]', not 'Separate'.
The new 'gcc/cobol/lang.opt' one affects GCC's global option handling as
follows:
'build-gcc/gcc/optionlist':
+fmax-errors^\Cobol Joined Separate
+fmax-errors^\UrlSuffix(gcc/Warning-Options.html#index-fmax-errors)
LangUrlSuffix_D(gdc/Warnings.html#index-fmax-errors)
fmax-errors=^\Common Joined RejectNegative UInteger
Var(flag_max_errors)^\-fmax-errors=<number> Maximum number of errors to
report.
fmax-errors=^\UrlSuffix(gcc/Warning-Options.html#index-fmax-errors)
LangUrlSuffix_D(gdc/Warnings.html#index-fmax-errors)
'build-gcc/gcc/options.cc':
/* [-[1496]-]{+[1503] = */ {+}
{+ "-fmax-errors",+}
{+ NULL,+}
{+ NULL,+}
{+ NULL,+}
{+ NULL, NULL, N_OPTS, N_OPTS, 11, /* .neg_idx = */ 1503,+}
{+ CL_Cobol | CL_JOINED | CL_SEPARATE,+}
{+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,+}
{+ (unsigned short) -1, 0, CLVC_STRING, 0, -1, -1 },+}
{+ /* [1504]+} = */ {
"-fmax-errors=",
"-fmax-errors=<number> Maximum number of errors to report.",
NULL,
NULL,
NULL, NULL, N_OPTS, [-N_OPTS,-]{+OPT_fmax_errors,+} 12, /* .neg_idx =
*/ -1,
CL_COMMON | CL_JOINED,
0, 0, 0, 0, 0, 0, 1 /* RejectNegative */, 0, 1 /* UInteger */, 0, 0, 0,
offsetof (struct gcc_options, x_flag_max_errors), 0, CLVC_INTEGER, 0,
-1, -1 },
This is not a problem (as far as I can tell), but I wonder whether there's a
reason for COBOL to be different, if it actually needs the 'Separate' variant,
or if COBOL could just use the common one, '-fmax-errors=[...]'?