From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
qemu-arm@nongnu.org, Thomas Huth <thuth@redhat.com>,
qemu-ppc@nongnu.org, Eric Blake <eblake@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
Subject: Re: [PATCH 5/5] hw: Remove mentions of NDEBUG
Date: Wed, 22 Feb 2023 11:28:19 -0500 [thread overview]
Message-ID: <20230222112755-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <3544bf56-4d5c-174d-5bfd-a67c9689ca37@linaro.org>
On Wed, Feb 22, 2023 at 05:11:36PM +0100, Philippe Mathieu-Daudé wrote:
> On 22/2/23 13:05, Michael S. Tsirkin wrote:
> > On Wed, Feb 22, 2023 at 12:25:20AM +0100, Philippe Mathieu-Daudé wrote:
> > > Since commit 262a69f428 ("osdep.h: Prohibit disabling
> > > assert() in supported builds") 'NDEBUG' can not be defined.
> > >
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> >
> > this exactly says NDEBUG is not allowed. why are you removing this?
>
> The project can not be built with NDEBUG. There is no point in
> mentioning it in each individual function.
the reason we mention it is because there are security implications
if we don't.
> > > ---
> > > hw/scsi/mptsas.c | 2 --
> > > hw/virtio/virtio.c | 2 --
> > > 2 files changed, 4 deletions(-)
> > >
> > > diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> > > index c485da792c..5b373d3ed6 100644
> > > --- a/hw/scsi/mptsas.c
> > > +++ b/hw/scsi/mptsas.c
> > > @@ -1240,8 +1240,6 @@ static void *mptsas_load_request(QEMUFile *f, SCSIRequest *sreq)
> > > n = qemu_get_be32(f);
> > > /* TODO: add a way for SCSIBusInfo's load_request to fail,
> > > * and fail migration instead of asserting here.
> > > - * This is just one thing (there are probably more) that must be
> > > - * fixed before we can allow NDEBUG compilation.
> > > */
> > > assert(n >= 0);
> > >
> > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > > index f35178f5fc..c6b3e3fb08 100644
> > > --- a/hw/virtio/virtio.c
> > > +++ b/hw/virtio/virtio.c
> > > @@ -1898,8 +1898,6 @@ void *qemu_get_virtqueue_element(VirtIODevice *vdev, QEMUFile *f, size_t sz)
> > > /* TODO: teach all callers that this can fail, and return failure instead
> > > * of asserting here.
> > > - * This is just one thing (there are probably more) that must be
> > > - * fixed before we can allow NDEBUG compilation.
> > > */
> > > assert(ARRAY_SIZE(data.in_addr) >= data.in_num);
> > > assert(ARRAY_SIZE(data.out_addr) >= data.out_num);
> > > --
> > > 2.38.1
> >
next prev parent reply other threads:[~2023-02-22 16:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 23:25 [PATCH 0/5] bulk: Replace assert(0) -> g_assert_not_reached() Philippe Mathieu-Daudé
2023-02-21 23:25 ` [PATCH 1/5] target/ppc: fix warning with clang-15 Philippe Mathieu-Daudé
2023-02-21 23:25 ` [PATCH 2/5] scripts/checkpatch.pl: Do not allow assert(0) Philippe Mathieu-Daudé
2023-02-22 0:08 ` Richard Henderson
2023-02-22 3:53 ` Thomas Huth
2023-02-23 14:51 ` Philippe Mathieu-Daudé
2023-02-21 23:25 ` [PATCH 3/5] bulk: Replace [g_]assert(0) -> g_assert_not_reached() Philippe Mathieu-Daudé
2023-02-22 0:08 ` Richard Henderson
2023-02-22 4:06 ` Thomas Huth
2023-02-22 6:29 ` Richard Henderson
2023-02-22 11:54 ` Thomas Huth
2023-02-22 11:56 ` Thomas Huth
2023-02-22 13:02 ` Philippe Mathieu-Daudé
2023-02-21 23:25 ` [PATCH 4/5] block/vvfat: Remove pointless check of NDEBUG Philippe Mathieu-Daudé
2023-02-22 0:09 ` Richard Henderson
2023-02-21 23:25 ` [PATCH 5/5] hw: Remove mentions " Philippe Mathieu-Daudé
2023-02-22 0:10 ` Richard Henderson
2023-02-22 12:05 ` Michael S. Tsirkin
2023-02-22 16:11 ` Philippe Mathieu-Daudé
2023-02-22 16:28 ` Michael S. Tsirkin [this message]
2023-02-22 18:43 ` Richard Henderson
2023-02-22 20:23 ` Michael S. Tsirkin
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=20230222112755-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@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 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).