From: Matthew Fernandez Date: Tue, 25 Aug 2020 01:23:54 +0000 (-0700) Subject: suppress warnings from using Bison extensions in lib/cgraph/grammar.y X-Git-Tag: 2.46.0~20^2^2~99^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c099fc032074a0bb5961d67ef4df05ddca7eba4;p=graphviz suppress warnings from using Bison extensions in lib/cgraph/grammar.y We don't currently use any, but are about to introduce one. For some more back story on this, we quote the Bison 3.0 release notes: *** Use of YACC='bison -y' TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use Bison extensions. Traditional Yacc generates 'y.tab.c' whatever the name of the input file. Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly 'y.tab.h' and 'y.outout') to be generated from 'foo.y'. To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an implementation of Yacc, was using Bison as 'bison -y'. While it does ensure compatible output file names, it also enables warnings for incompatibilities with POSIX Yacc. In other words, 'bison -y' triggers warnings for Bison extensions. Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c' (which also generates 'y.tab.h' and 'y.output' when needed). Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc flags (YFLAGS, or AM_YFLAGS with Automake). --- diff --git a/lib/cgraph/Makefile.am b/lib/cgraph/Makefile.am index 54f50c21f..2774c54e4 100644 --- a/lib/cgraph/Makefile.am +++ b/lib/cgraph/Makefile.am @@ -42,7 +42,7 @@ grammar.h: y.tab.h y.tab.c y.tab.h: y.output y.output: $(top_srcdir)/lib/cgraph/grammar.y - @YACC@ -dv $(top_srcdir)/lib/cgraph/grammar.y + @YACC@ -Wno-yacc -dv $(top_srcdir)/lib/cgraph/grammar.y cgraph.3.pdf: cgraph.3.ps @PS2PDF@ $< $@ diff --git a/lib/cgraph/cgraph.vcxproj b/lib/cgraph/cgraph.vcxproj index faf248b2c..fff37f5f8 100644 --- a/lib/cgraph/cgraph.vcxproj +++ b/lib/cgraph/cgraph.vcxproj @@ -70,7 +70,7 @@ MachineX86 - win_bison -dy grammar.y -o grammar.c + win_bison -Wno-yacc -dy grammar.y -o grammar.c win_flex -oscan.c scan.l @@ -93,7 +93,7 @@ win_flex -oscan.c scan.l MachineX86 - win_bison -dy grammar.y -o grammar.c + win_bison -Wno-yacc -dy grammar.y -o grammar.c win_flex -oscan.c scan.l