qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH 2/5] scripts/checkpatch.pl: Do not allow assert(0)
Date: Thu, 23 Feb 2023 15:51:50 +0100	[thread overview]
Message-ID: <1936bc67-0d87-14f9-452f-60c9d56dfda4@linaro.org> (raw)
In-Reply-To: <2352caa0-ae10-1807-d055-6bd7757113e8@redhat.com>

On 22/2/23 04:53, Thomas Huth wrote:
> On 22/02/2023 00.25, Philippe Mathieu-Daudé wrote:
>> Since commit 262a69f428 ("osdep.h: Prohibit disabling assert()
>> in supported builds") we can not build QEMU with NDEBUG (or
>> G_DISABLE_ASSERT) defined, thus 'assert(0)' always aborts QEMU.
>>
>> However some static analyzers / compilers doesn't notice NDEBUG
>> can't be defined and emit warnings if code is used after an
>> 'assert(0)' call. See for example commit c0a6665c3c ("target/i386:
>> Remove compilation errors when -Werror=maybe-uninitialized").
> 
> commit c0a6665c3c only uses g_assert_not_reached(), so that looks like a 
> bad example for your asset(0) case?

Oh right. I'll simply remove [See for example commit xxx ("xxx")].



  reply	other threads:[~2023-02-23 14:52 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é [this message]
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
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=1936bc67-0d87-14f9-452f-60c9d56dfda4@linaro.org \
    --to=philmd@linaro.org \
    --cc=eblake@redhat.com \
    --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).