[nft,1/2] parser_bison: Get rid of (most) bison compiler warnings
diff mbox series

Message ID 20190720185226.8876-1-phil@nwl.cc
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series
  • [nft,1/2] parser_bison: Get rid of (most) bison compiler warnings
Related show

Commit Message

Phil Sutter July 20, 2019, 6:52 p.m. UTC
Shut the complaints about POSIX incompatibility by passing -Wno-yacc to
bison. An alternative would be to not pass -y, but that caused seemingly
unsolveable problems with automake and expected file names.

Fix two warnings about deprecated '%pure-parser' and '%error-verbose'
statements by replacing them with what bison suggests.

A third warning sadly left in place: Replacing '%name-prefix' by what
is suggested leads to compilation errors.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/Makefile.am    | 2 +-
 src/parser_bison.y | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Florian Westphal July 20, 2019, 7:43 p.m. UTC | #1
Phil Sutter <phil@nwl.cc> wrote:
> Shut the complaints about POSIX incompatibility by passing -Wno-yacc to
> bison. An alternative would be to not pass -y, but that caused seemingly
> unsolveable problems with automake and expected file names.
> 
> Fix two warnings about deprecated '%pure-parser' and '%error-verbose'
> statements by replacing them with what bison suggests.
> 
> A third warning sadly left in place: Replacing '%name-prefix' by what
> is suggested leads to compilation errors.

Can you add those warnings to the changelog before pushing?

I don't see them, even without this patch.
Phil Sutter July 20, 2019, 8:13 p.m. UTC | #2
On Sat, Jul 20, 2019 at 09:43:22PM +0200, Florian Westphal wrote:
> Phil Sutter <phil@nwl.cc> wrote:
> > Shut the complaints about POSIX incompatibility by passing -Wno-yacc to
> > bison. An alternative would be to not pass -y, but that caused seemingly
> > unsolveable problems with automake and expected file names.
> > 
> > Fix two warnings about deprecated '%pure-parser' and '%error-verbose'
> > statements by replacing them with what bison suggests.
> > 
> > A third warning sadly left in place: Replacing '%name-prefix' by what
> > is suggested leads to compilation errors.
> 
> Can you add those warnings to the changelog before pushing?

Sure!

> I don't see them, even without this patch.

I started seeing them just recently, maybe after the last bison update
(to 3.4.1).

Cheers, Phil

Patch
diff mbox series

diff --git a/src/Makefile.am b/src/Makefile.am
index e2b531390cefb..740c21f2cac85 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,7 @@  AM_CFLAGS = -Wall								\
 	    -Waggregate-return -Wunused -Wwrite-strings ${GCC_FVISIBILITY_HIDDEN}
 
 
-AM_YFLAGS = -d
+AM_YFLAGS = -d -Wno-yacc
 
 BUILT_SOURCES = parser_bison.h
 
diff --git a/src/parser_bison.y b/src/parser_bison.y
index c90de47e88f74..12e499b4dd025 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -116,12 +116,12 @@  int nft_lex(void *, void *, void *);
 
 %name-prefix "nft_"
 %debug
-%pure-parser
+%define api.pure
 %parse-param		{ struct nft_ctx *nft }
 %parse-param		{ void *scanner }
 %parse-param		{ struct parser_state *state }
 %lex-param		{ scanner }
-%error-verbose
+%define parse.error verbose
 %locations
 
 %initial-action {