From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Warning on Fedora 38
Date: Tue, 25 Apr 2023 13:36:15 +0200 [thread overview]
Message-ID: <87mt2wgpn4.fsf@secure.mitica> (raw)
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.
next reply other threads:[~2023-04-25 11:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 11:36 Juan Quintela [this message]
2023-04-25 12:11 ` Warning on Fedora 38 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mt2wgpn4.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.