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:
| ^~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series
and remembered this old patch.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/rtc/twl92230.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
index f838913b378..28656cb0e59 100644
--- a/hw/rtc/twl92230.c
+++ b/hw/rtc/twl92230.c
@@ -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;
}
}
--
2.26.2
On Fri, 11 Dec 2020 at 15:46, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > 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: > | ^~~~~~~ > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series > and remembered this old patch. > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > 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. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
On 11/12/2020 16.46, Philippe Mathieu-Daudé wrote: > 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: > | ^~~~~~~ ... which occurs when disabling the "VERBOSE" switch in this file (that is enabled by default - that's why we've not noticed this before). > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series > and remembered this old patch. > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/rtc/twl92230.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c > index f838913b378..28656cb0e59 100644 > --- a/hw/rtc/twl92230.c > +++ b/hw/rtc/twl92230.c > @@ -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; > } > } Reviewed-by: Thomas Huth <thuth@redhat.com>
© 2016 - 2024 Red Hat, Inc.