This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

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)
  


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