From fdb54c85577859e26525463c2e21801cd9b2377c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 14 Aug 2015 06:27:33 -0700 Subject: Remove unwanted yyparse declaration from y.tab.h. * Makefile (y.tab.c): Putting in an ugly workaround for an obnoxious new behavior introduced in Bison 3.x, which breaks our build on platforms that have a newer Bison. After generating y.tab.h, we remove the unwanted declaration with sed. * parser.y (yyparse): Declare, since y.tab.h doesn't any more, and the newer Bison's parse skeletons expect it. --- Makefile | 9 ++++++++- parser.y | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef4591c4..30f09166 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,14 @@ y.tab.h: y.tab.c y.tab.c: $(top_srcdir)parser.y $(call ABBREV,YACC) $(V)rm -f y.tab.c - $(V)if $(YACC) -v -d $< ; then chmod a-w y.tab.c ; true ; else rm y.tab.c ; false ; fi + $(V)if $(YACC) -v -d $< ; then \ + chmod a-w y.tab.c ; \ + sed -e '/yyparse/d' < y.tab.h > y.tab.h.tmp && \ + mv y.tab.h.tmp y.tab.h ; \ + else \ + rm y.tab.c ; \ + false ; \ + fi # Suppress useless sccs id array and unused label warning in byacc otuput. # Bison-generated parser also tests for this lint define. diff --git a/parser.y b/parser.y index 4cda5a34..d0ab1f59 100644 --- a/parser.y +++ b/parser.y @@ -65,6 +65,7 @@ static void misplaced_consing_dot_check(scanner_t *scanner, val term_atom_cons); #if YYBISON union YYSTYPE; int yylex(union YYSTYPE *, yyscan_t scanner); +int yyparse(scanner_t *, parser_t *); #endif #define rl(form, line) rlrec(parser, form, line) -- cgit v1.2.3