]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Work around a GCC uninitialized warning bug
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 8 Apr 2015 16:25:08 +0000 (09:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 8 Apr 2015 16:27:27 +0000 (09:27 -0700)
* compress.c (bfd_compress_section_contents): Work around a GCC
uninitialized warning bug fixed in GCC 4.7.

bfd/ChangeLog
bfd/compress.c

index 68e13c5bc7bf74bde2f1c946482a5de32baa7afa..c7050af943b38c1e4e5e9a85013773e449b0aecf 100644 (file)
@@ -1,3 +1,8 @@
+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
index ba9fc9675ac8334391eb3aa9d0947859cb40fc62..17b24e8ad0260ea3949add934695fbcef3832127 100644 (file)
@@ -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);