summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-14 06:27:33 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-14 06:27:33 -0700
commitfdb54c85577859e26525463c2e21801cd9b2377c (patch)
tree9f219b7f56e613f48d56f3c45f28a23584fb1d60
parent9952353de4a6bdfd27727a00d53ae8958038c72d (diff)
downloadtxr-fdb54c85577859e26525463c2e21801cd9b2377c.tar.gz
txr-fdb54c85577859e26525463c2e21801cd9b2377c.tar.bz2
txr-fdb54c85577859e26525463c2e21801cd9b2377c.zip
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.
-rw-r--r--Makefile9
-rw-r--r--parser.y1
2 files changed, 9 insertions, 1 deletions
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)