mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +00:00
-Werror: fix for rules useless in parser after conflicts.
* NEWS (2.4.3): Document fix.
* src/complain.c (error_message): Extend to handle incomplete
error messages so warn and warn_at can be used in more cases.
* src/gram.c (grammar_rules_useless_report): Use warn_at so that
-Werror is always obeyed.
* src/reduce.c (reduce_print): Use warn so that the "warnings
being treated as errors" message is printed consistently before
the first warning message. This makes testing easier.
* tests/local.at (AT_BISON_WERROR_MSG): New macro.
(AT_BISON_CHECK_NO_XML): Extend to check -Werror and
--warnings=error when warnings appear in bison's stderr.
(cherry picked from commit 954474bfa1)
This commit is contained in:
@@ -23,11 +23,12 @@
|
||||
|
||||
#include <quotearg.h>
|
||||
|
||||
#include "complain.h"
|
||||
#include "gram.h"
|
||||
#include "print-xml.h"
|
||||
#include "reader.h"
|
||||
#include "reduce.h"
|
||||
#include "symtab.h"
|
||||
#include "print-xml.h"
|
||||
|
||||
/* Comments for these variables are in gram.h. */
|
||||
|
||||
@@ -308,9 +309,9 @@ grammar_rules_useless_report (const char *message)
|
||||
for (r = 0; r < nrules ; ++r)
|
||||
if (!rules[r].useful)
|
||||
{
|
||||
location_print (stderr, rules[r].location);
|
||||
fprintf (stderr, ": %s: %s: ", _("warning"), message);
|
||||
rule_print (&rules[r], stderr);
|
||||
warn_at (rules[r].location, "%s: ", message);
|
||||
rule_print (&rules[r], stderr);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user