Add -Wconflicts-sr and -Wconflicts-rr.

Thus, conflict reports are now affected by -Werror and -Wnone
(unless %expect or %expect-rr is specified).  Reported by George
Neuner at
<http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
* NEWS (2.5): Document.
* doc/bison.texinfo (Bison Options): Document.
* src/complain.c, src/complain.h (set_warning_issued): Export
function.
* src/conflicts.c (conflicts_print): Suppress conflict report
based on -Wno-conflicts-sr and -Wno-conflicts-rr, and treat
conflicts as errors if -Werror.
* src/getargs.c (warnings_flag): Initialize with
warnings_conflicts_sr and warnings_conflicts_rr as well.
(warnings_args, warnings_types): Add entries for
warnings_conflicts_sr and warnings_conflicts_rr.
(usage): Update.
* src/getargs.h (enum warnings): Add entries for
warnings_conflicts_sr and warnings_conflicts_rr.
* tests/conflicts.at (-W versus %expect and %expect-rr): New test
group.
* tests/local.at (AT_BISON_CHECK_NO_XML): Update now that the
conflict report can produce a "warnings being treated as errors"
message.  Also, check that stderr is now fully scrubbed by -Wnone
when the exit status is 0.
(cherry picked from commit 6f8bdce25d)
This commit is contained in:
Joel E. Denny
2011-03-27 22:38:32 -04:00
parent e4a148796a
commit 786743d5eb
10 changed files with 192 additions and 5 deletions

View File

@@ -59,7 +59,8 @@ bool glr_parser = false;
int report_flag = report_none;
int trace_flag = trace_none;
int warnings_flag = warnings_other;
int warnings_flag = warnings_conflicts_sr | warnings_conflicts_rr
| warnings_other;
static struct bison_language const valid_languages[] = {
{ "c", "c-skel.m4", ".c", ".h", true },
@@ -230,6 +231,8 @@ static const char * const warnings_args[] =
"none - no warnings",
"midrule-values - unset or unused midrule values",
"yacc - incompatibilities with POSIX Yacc",
"conflicts-sr - S/R conflicts",
"conflicts-rr - R/R conflicts",
"other - all other warnings",
"all - all of the above",
"error - warnings are errors",
@@ -241,6 +244,8 @@ static const int warnings_types[] =
warnings_none,
warnings_midrule_values,
warnings_yacc,
warnings_conflicts_sr,
warnings_conflicts_rr,
warnings_other,
warnings_all,
warnings_error
@@ -332,6 +337,8 @@ Output:\n\
Warning categories include:\n\
`midrule-values' unset or unused midrule values\n\
`yacc' incompatibilities with POSIX Yacc\n\
`conflicts-sr' S/R conflicts (enabled by default)\n\
`conflicts-rr' R/R conflicts (enabled by default)\n\
`other' all other warnings (enabled by default)\n\
`all' all the warnings\n\
`no-CATEGORY' turn off warnings in CATEGORY\n\