diff options
author | Mark Kettenis <kettenis@gnu.org> | 2014-02-05 13:30:33 +0100 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2014-02-05 13:32:48 +0100 |
commit | 12c5175d68a840960e4cf7d3001c926f15c4d006 (patch) | |
tree | 0076e1ef3be33c738d2e19e7f6b55ee3c73dc646 /gdb/c-exp.y | |
parent | Use rs->buf after getpkt (diff) | |
download | binutils-gdb-12c5175d68a840960e4cf7d3001c926f15c4d006.tar.gz binutils-gdb-12c5175d68a840960e4cf7d3001c926f15c4d006.tar.bz2 binutils-gdb-12c5175d68a840960e4cf7d3001c926f15c4d006.zip |
Avoid bison-isms when using yacc.
YYPRINT is a bison-ism so c_print_token() ends up being unused when yacc is
used which makes gcc unhappy. Make sure we only define YYPRINT and
c_print_token() when bison is used to generate the parser.
gdb/ChangeLog:
* c-exp.y (YYPRINT, c_print_token): Only define if YYBISON is
defined.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 277242ea08b..4704845e203 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -169,8 +169,10 @@ static struct stoken operator_stoken (const char *); static void check_parameter_typelist (VEC (type_ptr) *); static void write_destructor_name (struct stoken); +#ifdef YYBISON static void c_print_token (FILE *file, int type, YYSTYPE value); #define YYPRINT(FILE, TYPE, VALUE) c_print_token (FILE, TYPE, VALUE) +#endif %} %type <voidval> exp exp1 type_exp start variable qualified_name lcurly @@ -3201,6 +3203,8 @@ c_parse (void) return result; } +#ifdef YYBISON + /* This is called via the YYPRINT macro when parser debugging is enabled. It prints a token's value. */ @@ -3255,6 +3259,8 @@ c_print_token (FILE *file, int type, YYSTYPE value) } } +#endif + void yyerror (char *msg) { |