[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/7] target/sparc/win_helper: silence the compiler warnings
From: |
Chen Qun |
Subject: |
[PATCH v3 5/7] target/sparc/win_helper: silence the compiler warnings |
Date: |
Mon, 16 Nov 2020 10:48:08 +0800 |
When using -Wimplicit-fallthrough in our CFLAGS on GCC9, the compiler showed
warning:
target/sparc/win_helper.c: In function ‘get_gregset’:
target/sparc/win_helper.c:304:9: warning: this statement may fall through
[-Wimplicit-fallthrough=]
304 | trace_win_helper_gregset_error(pstate);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target/sparc/win_helper.c:306:5: note: here
306 | case 0:
| ^~~~
Add the corresponding "fall through" comment to fix it.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v1->v2: Combine the /* fall through */ to the preceding comments
(Base on Philippe's comments).
Cc: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Artyom Tarasenko <atar4qemu@gmail.com>
---
target/sparc/win_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c
index 8290a21142..e78660b60a 100644
--- a/target/sparc/win_helper.c
+++ b/target/sparc/win_helper.c
@@ -302,7 +302,7 @@ static inline uint64_t *get_gregset(CPUSPARCState *env,
uint32_t pstate)
switch (pstate) {
default:
trace_win_helper_gregset_error(pstate);
- /* pass through to normal set of global registers */
+ /* fall through to normal set of global registers */
case 0:
return env->bgregs;
case PS_AG:
--
2.27.0
- [PATCH v3 1/7] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, (continued)
- [PATCH v3 1/7] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, Chen Qun, 2020/11/15
- [PATCH v3 3/7] accel/tcg/user-exec: silence the compiler warnings, Chen Qun, 2020/11/15
- [PATCH v3 6/7] ppc: Add a missing break for PPC6xx_INPUT_TBEN, Chen Qun, 2020/11/15
- [PATCH v3 4/7] target/sparc/translate: silence the compiler warnings, Chen Qun, 2020/11/15
- [PATCH v3 7/7] target/ppc: replaced the TODO with LOG_UNIMP and add break for silence warnings, Chen Qun, 2020/11/15
- [PATCH v3 5/7] target/sparc/win_helper: silence the compiler warnings,
Chen Qun <=
- [PATCH v3 2/7] hw/intc/arm_gicv3_kvm: silence the compiler warnings, Chen Qun, 2020/11/15