[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 017/126] target/ppc: Fix warning with clang-15
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 017/126] target/ppc: Fix warning with clang-15 |
Date: |
Mon, 27 Feb 2023 15:00:24 +0100 |
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
- [RESEND PULL 000/126] Buildsys / QOM / QDev / UI patches for 2023-02-27, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 011/126] target/hppa: Extract system helpers to sys_helper.c, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 012/126] target/alpha: Remove obsolete STATUS document, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 013/126] target/loongarch/cpu: Remove unused "sysbus.h" header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 014/126] target/loongarch/cpu: Restrict "memory.h" header to sysemu, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 015/126] target/ppc/internal: Restrict MMU declarations to sysemu, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 016/126] target/ppc/kvm: Remove unused "sysbus.h" header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 017/126] target/ppc: Fix warning with clang-15,
Philippe Mathieu-Daudé <=
- [PULL 018/126] target/riscv/cpu: Move Floating-Point fields closer, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 019/126] target/sparc/sysemu: Remove pointless CONFIG_USER_ONLY guard, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 020/126] target/xtensa/cpu: Include missing "memory.h" header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 021/126] target/tricore: Remove unused fields from CPUTriCoreState, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 022/126] qom/object_interfaces: Fix QAPI headers included, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 023/126] trace: Do not try to include QMP commands in user emulation binaries, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 024/126] exec: Remove unused 'qemu/timer.h' timer, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 025/126] tcg: Silent -Wmissing-field-initializers warning, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 026/126] tcg/tcg-op-gvec: Remove unused "qemu/main-loop.h" header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 027/126] accel/tcg: Restrict 'qapi-commands-machine.h' to system emulation, Philippe Mathieu-Daudé, 2023/02/27