grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] mkimage: Fix dangling pointer may be used error


From: Daniel Kiper
Subject: Re: [PATCH 1/3] mkimage: Fix dangling pointer may be used error
Date: Tue, 22 Mar 2022 21:59:03 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Mar 17, 2022 at 02:43:40PM +0800, Michael Chang via Grub-devel wrote:
> The warning is real as long as dangling pointer to 'tmp_' may be used if
> o32 and o64 are both null. However that is not going to happen and can
> be ignored safely because the PE_OHDR is being used in a context that
> either o32 or o64 must have been properly initialized. Sadly compiler
> seems not to always optimize that unused _tmp away so explicit
> suppression remain needed here.
>
> ../util/mkimage.c: In function 'grub_install_generate_image':
> ../util/mkimage.c:1422:41: error: dangling pointer to 'tmp_' may be used 
> [-Werror=dangling-pointer=]
>  1422 |         PE_OHDR (o32, o64, header_size) = grub_host_to_target32 
> (header_size);
> ../util/mkimage.c:857:28: note: 'tmp_' declared here
>   857 |   __typeof__((o64)->field) tmp_;                \
>       |                            ^~~~
>
> Signed-off-by: Michael Chang <mchang@suse.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]