From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] should we try to stop using variable length arrays?
Date: Thu, 7 Feb 2019 14:28:07 -0600 [thread overview]
Message-ID: <d99cf209-b79f-ae75-af2a-37e87d26af7b@redhat.com> (raw)
In-Reply-To: <CAFEAcA88+A2oCkQnxKDEdpmfCZSmPzWMBg01wDDV68bMZoY5Jg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]
On 2/7/19 1:30 PM, Peter Maydell wrote:
> Currently QEMU has 9 uses of variable length arrays
> (found using -Wvla):
>
>
> Should we be looking to get rid of these and turn on the -Wvla
> warning? I know the Linux kernel has recently decided to do this
> (some rationale at the start of https://lwn.net/Articles/749064/).
A big part of that article was a discussion on how hard it is to write
an eval-once macro MAX() that does not trigger a VLA, and that the
kernel settled on a second macro for use in constant contexts. Do we
want to revist my patch that would add eval-once MAX() and constant-use
MAX_CONST(), to make it easier to avoid accidental VLAs?
https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00727.html
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-07 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 19:30 [Qemu-devel] should we try to stop using variable length arrays? Peter Maydell
2019-02-07 19:39 ` Eric Blake
2019-02-07 20:28 ` Eric Blake [this message]
2019-02-07 21:56 ` Philippe Mathieu-Daudé
2019-02-11 3:26 ` Stefan Hajnoczi
2019-02-11 10:58 ` Daniel P. Berrangé
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=d99cf209-b79f-ae75-af2a-37e87d26af7b@redhat.com \
--to=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).