diff options
author | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2016-06-22 10:37:16 +0100 |
---|---|---|
committer | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2016-06-22 10:37:16 +0100 |
commit | 81dc17df1b58c2b02d5b5e8a9556ae2a266460f5 (patch) | |
tree | 01823bd466277f635afe1f4ed40c4ff82c2811cf | |
parent | 8f504539f11c0431391faf482d624e4e9dca2ae2 (diff) | |
download | binutils-gdb-users/ARM/embedded-gdb-2_26-branch-2016q1.tar.gz |
Prevent -Wmaybe-uninitialized warning in cmse_scanusers/ARM/embedded-gdb-2_26-branch-2016q1users/ARM/embedded-binutils-2_26-branch-2016q2
2016-06-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
bfd/
* bfd/elf32-arm.c (cmse_scan): Declare and initialize j in the
innermost conditional block containing all its uses.
-rw-r--r-- | bfd/ChangeLog.arm | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog.arm b/bfd/ChangeLog.arm index 0e613565b46..d1af3b58104 100644 --- a/bfd/ChangeLog.arm +++ b/bfd/ChangeLog.arm @@ -1,3 +1,8 @@ +2016-06-22 Thomas Preud'homme <thomas.preudhomme@arm.com> + + * bfd/elf32-arm.c (cmse_scan): Declare and initialize j in the + innermost conditional block containing all its uses. + 2016-06-20 Thomas Preud'homme <thomas.preudhomme@arm.com> * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark sections holding diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 588f832cce2..36d2a338a2e 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -5531,10 +5531,14 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, && hash->root.root.type != bfd_link_hash_defweak) || hash->root.type != STT_FUNC) { + /* Initialize here to avoid warning about use of possibly + uninitialized variable. */ + j = 0; + if (!hash) { /* Searching for a normal symbol with local binding. */ - for (j = 0; j < ext_start; j++) + for (; j < ext_start; j++) { lsym_name = bfd_elf_string_from_elf_section (input_bfd, |