public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Dwarf: fix build with old gcc
@ 2021-02-15 11:07 Jan Beulich
  2021-02-16  1:18 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-02-15 11:07 UTC (permalink / raw)
  To: Binutils

4.3-ish warns about a possibly uninitialized variable, which results in
a build failure due to -Werror.

binutils/
2021-02-15  Jan Beulich  <jbeulich@suse.com>

	* dwarf.c (process_debug_info): Initialize "dwo_id".

--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3693,7 +3693,7 @@ process_debug_info (struct dwarf_section
 	SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end);
 
       bfd_boolean do_dwo_id = FALSE;
-      uint64_t dwo_id;
+      uint64_t dwo_id = 0;
       if (compunit.cu_unit_type == DW_UT_split_compile
 	  || compunit.cu_unit_type == DW_UT_skeleton)
 	{

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Dwarf: fix build with old gcc
  2021-02-15 11:07 [PATCH] Dwarf: fix build with old gcc Jan Beulich
@ 2021-02-16  1:18 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2021-02-16  1:18 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Binutils

On Mon, Feb 15, 2021 at 12:07:20PM +0100, Jan Beulich via Binutils wrote:
> 4.3-ish warns about a possibly uninitialized variable, which results in
> a build failure due to -Werror.
> 
> binutils/
> 2021-02-15  Jan Beulich  <jbeulich@suse.com>
> 
> 	* dwarf.c (process_debug_info): Initialize "dwo_id".

OK.

> 
> --- a/binutils/dwarf.c
> +++ b/binutils/dwarf.c
> @@ -3693,7 +3693,7 @@ process_debug_info (struct dwarf_section
>  	SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end);
>  
>        bfd_boolean do_dwo_id = FALSE;
> -      uint64_t dwo_id;
> +      uint64_t dwo_id = 0;
>        if (compunit.cu_unit_type == DW_UT_split_compile
>  	  || compunit.cu_unit_type == DW_UT_skeleton)
>  	{

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-16  1:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 11:07 [PATCH] Dwarf: fix build with old gcc Jan Beulich
2021-02-16  1:18 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).