summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorheitbaum <rudi@heitbaum.com>2021-09-10 08:10:22 (GMT)
committerThomas Haller <thaller@redhat.com>2022-03-03 12:26:42 (GMT)
commit000a3bd64107fc609c2f4d30bd779d9168e5e54f (patch)
tree574eba6f8f035e8c17449fdf6db670d5160e8d00
parentf865a99b603eb6c5de5e44e9d67adb06506a2138 (diff)
downloadlibnl-000a3bd64107fc609c2f4d30bd779d9168e5e54f.zip
libnl-000a3bd64107fc609c2f4d30bd779d9168e5e54f.tar.gz
libnl-000a3bd64107fc609c2f4d30bd779d9168e5e54f.tar.bz2
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 https://github.com/thom311/libnl/issues/294 https://github.com/thom311/libnl/pull/295
-rw-r--r--lib/route/cls/ematch_syntax.y1
-rw-r--r--lib/route/pktloc_syntax.y1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/route/cls/ematch_syntax.y b/lib/route/cls/ematch_syntax.y
index 68ec783..0c89603 100644
--- a/lib/route/cls/ematch_syntax.y
+++ b/lib/route/cls/ematch_syntax.y
@@ -46,6 +46,7 @@
%{
extern int ematch_lex(YYSTYPE *, void *);
+#define ematch_error yyerror
static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg)
{
if (msg)
diff --git a/lib/route/pktloc_syntax.y b/lib/route/pktloc_syntax.y
index 25d8710..3c9326f 100644
--- a/lib/route/pktloc_syntax.y
+++ b/lib/route/pktloc_syntax.y
@@ -24,6 +24,7 @@
%{
extern int pktloc_lex(YYSTYPE *, YYLTYPE *, void *);
+#define pktloc_error yyerror
static void yyerror(YYLTYPE *locp, void *scanner, const char *msg)
{
NL_DBG(1, "Error while parsing packet location file: %s\n", msg);