mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
Add -Wother so -Wnone suppresses all warnings.
Reported by George Neuner at
<http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
* NEWS (2.5): Document.
* THANKS (George Neuner): Add.
* doc/bison.texinfo (Bison Options): Document.
* src/complain.c, src/complain.h
(warn_at, warn_at_indent, warn): Suppress warning if -Wno-other.
(midrule_value_at): New warning function, similar to yacc_at in
that it's controlled by its own warning category.
* src/getargs.c (warnings_flag): Initialize to warnings_other.
(warnings_args, warnings_types): Add entry for warnings_other.
(usage): Update.
* src/getargs.h (enum warnings): Add entry for warnings_other.
* src/gram.c (grammar_rules_useless_report): If -Wno-other, then
don't print useless rules.
* src/reader.c (symbol_should_be_used): Rather than adjusting the
return value based on whether midrule value warnings are enabled,
accept a new parameter for telling the caller whether true is
being returned for a potential midrule warning.
(grammar_rule_check): Use midrule_value_at for midrule value
warnings, and continue to use warn_at for all other warnings. Let
them check whether the warnings are enabled.
* tests/local.at (AT_BISON_CHECK): Update documentation.
(AT_BISON_CHECK_NO_XML): Check that -Wnone and --warnings=none
disable all warnings exercised in the test suite.
(cherry picked from commit 8ffd7912e3)
This commit is contained in:
@@ -109,6 +109,8 @@ set_warning_issued (void)
|
||||
void
|
||||
warn_at (location loc, const char *message, ...)
|
||||
{
|
||||
if (!(warnings_flag & warnings_other))
|
||||
return;
|
||||
set_warning_issued ();
|
||||
ERROR_MESSAGE (&loc, _("warning"), message);
|
||||
}
|
||||
@@ -117,6 +119,8 @@ void
|
||||
warn_at_indent (location loc, unsigned *indent,
|
||||
const char *message, ...)
|
||||
{
|
||||
if (!(warnings_flag & warnings_other))
|
||||
return;
|
||||
set_warning_issued ();
|
||||
indent_ptr = indent;
|
||||
ERROR_MESSAGE (&loc, _("warning"), message);
|
||||
@@ -125,6 +129,8 @@ warn_at_indent (location loc, unsigned *indent,
|
||||
void
|
||||
warn (const char *message, ...)
|
||||
{
|
||||
if (!(warnings_flag & warnings_other))
|
||||
return;
|
||||
set_warning_issued ();
|
||||
ERROR_MESSAGE (NULL, _("warning"), message);
|
||||
}
|
||||
@@ -178,6 +184,14 @@ yacc_at (location loc, const char *message, ...)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
midrule_value_at (location loc, const char *message, ...)
|
||||
{
|
||||
if (!(warnings_flag & warnings_midrule_values))
|
||||
return;
|
||||
set_warning_issued ();
|
||||
ERROR_MESSAGE (&loc, _("warning"), message);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------.
|
||||
| A severe error has occurred, we cannot proceed. |
|
||||
|
||||
Reference in New Issue
Block a user