1.5.18/bison-1.32/stdio.h problem
Obviously new bison includes stdio.h only when debugging is enabled. Without it fails miserably in yyerror: /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # ifdef __cplusplus # include <cstdio> /* INFRINGES ON USER NAME SPACE */ # else # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # endif # define YYFPRINTF YYSTD (fprintf) # endif (this is not the original cfg-grammar.c but regenerated locally). The following patch is bandaid but I am not sure how to do it portably enough (meaning - accounting for earlier bison versions). One possibility is of course move yyerror out of cfg-grammar.y to avoid confusion. -andrej --- syslog-ng-1.5.18/src/cfg-grammar.y.orig Thu May 30 11:39:06 2002 +++ syslog-ng-1.5.18/src/cfg-grammar.y Thu May 30 11:39:52 2002 @@ -698,6 +698,8 @@ extern int linenum; +#include <stdio.h> + void yyerror(char *msg) { fprintf(stderr, "%s at %d\n", msg, linenum);
On Thu, May 30, 2002 at 12:00:45PM +0400, Borsenkow Andrej wrote:
Obviously new bison includes stdio.h only when debugging is enabled. Without it fails miserably in yyerror:
/* Enable debugging if requested. */ #if YYDEBUG
# ifndef YYFPRINTF # ifdef __cplusplus # include <cstdio> /* INFRINGES ON USER NAME SPACE */ # else # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # endif # define YYFPRINTF YYSTD (fprintf) # endif
(this is not the original cfg-grammar.c but regenerated locally).
The following patch is bandaid but I am not sure how to do it portably enough (meaning - accounting for earlier bison versions). One possibility is of course move yyerror out of cfg-grammar.y to avoid confusion.
-andrej
I think stdio.h can safely be included. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
participants (2)
-
Balazs Scheidler
-
Borsenkow Andrej