hw/rtc/twl92230: Add missing 'break'
PATCH 1/1 hw/rtc/twl92230: Add missing 'break'
Add missing 'break' to fix:
hw/rtc/twl92230.c: In function ‘menelaus_write’:
hw/rtc/twl92230.c:713:5: error: label at end of compound statement
713 | default:
| ^~~~~~~---
I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series and remembered this old patch.
--- hw/rtc/twl92230.c | 1 + 1 file changed, 1 insertion(+)
hw/rtc/twl92230.c +1 -0
@@ -714,6 +714,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)#ifdef VERBOSE printf ("%s: unknown register %02x\n" , __func__, addr);#endif +break ; } }
Signature · 1 line
2.26.2
Quoted 8 lines · Philippe Mathieu-Daudé
Add missing 'break' to fix:
hw/rtc/twl92230.c: In function ‘menelaus_write’:
hw/rtc/twl92230.c:713:5: error: label at end of compound statement713 | default: | ^~~~~~~
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series and remembered this old patch.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/rtc/twl92230.c | 1 + 1 file changed, 1 insertion(+)
I guess the compiler doesn't care about missing 'break' in the last case in a switch statement. But I think putting in the 'break' is better style anyway.
thanks
-- PMM
Quoted 6 lines · Philippe Mathieu-Daudé
Add missing 'break' to fix:
hw/rtc/twl92230.c: In function ‘menelaus_write’:
hw/rtc/twl92230.c:713:5: error: label at end of compound statement713 | default: | ^~~~~~~
... which occurs when disabling the "VERBOSE" switch in this file (that is enabled by default - that's why we've not noticed this before).
Quoted 14 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series and remembered this old patch.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/rtc/twl92230.c | 1 + 1 file changed, 1 insertion(+)hw/rtc/twl92230.c +0
-0
hw/rtc/twl92230.c static void menelaus_write(void *opaque, uint8_t addr, uint8_t value) · line 719
Quoted 6 lines
hw/rtc/twl92230.c +1
-0@@ -714,6 +714,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)#ifdef VERBOSE printf ("%s: unknown register %02x\n" , __func__, addr);#endif +break ; } }