mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
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.
This commit is contained in:
parent
8dc5b31971
commit
12c5175d68
@ -1,3 +1,8 @@
|
||||
2014-02-05 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* c-exp.y (YYPRINT, c_print_token): Only define if YYBISON is
|
||||
defined.
|
||||
|
||||
2014-02-05 Yao Qi <yao@codesourcery.com>
|
||||
|
||||
* remote.c (remote_pass_signals): Remove local 'buf' and use
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user