From 5150992626e67d2f6d1573737e06126bfb712c30 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 8 Apr 2015 09:25:08 -0700 Subject: [PATCH] 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. --- bfd/ChangeLog | 5 +++++ bfd/compress.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 68e13c5bc7..c7050af943 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-04-08 H.J. Lu + + * compress.c (bfd_compress_section_contents): Work around a GCC + uninitialized warning bug fixed in GCC 4.7. + 2015-04-08 H.J. Lu * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI diff --git a/bfd/compress.c b/bfd/compress.c index ba9fc9675a..17b24e8ad0 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);