Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] Fix build failure with macOS bison
Date: Sun, 06 Jan 2019 16:49:00 -0000	[thread overview]
Message-ID: <20190106164911.22546-1-tom@tromey.com> (raw)

PR gdb/24060 points out a compilation failure of the C parser when it
is 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 to avoid the clash.  I chose to
rename this identifier because it was the more localized change.

gdb/ChangeLog
2019-01-06  Tom Tromey  <tom@tromey.com>

	PR gdb/24060:
	* c-exp.y (CONV_VAR): Rename from VARIABLE.
---
 gdb/ChangeLog | 5 +++++
 gdb/c-exp.y   | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 155fe09f37..3d7f6a05b5 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> CONV_VAR
 
 %token <opcode> ASSIGN_MODIFY
 
@@ -798,7 +798,7 @@ exp	:	FLOAT
 exp	:	variable
 	;
 
-exp	:	VARIABLE
+exp	:	CONV_VAR
 			{
 			  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 CONV_VAR;
 
   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 CONV_VAR:
       parser_fprintf (file, "sval<%s>", copy_name (value.sval));
       break;
 
-- 
2.17.2


             reply	other threads:[~2019-01-06 16:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 16:49 Tom Tromey [this message]
2019-01-06 16:50 ` Tom Tromey
2019-01-06 16:53   ` Simon Marchi
2019-01-07 15:38 John Marshall
2019-01-07 16:14 ` John Marshall
2019-01-07 22:09   ` Simon Marchi
2019-01-08  2:00     ` Tom Tromey
2019-01-08 17:46       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190106164911.22546-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox