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

@@ -306,6 +306,13 @@ m4_if(m4_bregexp([$4], [: warning: ]), [-1], [],
sed -n '/: warning: /=' at-bison-check-warnings \
| sed -n 1p \
`"
at_bison_check_first_tmp="` \
sed -n '/conflicts: [0-9].*reduce$/=' at-bison-check-warnings \
| sed -n 1p \
`"
if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
at_bison_check_first=$at_bison_check_first_tmp
fi
if test $at_bison_check_first -gt 1; then
sed -n "1,`expr $at_bison_check_first - 1`"p \
at-bison-check-warnings > experr
@@ -335,9 +342,9 @@ m4_if(m4_bregexp([$4], [: warning: ]), [-1], [],
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified.
]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ -Wnone -Werror]],
[[0]], [expout], [ignore])[
[[0]], [expout])[
]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ --warnings=none \
-Werror]], [[0]], [expout], [ignore])[
-Werror]], [[0]], [expout])[
# Restore caller's files.
if test -f at-bison-check-expout.bak; then