[PATCH] bsd-user: Silence warnings about missing fallthrough statement

Thomas Huth posted 1 patch 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201217154138.1547274-1-thuth@redhat.com
bsd-user/main.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] bsd-user: Silence warnings about missing fallthrough statement
Posted by Thomas Huth 3 years, 4 months ago
When compiling with -Werror=implicit-fallthrough, the compiler complains
about a missing fallthrough annotation in this file. Looking at the code,
the fallthrough is indeed wanted here, so let's add a proper comment.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 bsd-user/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 0a918e8f74..9c700c6234 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -512,6 +512,7 @@ void cpu_loop(CPUSPARCState *env)
         case 0x141:
             if (bsd_type != target_freebsd)
                 goto badtrap;
+            /* fallthrough */
         case 0x100:
 #endif
             syscall_nr = env->gregs[1];
-- 
2.27.0


Re: [PATCH] bsd-user: Silence warnings about missing fallthrough statement
Posted by Richard Henderson 3 years, 4 months ago
On 12/17/20 9:41 AM, Thomas Huth wrote:
> When compiling with -Werror=implicit-fallthrough, the compiler complains
> about a missing fallthrough annotation in this file. Looking at the code,
> the fallthrough is indeed wanted here, so let's add a proper comment.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  bsd-user/main.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~