This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)")


Hi Sergio,

> This commit broke --enable-build-with-cxx, as can be seen on BuildBot:
> 
>   <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-cxx-build-m64/builds/18/steps/compile%20gdb/logs/stdio>
> 
> 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!
-- 
Joel
>From a52554ac5c4eb203a49004de010b4c7649524630 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]