From 68bba88d780d72043f1a954f3dbd12ad39bb5300 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 27 Aug 2023 19:09:57 +0000 Subject: [PATCH] yacc: define dummy yytokname() and yystatname() macros if not yydebug --- sys/lib/yaccpar | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sys/lib/yaccpar b/sys/lib/yaccpar index 79a8d4e01..10a1219b2 100644 --- a/sys/lib/yaccpar +++ b/sys/lib/yaccpar @@ -4,19 +4,6 @@ #ifdef yydebug #include "y.debug" -#else -#define yydebug 0 -char* yytoknames[1]; /* for debugging */ -char* yystates[1]; /* for debugging */ -#endif - -/* parser for yacc output */ - -int yynerrs = 0; /* number of errors */ -int yyerrflag = 0; /* error recovery flag */ - -extern int fprint(int, char*, ...); -extern int sprint(char*, char*, ...); char* yytokname(int yyc) @@ -41,6 +28,17 @@ yystatname(int yys) sprint(x, "<%d>\n", yys); return x; } +#else +#define yydebug 0 +#define yytokname(x) "" +#define yystatname(x) "" +#endif + +/* parser for yacc output */ + +int yynerrs = 0; /* number of errors */ +int yyerrflag = 0; /* error recovery flag */ + long yylex1(void)