From patchwork Wed May 20 07:26:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 6808 Received: (qmail 115150 invoked by alias); 20 May 2015 07:26:06 -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 115139 invoked by uid 89); 20 May 2015 07:26:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 20 May 2015 07:26:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 56865289C0; Wed, 20 May 2015 03:26:02 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FceDJ0AEdWqH; Wed, 20 May 2015 03:26:02 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 21161287A3; Wed, 20 May 2015 03:26:02 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 03B7540DAA; Wed, 20 May 2015 09:26:02 +0200 (CEST) Date: Wed, 20 May 2015 09:26:01 +0200 From: Joel Brobecker To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org, Jerome Guitton Subject: [pushed] gdb/ada-lang.c: Rename local variable typename into type_name (was: "Regression when using --enable-build-with-cxx (was: Re: [PATCH] Non bit-packed packed arrays as variable-length fields)") Message-ID: <20150520072601.GA4695@adacore.com> References: <1431724096-25192-1-git-send-email-brobecker@adacore.com> <87y4kk4dx6.fsf@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87y4kk4dx6.fsf@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Sergio, > This commit broke --enable-build-with-cxx, as can be seen on BuildBot: > > > > I think the main reason is that 'typename' is a reserved C++ keyword. > Should be straightforward to fix :-). Oops, thanks for the heads up! I didn't know that typename was a reserved keyword in C++. Attached is the patch I just pushed. It fixes the build failure on my end. gdb/ChangeLog: * ada-lang.c (to_fixed_array_type): Rename local variable typename into type_name. Thanks! From a52554ac5c4eb203a49004de010b4c7649524630 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 20 May 2015 09:14:30 +0200 Subject: [PATCH] gdb/ada-lang.c: Rename local variable typename into type_name... ... to avoid a build failure when building with C++ compiler (when configured with --enable-build-with-cxx). We cannot use "typename" as it is a C++ reserved keyword. gdb/ChangeLog: * ada-lang.c (to_fixed_array_type): Rename local variable typename into type_name. --- gdb/ada-lang.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f789108..782447a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8582,16 +8582,16 @@ to_fixed_array_type (struct type *type0, struct value *dval, if (index_type_desc == NULL) { - const char *typename = ada_type_name (type0); + const char *type_name = ada_type_name (type0); - if (typename != NULL) + if (type_name != NULL) { - const int len = strlen (typename); + const int len = strlen (type_name); char *name = (char *) alloca (len + strlen (xa_suffix)); - if (typename[len - 1] == 'P') + if (type_name[len - 1] == 'P') { - strcpy (name, typename); + strcpy (name, type_name); strcpy (name + len - 1, xa_suffix); index_type_desc = ada_find_parallel_type_with_name (type0, name); } -- 1.9.1