mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-28 04:25:10 +08:00
Fix compile time warning messages about variables being used before they are initialised.
PR 18313 bin * ieee.c (ieee_read_cxx_class): Initialise the varargs variable. * readelf.c (uncompress_section_contents): Zero initialise the zstream structure. bfd * compress.c (decompress_contents): Zero initialse the z_stream structure.
This commit is contained in:
parent
7a5c933c7c
commit
de13ef81f0
@ -1,3 +1,9 @@
|
||||
2015-04-24 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 18313
|
||||
* compress.c (decompress_contents): Zero initialse the z_stream
|
||||
structure.
|
||||
|
||||
2015-04-24 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
|
||||
|
@ -37,9 +37,12 @@ decompress_contents (bfd_byte *compressed_buffer,
|
||||
|
||||
/* It is possible the section consists of several compressed
|
||||
buffers concatenated together, so we uncompress in a loop. */
|
||||
strm.zalloc = NULL;
|
||||
strm.zfree = NULL;
|
||||
strm.opaque = NULL;
|
||||
/* PR 18313: The state field in the z_stream structure is supposed
|
||||
to be invisible to the user (ie us), but some compilers will
|
||||
still complain about it being used without initialisation. So
|
||||
we first zero the entire z_stream structure and then set the fields
|
||||
that we need. */
|
||||
memset (& strm, 0, sizeof strm);
|
||||
strm.avail_in = compressed_size - 12;
|
||||
strm.next_in = (Bytef*) compressed_buffer + 12;
|
||||
strm.avail_out = uncompressed_size;
|
||||
|
@ -1,3 +1,10 @@
|
||||
2015-04-24 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 18313
|
||||
* ieee.c (ieee_read_cxx_class): Initialise the varargs variable.
|
||||
* readelf.c (uncompress_section_contents): Zero initialise the
|
||||
zstream structure.
|
||||
|
||||
2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR binutils/18209
|
||||
|
@ -2954,7 +2954,7 @@ ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
|
||||
{
|
||||
debug_type return_type;
|
||||
const debug_type *arg_types;
|
||||
bfd_boolean varargs;
|
||||
bfd_boolean varargs = FALSE;
|
||||
|
||||
if (debug_get_type_kind (dhandle, pv->type)
|
||||
!= DEBUG_KIND_FUNCTION)
|
||||
|
@ -12067,9 +12067,12 @@ uncompress_section_contents (unsigned char **buffer,
|
||||
|
||||
/* It is possible the section consists of several compressed
|
||||
buffers concatenated together, so we uncompress in a loop. */
|
||||
strm.zalloc = NULL;
|
||||
strm.zfree = NULL;
|
||||
strm.opaque = NULL;
|
||||
/* PR 18313: The state field in the z_stream structure is supposed
|
||||
to be invisible to the user (ie us), but some compilers will
|
||||
still complain about it being used without initialisation. So
|
||||
we first zero the entire z_stream structure and then set the fields
|
||||
that we need. */
|
||||
memset (& strm, 0, sizeof strm);
|
||||
strm.avail_in = compressed_size - header_size;
|
||||
strm.next_in = (Bytef *) compressed_buffer + header_size;
|
||||
strm.avail_out = uncompressed_size;
|
||||
|
Loading…
Reference in New Issue
Block a user