This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] initialize some variables in m32c-tdep.c
- From: DJ Delorie <dj at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 28 Aug 2006 16:47:59 -0400
- Subject: [patch] initialize some variables in m32c-tdep.c
Unless we have some magic "yes this is always initialized when used"
attribute, this is needed to build this file with -Werror.
* m32c-tdep.c (m32c_decode_srcdest4): Initialize fields in sd
that may not be initialized elsewhere.
(m32c_decode_sd23): Likewise.
Index: m32c-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32c-tdep.c,v
retrieving revision 1.2
diff -p -U3 -r1.2 m32c-tdep.c
--- m32c-tdep.c 13 Jul 2006 12:01:21 -0000 1.2
+++ m32c-tdep.c 28 Aug 2006 20:45:04 -0000
@@ -1196,6 +1196,9 @@ m32c_decode_srcdest4 (struct m32c_pv_sta
else
sd.kind = srcdest_mem;
+ sd.addr = pv_unknown ();
+ sd.reg = 0;
+
switch (code)
{
case 0x0: sd.reg = (size == 1 ? &st->r0 : &st->r0); break;
@@ -1232,6 +1235,9 @@ m32c_decode_sd23 (struct m32c_pv_state *
{
struct srcdest sd;
+ sd.addr = pv_unknown ();
+ sd.reg = 0;
+
switch (code)
{
case 0x12: