* [PATCH/obv] Rename `typename' in d-exp.y to avoid C++ reserved word
@ 2015-08-15 0:36 Keith Seitz
2015-08-15 6:52 ` Iain Buclaw
0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2015-08-15 0:36 UTC (permalink / raw)
To: gdb-patches
A recent patch introduced a variable named `typename' into d-exp.y,
and one of the --enable-with-cxx build slaves consequently failed to compile
this. This patch simply adds an underscore into the name to avoid the
reserved word.
gdb/ChangeLog
* d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Rename
`typename' to `type_name' to avoid C++ reserved word.
---
gdb/ChangeLog | 5 +++++
gdb/d-exp.y | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0b604fd..d699070 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-08-14 Keith Seitz <keiths@redhat.com>
+ * d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Rename
+ `typename' to `type_name' to avoid C++ reserved word.
+
+2015-08-14 Keith Seitz <keiths@redhat.com>
+
* location.c (EL_TYPE, EL_LINESPEC, EL_PROBE, EL_ADDRESS)
(EL_EXPLICIT, EL_STRING): Change macro parameter to "P" to
silence ARI errors.
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index e23a0aa..e9d21ac 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -522,12 +522,12 @@ PrimaryExpression:
{
struct bound_minimal_symbol msymbol;
struct block_symbol sym;
- const char *typename = TYPE_SAFE_NAME (type);
- int typename_len = strlen (typename);
+ const char *type_name = TYPE_SAFE_NAME (type);
+ int type_name_len = strlen (type_name);
char *name;
name = xstrprintf ("%.*s.%.*s",
- typename_len, typename,
+ type_name_len, type_name,
$3.length, $3.ptr);
make_cleanup (xfree, name);
--
2.1.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH/obv] Rename `typename' in d-exp.y to avoid C++ reserved word
2015-08-15 0:36 [PATCH/obv] Rename `typename' in d-exp.y to avoid C++ reserved word Keith Seitz
@ 2015-08-15 6:52 ` Iain Buclaw
2015-08-16 13:12 ` Sergio Durigan Junior
0 siblings, 1 reply; 3+ messages in thread
From: Iain Buclaw @ 2015-08-15 6:52 UTC (permalink / raw)
To: Keith Seitz; +Cc: GDB Patches
On 15 August 2015 at 02:36, Keith Seitz <keiths@redhat.com> wrote:
> A recent patch introduced a variable named `typename' into d-exp.y,
> and one of the --enable-with-cxx build slaves consequently failed to compile
> this. This patch simply adds an underscore into the name to avoid the
> reserved word.
>
I'll have to remember to add that to my own builds, thanks.
Iain
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/obv] Rename `typename' in d-exp.y to avoid C++ reserved word
2015-08-15 6:52 ` Iain Buclaw
@ 2015-08-16 13:12 ` Sergio Durigan Junior
0 siblings, 0 replies; 3+ messages in thread
From: Sergio Durigan Junior @ 2015-08-16 13:12 UTC (permalink / raw)
To: Iain Buclaw; +Cc: Keith Seitz, GDB Patches
On Saturday, August 15 2015, Iain Buclaw wrote:
> On 15 August 2015 at 02:36, Keith Seitz <keiths@redhat.com> wrote:
>> A recent patch introduced a variable named `typename' into d-exp.y,
>> and one of the --enable-with-cxx build slaves consequently failed to compile
>> this. This patch simply adds an underscore into the name to avoid the
>> reserved word.
>>
>
> I'll have to remember to add that to my own builds, thanks.
Good idea, but if you forget, there's a builder in our BuildBot
dedicated only to catch failures when compiling with --enable-with-cxx.
If something fails, the author will be notified via e-mail.
Of course it's always good to check before pushing the changes, but I
thought it was worth mentioning the builder just in case.
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-16 13:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-15 0:36 [PATCH/obv] Rename `typename' in d-exp.y to avoid C++ reserved word Keith Seitz
2015-08-15 6:52 ` Iain Buclaw
2015-08-16 13:12 ` Sergio Durigan Junior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox