This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix Compile Time Warning: opcodes/crx-dis.c
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 23 Feb 2005 11:55:33 +0000
- Subject: Fix Compile Time Warning: opcodes/crx-dis.c
Hi Guys,
A simple case of a local structure being used without some of its
fields being initialised.
Cheers
Nick
opcodes/ChangeLog
2005-02-23 Nick Clifton <nickc@redhat.com>
* crx-dis.c (make_instruction): Move argument structure into inner
scope and ensure that all of its fields are initialised before
they are used.
Index: opcodes/crx-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/crx-dis.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 crx-dis.c
*** opcodes/crx-dis.c 5 Dec 2004 12:26:49 -0000 1.6
--- opcodes/crx-dis.c 23 Feb 2005 11:42:36 -0000
*************** make_instruction (void)
*** 655,664 ****
{
int i;
unsigned int shift;
- argument a;
for (i = 0; i < currInsn.nargs; i++)
{
a.type = getargtype (instruction->operands[i].op_type);
if (instruction->operands[i].op_type == cst4
|| instruction->operands[i].op_type == rbase_dispu4)
--- 655,665 ----
{
int i;
unsigned int shift;
for (i = 0; i < currInsn.nargs; i++)
{
+ argument a = { 0 };
+
a.type = getargtype (instruction->operands[i].op_type);
if (instruction->operands[i].op_type == cst4
|| instruction->operands[i].op_type == rbase_dispu4)