This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: uninitialized variables
- From: Alan Modra <amodra at gmail dot com>
- To: Lucas Clemente Vella <lvella at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 25 Oct 2010 18:53:56 +1030
- Subject: Re: uninitialized variables
- References: <4C8C21C0.3050209@gmail.com>
On Sat, Sep 11, 2010 at 09:41:36PM -0300, Lucas Clemente Vella wrote:
> These uninitialized variables in bfd/elf32-arm.c caused the compilation
> to fail with -Werror (the default) and -O3 (my choice)
[snip patch]
Thanks for the report. I have applied this patch instead.
* elf32-arm.c (find_stub_size_and_template): Avoid uninitialized
var warning at -O3.
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.245
diff -u -p -r1.245 elf32-arm.c
--- bfd/elf32-arm.c 11 Oct 2010 07:38:53 -0000 1.245
+++ bfd/elf32-arm.c 25 Oct 2010 06:28:27 -0000
@@ -3704,7 +3704,12 @@ find_stub_size_and_template (enum elf32_
unsigned int size;
template_sequence = stub_definitions[stub_type].template_sequence;
+ if (stub_template)
+ *stub_template = template_sequence;
+
template_size = stub_definitions[stub_type].template_size;
+ if (stub_template_size)
+ *stub_template_size = template_size;
size = 0;
for (i = 0; i < template_size; i++)
@@ -3723,16 +3728,10 @@ find_stub_size_and_template (enum elf32_
default:
BFD_FAIL ();
- return FALSE;
+ return 0;
}
}
- if (stub_template)
- *stub_template = template_sequence;
-
- if (stub_template_size)
- *stub_template_size = template_size;
-
return size;
}
--
Alan Modra
Australia Development Lab, IBM