This is the mail archive of the
mailing list for the GCC project.
[PATCH] Silence up a false positive warning in libiberty (PR middle-end/56526)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 5 Mar 2013 11:52:05 +0100
- Subject: [PATCH] Silence up a false positive warning in libiberty (PR middle-end/56526)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
While wrapper_sect_offset is always initialized if
(gnu_sections_found & SOMO_WRAPPING) != 0 and used only guarded with that
same condition, as the PR says apparently we get a false positive maybe
uninitialized warning for it still. I'd say it is a good programming style
to just initialize such vars, especially in performance non-critical code.
Ok for trunk?
2013-03-05 Jakub Jelinek <email@example.com>
* simple-object-mach-o.c (simple_object_mach_o_segment): Initialize
wrapper_sect_offset to avoid a warning.
--- libiberty/simple-object-mach-o.c.jj 2013-01-07 14:14:46.000000000 +0100
+++ libiberty/simple-object-mach-o.c 2013-03-05 11:46:19.574157009 +0100
@@ -432,7 +432,7 @@ simple_object_mach_o_segment (simple_obj
unsigned int n_wrapped_sects;
- off_t wrapper_sect_offset;
+ off_t wrapper_sect_offset = 0;
fetch_32 = (omr->is_big_endian