yyerror: update to POSIX standard
To comply with the latest POSIX standard, in Yacc compatibility mode (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and yylex. In some situations, this is breaking compatibility: if the user has already declared these functions but with some differences (e.g., to declare them as static, or to use specific attributes), the generated parser will fail to compile. To disable these prototypes, #define yyerror (to `yyerror`), and likewise for yylex. refer: https://git.savannah.gnu.org/cgit/bison.git/tree/NEWS GNU Bison 3.8
This commit is contained in:
@@ -78,7 +78,7 @@ error_message (const char *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
yyerror (char *s)
|
||||
yyerror (const char *s)
|
||||
{
|
||||
error_message("%s\n", s);
|
||||
}
|
||||
|
@@ -51,5 +51,6 @@ extern char *filename;
|
||||
extern int error_flag;
|
||||
void error_message (const char *format, ...);
|
||||
int yylex(void);
|
||||
void yyerror (char *s);
|
||||
void yyerror (const char *s);
|
||||
#define yyerror yyerror
|
||||
extern unsigned lineno;
|
||||
|
Reference in New Issue
Block a user