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:
@@ -35,7 +35,8 @@
|
||||
#include "compile_et.h"
|
||||
#include "lex.h"
|
||||
|
||||
void yyerror (char *s);
|
||||
void yyerror (const char *s);
|
||||
#define yyerror yyerror
|
||||
static long name2number(const char *str);
|
||||
|
||||
extern char *yytext;
|
||||
@@ -168,7 +169,7 @@ name2number(const char *str)
|
||||
}
|
||||
|
||||
void
|
||||
yyerror (char *s)
|
||||
yyerror (const char *s)
|
||||
{
|
||||
_lex_error_message ("%s\n", s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user