gcc-3.4.5 warning fix

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

gcc-3.4.5 warning fix

Alan Modra
Avoids a gcc-3.4.5 warning about "given" possibly being uninitialised.

        * arm-dis.c (print_insn): Warning fix.

Index: opcodes/arm-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arm-dis.c,v
retrieving revision 1.58
diff -u -p -r1.58 arm-dis.c
--- opcodes/arm-dis.c 26 Oct 2005 14:09:29 -0000 1.58
+++ opcodes/arm-dis.c 31 Oct 2005 06:04:26 -0000
@@ -2854,13 +2854,13 @@ print_insn (bfd_vma pc, struct disassemb
       size = 2;
 
       status = info->read_memory_func (pc, (bfd_byte *)b, 2, info);
+      if (little)
+ given = (b[0]) | (b[1] << 8);
+      else
+ given = (b[1]) | (b[0] << 8);
+
       if (!status)
  {
-  if (little)
-    given = (b[0]) | (b[1] << 8);
-  else
-    given = (b[1]) | (b[0] << 8);
-
   /* These bit patterns signal a four-byte Thumb
      instruction.  */
   if ((given & 0xF800) == 0xF800

--
Alan Modra
IBM OzLabs - Linux Technology Centre