mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
Finish implementing --warnings=error, which should not be implied by
--warnings=all (or by its synonyms -W and --warnings without subarguments). * src/complain.c (set_warning_issued): New function to report that warnings are being treated as errors and to record an error if so. Invoke... (warn_at, warn): ... here. * src/getargs.c (warnings_args, warnings_types): Reorder so that "error - warnings are errors" does not appear above "all - all of the above". (getargs): For -W and --warnings without subarguments, don't let FLAGS_ARGMATCH set warnings_error in warnings_flag. * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
This commit is contained in:
@@ -204,18 +204,18 @@ static const char * const warnings_args[] =
|
||||
/* In a series of synonyms, present the most meaningful first, so
|
||||
that argmatch_valid be more readable. */
|
||||
"none - no warnings",
|
||||
"error - warnings are errors",
|
||||
"yacc - incompatibilities with POSIX YACC",
|
||||
"all - all of the above",
|
||||
"error - warnings are errors",
|
||||
0
|
||||
};
|
||||
|
||||
static const int warnings_types[] =
|
||||
{
|
||||
warnings_none,
|
||||
warnings_error,
|
||||
warnings_yacc,
|
||||
warnings_all
|
||||
warnings_all,
|
||||
warnings_error
|
||||
};
|
||||
|
||||
ARGMATCH_VERIFY (warnings_args, warnings_types);
|
||||
@@ -472,7 +472,10 @@ getargs (int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
FLAGS_ARGMATCH (warnings, optarg);
|
||||
if (optarg)
|
||||
FLAGS_ARGMATCH (warnings, optarg);
|
||||
else
|
||||
warnings_flag |= warnings_all;
|
||||
break;
|
||||
|
||||
case LOCATIONS_OPTION:
|
||||
|
||||
Reference in New Issue
Block a user