[PATCH] bfd/pdb: fix -Wmaybe-uninitialized warning

Alan Modra amodra@gmail.com
Thu Sep 5 06:52:50 GMT 2024


On Wed, Sep 04, 2024 at 06:53:25PM +0100, Mark Harmstone wrote:
> Initialize stream0_start to fix spurious -Wmaybe-uninitialized warning
> on some versions of gcc.

Please apply.  This sort of fix to a patch is fine to apply as abvious.

> ---
>  bfd/pdb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bfd/pdb.c b/bfd/pdb.c
> index c4c528711ed..340cda667a2 100644
> --- a/bfd/pdb.c
> +++ b/bfd/pdb.c
> @@ -718,7 +718,7 @@ pdb_write_contents (bfd *abfd)
>    uint32_t num_blocks;
>    uint32_t num_files = 0;
>    uint32_t num_directory_bytes = sizeof (uint32_t);
> -  uint32_t stream0_start;
> +  uint32_t stream0_start = 0;
>    bfd *arelt;
>  
>    if (bfd_write (pdb_magic, sizeof (pdb_magic), abfd) != sizeof (pdb_magic))
> -- 
> 2.44.2

-- 
Alan Modra


More information about the Binutils mailing list