This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gcc-3.4.5 warning fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Mon, 31 Oct 2005 16:35:46 +1030
- Subject: gcc-3.4.5 warning fix
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