qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/4] target/ppc: fix warning with clang-15


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 4/4] target/ppc: fix warning with clang-15
Date: Fri, 17 Feb 2023 18:23:33 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 16/2/23 14:49, Pierrick Bouvier wrote:
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>
---
  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..0a40bcfee3 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(); /* cannot get here */

If you respin to update the comments to match QEMU style (also
the // in configure), please remove this pointless comment here.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]