From 2cef311be2a038f8098affeb0983e982f4d396bf Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 5 Jul 2026 21:10:15 -0700 Subject: [PATCH] Make Bison parser conflicts errors Bison reports shift/reduce and reduce/reduce parser conflicts as warnings by default. This allows parser changes to introduce new conflicts while the normal build still succeeds. Pass the conflict warning classes as errors to Bison when generating the parsers. This makes the regular build fail if either parser has unresolved conflicts. Signed-off-by: Lars-Peter Clausen --- Makefile.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2503db9c7..f97cd0743 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,6 +85,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ LEX = @LEX@ YACC = @YACC@ +YACC_CONFLICT_FLAGS = -Werror=conflicts-sr -Werror=conflicts-rr MAN = @MAN@ PS2PDF = @PS2PDF@ GROFF = @GROFF@ @@ -241,10 +242,10 @@ parse.o: parse.cc # Use pattern rules to avoid parallel build issues (see pr3462585) parse%cc parse%h: $(srcdir)/parse%y - $(YACC) --verbose -t -p VL --defines=parse.h -o parse.cc $< + $(YACC) --verbose $(YACC_CONFLICT_FLAGS) -t -p VL --defines=parse.h -o parse.cc $< syn-rules.cc: $(srcdir)/syn-rules.y - $(YACC) --verbose -t -p syn_ -o $@ $< + $(YACC) --verbose $(YACC_CONFLICT_FLAGS) -t -p syn_ -o $@ $< lexor.cc: $(srcdir)/lexor.lex $(LEX) -s -t $< > $@