This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Fix the [-Werror=shadow=local] warning


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a51bb70c8a1570f2e6fa74432578bcdf7f2785aa

commit a51bb70c8a1570f2e6fa74432578bcdf7f2785aa
Author: Weimin Pan <weimin.pan@oracle.com>
Date:   Mon Oct 8 22:14:11 2018 +0000

    Fix the [-Werror=shadow=local] warning
    
    Rename local variable in value_struct_elt_for_reference()
    to work around the shadowing a previous local warning.

Diff:
---
 gdb/ChangeLog | 4 ++++
 gdb/valops.c  | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f074385..eac1dc2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-08  Weimin Pan  <weimin.pan@oracle.com>
+	* valops.c (value_struct_elt_for_reference): Rename local variable
+	to work around the shadowing a previous local warning.
+
 2018-10-08  John Baldwin  <jhb@FreeBSD.org>
 
 	* Makefile.in (ALLDEPFILES): Add riscv-fbsd-nat.c.
diff --git a/gdb/valops.c b/gdb/valops.c
index 99b1275..c45caef 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3439,9 +3439,9 @@ value_struct_elt_for_reference (struct type *domain, int offset,
 		        mem_offset += boff;
 		      else
 		        {
-		          struct type *t = check_typedef (value_type (this_v));
-		          t = check_typedef (TYPE_TARGET_TYPE (t));
-		          if (get_baseclass_offset (t, curtype, this_v,
+		          struct type *p = check_typedef (value_type (this_v));
+		          p = check_typedef (TYPE_TARGET_TYPE (p));
+		          if (get_baseclass_offset (p, curtype, this_v,
 						    &boff, &isvirt))
 		            mem_offset += boff;
 		        }


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