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] Shadowing fix in gdbscm_frame_read_var


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

commit d951f98b3c8bf202571327d8679ae30ca1da9fdc
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Apr 22 10:46:03 2018 -0600

    Shadowing fix in gdbscm_frame_read_var
    
    -Wshadow=local pointed out that the shadowing in gdbscm_frame_read_var
    means that the ultimate call to read_var_value will always be passed
    block==NULL.  The fix is to remove the inner declaration.
    
    gdb/ChangeLog
    2018-10-04  Tom Tromey  <tom@tromey.com>
    
    	* guile/scm-frame.c (gdbscm_frame_read_var): Remove inner
    	declaration of "block".

Diff:
---
 gdb/ChangeLog         | 5 +++++
 gdb/guile/scm-frame.c | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 42c55ed..3bf08bc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2018-10-04  Tom Tromey  <tom@tromey.com>
 
+	* guile/scm-frame.c (gdbscm_frame_read_var): Remove inner
+	declaration of "block".
+
+2018-10-04  Tom Tromey  <tom@tromey.com>
+
 	* common/filestuff.c (fdwalk): Remove inner declaration of
 	"result".
 
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index 3d27907..5a056de 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -878,7 +878,6 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
     }
   else if (scm_is_string (symbol_scm))
     {
-      const struct block *block = NULL;
       struct gdb_exception except = exception_none;
 
       if (! SCM_UNBNDP (block_scm))


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