diff options
author | Tom Tromey <tom@tromey.com> | 2019-01-06 09:49:11 -0700 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2019-01-08 12:45:19 -0500 |
commit | cfeadda545c4961877969e6a66be79278696e012 (patch) | |
tree | a23a098d0b9aa48402b56d60ea2805523f85920b /gdb/c-exp.y | |
parent | 236f4ebe3ac7e8f94184fdcc39c70d74cc62b82a (diff) | |
download | gdb-cfeadda545c4961877969e6a66be79278696e012.zip gdb-cfeadda545c4961877969e6a66be79278696e012.tar.gz gdb-cfeadda545c4961877969e6a66be79278696e012.tar.bz2 |
Fix build failure with macOS bison
PR gdb/24060 points out a compilation failure of the C, Fortran and Pascal
parsers when they are built using the macOS system bison. The bug is a name
clash between the VARIABLE token name and the VARIABLE enumerator in ui-out.h.
This patch renames VARIABLE in c-exp.y, f-exp.y and p-exp.y to DOLLAR_VARIABLE
to avoid the clash. It also renames similar variables in other .y files so
that all languages use the same name.
gdb/ChangeLog
2019-01-07 Tom Tromey <tom@tromey.com>
2019-01-07 Simon Marchi <simon.marchi@ericsson.com>
PR gdb/24060:
* ada-exp.y (DOLLAR_VARIABLE): Rename from SPECIAL_VARIABLE.
* ada-lex.l (DOLLAR_VARIABLE): Likewise.
* c-exp.y (DOLLAR_VARIABLE): Rename from VARIABLE.
* f-exp.y (DOLLAR_VARIABLE): Likewise.
* m2-exp.y (DOLLAR_VARIABLE): Rename from INTERNAL_VAR.
* p-exp.y (DOLLAR_VARIABLE): Rename from VARIABLE.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 155fe09..f3ef23c 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -234,7 +234,7 @@ static void c_print_token (FILE *file, int type, YYSTYPE value); legal basetypes. */ %token SIGNED_KEYWORD LONG SHORT INT_KEYWORD CONST_KEYWORD VOLATILE_KEYWORD DOUBLE_KEYWORD -%token <sval> VARIABLE +%token <sval> DOLLAR_VARIABLE %token <opcode> ASSIGN_MODIFY @@ -798,7 +798,7 @@ exp : FLOAT exp : variable ; -exp : VARIABLE +exp : DOLLAR_VARIABLE { write_dollar_variable (pstate, $1); } @@ -2884,7 +2884,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name) } if (*tokstart == '$') - return VARIABLE; + return DOLLAR_VARIABLE; if (parse_completion && *lexptr == '\0') saw_name_at_eof = 1; @@ -3337,7 +3337,7 @@ c_print_token (FILE *file, int type, YYSTYPE value) break; case NSSTRING: - case VARIABLE: + case DOLLAR_VARIABLE: parser_fprintf (file, "sval<%s>", copy_name (value.sval)); break; |