On 14.04.2023 20:57, Stewart Hildebrand wrote:
> When building the hypervisor for arm64 with -Og, we encounter a (false)
> uninitialized use warning:
> 
> arch/arm/efi/boot.c: In function ‘efi_start’:
> arch/arm/efi/boot.c:1468:9: error: ‘argc’ may be used uninitialized 
> [-Werror=maybe-uninitialized]
>  1468 |         efi_arch_handle_cmdline(argc ? *argv : NULL, options, name.s);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm/efi/boot.c:1263:21: note: ‘argc’ was declared here
>  1263 |     unsigned int i, argc;
>       |                     ^~~~
> cc1: all warnings being treated as errors
> 
> Fix this by initializing argc. As a precaution, also initialize argv.

I'm not happy about this kind of change, and I also wonder whether we
wouldn't better use initializers for both variables if we already have
to work around compiler shortcomings like this one. Nevertheless I can
see the need, so ...

> Signed-off-by: Stewart Hildebrand <[email protected]>

Acked-by: Jan Beulich <[email protected]>

Jan

Reply via email to