* Warning on Fedora 38
@ 2023-04-25 11:36 Juan Quintela
2023-04-25 12:11 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Juan Quintela @ 2023-04-25 11:36 UTC (permalink / raw)
To: qemu-devel, Stefan Hajnoczi
Hi
I got this warning/error when switching to F38:
In file included from /mnt/code/qemu/full/include/block/aio.h:21,
from ../../../../mnt/code/qemu/full/util/async.c:28:
../../../../mnt/code/qemu/full/util/async.c: In function ‘aio_bh_poll’:
/mnt/code/qemu/full/include/qemu/queue.h:303:22: error: storing the address of local variable ‘slice’ in ‘*ctx.bh_slice_list.sqh_last’ [-Werror=dangling-pointer=]
303 | (head)->sqh_last = &(elm)->field.sqe_next; \
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
../../../../mnt/code/qemu/full/util/async.c:167:5: note: in expansion of macro ‘QSIMPLEQ_INSERT_TAIL’
167 | QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next);
| ^~~~~~~~~~~~~~~~~~~~
../../../../mnt/code/qemu/full/util/async.c:161:17: note: ‘slice’ declared here
161 | BHListSlice slice;
| ^~~~~
../../../../mnt/code/qemu/full/util/async.c:161:17: note: ‘ctx’ declared here
cc1: all warnings being treated as errors
compiler is right that slice is a local variable.
on the other hand, I *think* that the list is fully consumed on that
function, so this shouldn't be a problem.
g_new() is a posibility.
I can't think of an easy way to convince gcc that using a local varible
there is correct.
How to go from here? Any good ideas?
Later, Juan.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Warning on Fedora 38
2023-04-25 11:36 Warning on Fedora 38 Juan Quintela
@ 2023-04-25 12:11 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2023-04-25 12:11 UTC (permalink / raw)
To: quintela; +Cc: qemu-devel, Stefan Hajnoczi
On Tue, 25 Apr 2023 at 12:37, Juan Quintela <quintela@redhat.com> wrote:
>
>
> Hi
>
> I got this warning/error when switching to F38:
>
> In file included from /mnt/code/qemu/full/include/block/aio.h:21,
> from ../../../../mnt/code/qemu/full/util/async.c:28:
> ../../../../mnt/code/qemu/full/util/async.c: In function ‘aio_bh_poll’:
> /mnt/code/qemu/full/include/qemu/queue.h:303:22: error: storing the address of local variable ‘slice’ in ‘*ctx.bh_slice_list.sqh_last’ [-Werror=dangling-pointer=]
Patch already on list:
https://lore.kernel.org/qemu-devel/20230420202939.1982044-1-clg@kaod.org/
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-25 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 11:36 Warning on Fedora 38 Juan Quintela
2023-04-25 12:11 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.