Skip to content

Commit

Permalink
Squelch some annoying Berkeley YACC errors.
Browse files Browse the repository at this point in the history
I'll look at fixing byacc and sending in patches.
  • Loading branch information
guyharris committed May 6, 2018
1 parent 8db4b92 commit 2ac05ff
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,27 @@ struct rtentry;
#include "os-proto.h"
#endif

#ifdef YYBYACC
/*
* Both Berkeley YACC and Bison define yydebug (under whatever name
* it has) as a global, but Bison does so only if YYDEBUG is defined.
* Berkeley YACC define it even if YYDEBUG isn't defined; declare it
* here to suppress a warning.
*/
#if !defined(YYDEBUG)
extern int yydebug;
#endif

/*
* In Berkeley YACC, yynerrs (under whatever name it has) is global,
* even if it's building a reentrant parser. In Bison, it's local
* in reentrant parsers.
*
* Declare it to squelch a warning.
*/
extern int yynerrs;
#endif

#define QSET(q, p, d, a) (q).proto = (unsigned char)(p),\
(q).dir = (unsigned char)(d),\
(q).addr = (unsigned char)(a)
Expand Down

0 comments on commit 2ac05ff

Please sign in to comment.