diff options
author | Joel E. Denny <joeldenny@joeldenny.org> | 2011-03-27 19:08:24 -0400 |
---|---|---|
committer | Joel E. Denny <joeldenny@joeldenny.org> | 2011-04-03 19:45:39 -0400 |
commit | 8ffd7912e3b71fb0cc69e83225c3ad8e3452270f (patch) | |
tree | 34cec4f5b79047a3c40b0161de3740ba183c300e /src/getargs.c | |
parent | dab9663283437092d17af8ede75f3aff33380d53 (diff) | |
download | bison-8ffd7912e3b71fb0cc69e83225c3ad8e3452270f.tar.gz |
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.
Diffstat (limited to 'src/getargs.c')
-rw-r--r-- | src/getargs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/getargs.c b/src/getargs.c index 9c9f0c34..772d7dfc 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -63,7 +63,7 @@ bool glr_parser = false; int report_flag = report_none; int trace_flag = trace_none; -int warnings_flag = warnings_none; +int warnings_flag = warnings_other; static struct bison_language const valid_languages[] = { { "c", "c-skel.m4", ".c", ".h", true }, @@ -234,6 +234,7 @@ static const char * const warnings_args[] = "none - no warnings", "midrule-values - unset or unused midrule values", "yacc - incompatibilities with POSIX Yacc", + "other - all other warnings", "all - all of the above", "error - warnings are errors", 0 @@ -244,6 +245,7 @@ static const int warnings_types[] = warnings_none, warnings_midrule_values, warnings_yacc, + warnings_other, warnings_all, warnings_error }; @@ -333,6 +335,7 @@ Output:\n\ Warning categories include:\n\ `midrule-values' unset or unused midrule values\n\ `yacc' incompatibilities with POSIX Yacc\n\ + `other' all other warnings (enabled by default)\n\ `all' all the warnings\n\ `no-CATEGORY' turn off warnings in CATEGORY\n\ `none' turn off all the warnings\n\ |