]> git.draconx.ca Git - cdecl99.git/commitdiff
Work around breakage caused by newer Bison versions.
authorNick Bowler <nbowler@draconx.ca>
Wed, 29 Aug 2012 22:35:55 +0000 (18:35 -0400)
committerNick Bowler <nbowler@draconx.ca>
Wed, 29 Aug 2012 22:35:55 +0000 (18:35 -0400)
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

index 3f021290ee32e207ef600d1de74ec5ef6b025d49..9c644da4bf02f01b424ec92fd15ea26a29aed9a9 100644 (file)
@@ -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;