bfd/pdb: fix -Wmaybe-uninitialized warning
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
Commit Message
Initialize stream0_start to fix spurious -Wmaybe-uninitialized warning
on some versions of gcc.
---
bfd/pdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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
@@ -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))