This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Work around a GCC uninitialized warning bug
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 8 Apr 2015 16:27:39 -0000
- Subject: [binutils-gdb] Work around a GCC uninitialized warning bug
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5150992626e67d2f6d1573737e06126bfb712c30
commit 5150992626e67d2f6d1573737e06126bfb712c30
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Apr 8 09:25:08 2015 -0700
Work around a GCC uninitialized warning bug
* compress.c (bfd_compress_section_contents): Work around a GCC
uninitialized warning bug fixed in GCC 4.7.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/compress.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 68e13c5..c7050af 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
+ * compress.c (bfd_compress_section_contents): Work around a GCC
+ uninitialized warning bug fixed in GCC 4.7.
+
+2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
bit.
* bfd.c (bfd::flags): Increase size to 18 bits.
diff --git a/bfd/compress.c b/bfd/compress.c
index ba9fc96..17b24e8 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -79,7 +79,12 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec,
bfd_byte *buffer;
bfd_size_type buffer_size;
bfd_boolean decompress;
+#if defined(__GNUC__) && GCC_VERSION < 4007
+ /* Work around a GCC uninitialized warning bug fixed in GCC 4.7. */
+ int zlib_size = 0;
+#else
int zlib_size;
+#endif
int orig_compression_header_size;
int compression_header_size
= bfd_get_compression_header_size (abfd, NULL);