This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_29-branch] * dwarf.c (display_debug_names): Initialize hash_prev.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ab0462915cae36d5af2315540745f348603ad61f

commit ab0462915cae36d5af2315540745f348603ad61f
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date:   Thu Sep 14 04:52:20 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.
    
    Import from mainline.

Diff:
---
 binutils/ChangeLog | 5 +++++
 binutils/dwarf.c   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cffc49a..1df5921 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-18  Hans-Peter Nilsson  <hp@bitrange.com>
+
+	Import from mainline:
+	* dwarf.c (display_debug_names): Initialize hash_prev.
+
 2017-09-05  Nick Clifton  <nickc@redhat.com>
 
 	Import from mainline:
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 419839b..3842ffd 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]