From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org,
"Thomas Huth" <thuth@redhat.com>,
qemu-ppc@nongnu.org, "Eric Blake" <eblake@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"Cédric Le Goater" <clg@kaod.org>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Greg Kurz" <groug@kaod.org>
Subject: [PATCH 1/5] target/ppc: fix warning with clang-15
Date: Wed, 22 Feb 2023 00:25:16 +0100 [thread overview]
Message-ID: <20230221232520.14480-2-philmd@linaro.org> (raw)
In-Reply-To: <20230221232520.14480-1-philmd@linaro.org>
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
When compiling for windows-arm64 using clang-15, it reports a sometimes
uninitialized variable. This seems to be a false positive, as a default
case guards switch expressions, preventing to return an uninitialized
value, but clang seems unhappy with assert(0) definition.
Change code to g_assert_not_reached() fix the warning.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230221153006.20300-5-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/ppc/dfp_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c
index cc024316d5..5967ea07a9 100644
--- a/target/ppc/dfp_helper.c
+++ b/target/ppc/dfp_helper.c
@@ -121,7 +121,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc,
case 3: /* use FPSCR rounding mode */
return;
default:
- assert(0); /* cannot get here */
+ g_assert_not_reached();
}
} else { /* r == 1 */
switch (rmc & 3) {
@@ -138,7 +138,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc,
rnd = DEC_ROUND_HALF_DOWN;
break;
default:
- assert(0); /* cannot get here */
+ g_assert_not_reached();
}
}
decContextSetRounding(&dfp->context, rnd);
--
2.38.1
next prev parent reply other threads:[~2023-02-21 23:27 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 ` Philippe Mathieu-Daudé [this message]
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
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=20230221232520.14480-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=eblake@redhat.com \
--cc=groug@kaod.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.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).