This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] [OBV] gdb/rs6000: Fix maybe-uninitialized warning.
- From: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- To: sergiodj at redhat dot com
- Cc: uweigand at de dot ibm dot com, cole945 at gmail dot com, gdb-patches at sourceware dot org, Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Date: Wed, 24 Feb 2016 22:06:29 +0100
- Subject: [PATCH] [OBV] gdb/rs6000: Fix maybe-uninitialized warning.
- Authentication-results: sourceware.org; auth=none
- References: <87oab5zvlm dot fsf at redhat dot com>
Introduced by 657f9cde9d531c9929bef9e02a8064101d568f50.
gdb/ChangeLog:
* rs6000-tdep.c (rs6000_frame_cache): Initialize frame and pc to 0
to avoid spurious warnings.
---
Thanks for the report. I can't reproduce the problem locally, but this
patch (pushed as obvious) should do the trick.
gdb/ChangeLog | 5 +++++
gdb/rs6000-tdep.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ea9f3f4..95cabdb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-24 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * rs6000-tdep.c (rs6000_frame_cache): Initialize frame and pc to 0
+ to avoid spurious warnings.
+
2016-02-24 Gary Benson <gbenson@redhat.com>
* exec.c (exec_file_locate_attach): Do not attempt to
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index a56b8b6..d0c56d7 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3209,7 +3209,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct rs6000_framedata fdata;
int wordsize = tdep->wordsize;
- CORE_ADDR func, pc;
+ CORE_ADDR func = 0, pc = 0;
if ((*this_cache) != NULL)
return (struct rs6000_frame_cache *) (*this_cache);
--
2.7.1