tcg/optimize: Add fallthrough annotations
commitd84568b773fe1fc469c4d8419c3545be52eec82c
authorThomas Huth <thuth@redhat.com>
Fri, 11 Dec 2020 15:24:24 +0000 (11 16:24 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 18 Dec 2020 08:14:23 +0000 (18 09:14 +0100)
tree852e4d7439e40e2609041c5fb00746225c549db2
parent9cf5a9cf60a3c5271dee05b6a81a05fb45bee622
tcg/optimize: Add fallthrough annotations

To be able to compile this file with -Werror=implicit-fallthrough,
we need to add some fallthrough annotations to the case statements
that might fall through. Unfortunately, the typical "/* fallthrough */"
comments do not work here as expected since some case labels are
wrapped in macros and the compiler fails to match the comments in
this case. But using __attribute__((fallthrough)) seems to work fine,
so let's use that instead (by introducing a new QEMU_FALLTHROUGH
macro in our compiler.h header file).

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201211152426.350966-11-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
include/qemu/compiler.h
tcg/optimize.c