This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] * dwarf.c (display_debug_names): Initialize hash_prev.
- From: Hans-Peter Nilsson <hp at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 18 Jul 2017 10:14:27 -0000
- Subject: [binutils-gdb] * dwarf.c (display_debug_names): Initialize hash_prev.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0a79bef4f206d89214c48454a4302d6b6f8f68c0
commit 0a79bef4f206d89214c48454a4302d6b6f8f68c0
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date: Tue Jul 18 12:14:38 2017 +0200
* dwarf.c (display_debug_names): Initialize hash_prev.
gcc-4.3.0 warns that it may be used uninitialized. It takes a look
and a half at the code to understand that it's false.
Diff:
---
binutils/ChangeLog | 4 ++++
binutils/dwarf.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index f1400dc..d365736 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-18 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * dwarf.c (display_debug_names): Initialize hash_prev.
+
2017-07-17 Nick Clifton <nickc@redhat.com>
PR 21433
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 5f8922e..f6fa157 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -7816,7 +7816,7 @@ display_debug_names (struct dwarf_section *section, void *file)
printf (_("Used %zu of %lu buckets.\n"), buckets_filled,
(unsigned long) bucket_count);
- uint32_t hash_prev;
+ uint32_t hash_prev = 0;
size_t hash_clash_count = 0;
size_t longest_clash = 0;
size_t this_length = 0;