From 0b82602331f058f1dea9fee1ecc37c503576855b Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 29 Aug 2012 18:35:55 -0400 Subject: [PATCH] Work around breakage caused by newer Bison versions. Newer versions of GNU Bison automagically add a prototype for yyparse to the header file, where previous versions did not. Unfortunately, the use of yyscan_t in %parse-param causes a build failure now, as yyscan_t is declared in scan.h. Moreover, since scan.h includes parse.h, we cannot simply include scan.h in parse.h to get the type definition. Work around the problem by declaring yyparse as taking a void * directly. --- src/parse.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/parse.y b/src/parse.y index 3f02129..9c644da 100644 --- a/src/parse.y +++ b/src/parse.y @@ -19,7 +19,7 @@ } %name-prefix "cdecl__yy" -%parse-param {yyscan_t scanner} +%parse-param {void *scanner} %parse-param {struct cdecl **out} %lex-param {yyscan_t scanner} %define api.pure @@ -580,8 +580,7 @@ english_vla: T_IDENT | { %% void -yyerror(YYLTYPE *loc, yyscan_t scanner, struct cdecl **out, - const char *err) +yyerror(YYLTYPE *loc, yyscan_t scanner, struct cdecl **out, const char *err) { if (strstr(err, "T_LEX_ERROR")) return; -- 2.43.2