From patchwork Sun Jan 6 16:49:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 30976 Received: (qmail 130185 invoked by alias); 6 Jan 2019 16:49:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 130058 invoked by uid 89); 6 Jan 2019 16:49:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Jan 2019 16:49:16 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 7BFCC16DB52 for ; Sun, 6 Jan 2019 10:49:15 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id gBbvgc9M14FKpgBbvg430F; Sun, 06 Jan 2019 10:49:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TgW9mOHjkyxEWJKBXT9vR9YNTYKWOqXQ8FZtsRCvwHY=; b=Zn/bpFUxOImhEHSWb4hg6N20ZY blDWGR9I7QJnbTSO2/Yd67fvpVDSOPwJciMyBvGJYbD76bvJDxLnu730SmO1wRRJSee4tORMXo1Gt P3pHELZ7QhtvjznjHkgBoLEE/; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:37390 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1ggBbv-000WcK-9F; Sun, 06 Jan 2019 10:49:15 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix build failure with macOS bison Date: Sun, 6 Jan 2019 09:49:11 -0700 Message-Id: <20190106164911.22546-1-tom@tromey.com> 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 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 VARIABLE +%token CONV_VAR %token 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;