[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/12] tcg/optimize: Add fallthrough annotations
From: |
Richard Henderson |
Subject: |
Re: [PATCH 10/12] tcg/optimize: Add fallthrough annotations |
Date: |
Fri, 11 Dec 2020 09:45:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 12/11/20 9:24 AM, Thomas Huth wrote:
> 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>
> ---
> include/qemu/compiler.h | 11 +++++++++++
> tcg/optimize.c | 4 ++++
> 2 files changed, 15 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- Re: [PATCH 03/12] hw/rtc/twl92230: Silence warnings about missing fallthrough statements, (continued)
- [PATCH 02/12] target/unicore32/translate: Add missing fallthrough annotations, Thomas Huth, 2020/12/11
- [PATCH 04/12] hw/timer/renesas_tmr: silence the compiler warnings, Thomas Huth, 2020/12/11
- [PATCH 05/12] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, Thomas Huth, 2020/12/11
- [PATCH 07/12] accel/tcg/user-exec: silence the compiler warnings, Thomas Huth, 2020/12/11
- [PATCH 06/12] hw/intc/arm_gicv3_kvm: silence the compiler warnings, Thomas Huth, 2020/12/11
- [PATCH 08/12] target/sparc/translate: silence the compiler warnings, Thomas Huth, 2020/12/11
- [PATCH 10/12] tcg/optimize: Add fallthrough annotations, Thomas Huth, 2020/12/11
- Re: [PATCH 10/12] tcg/optimize: Add fallthrough annotations,
Richard Henderson <=
- [PATCH 12/12] configure: Compile with -Wimplicit-fallthrough=2, Thomas Huth, 2020/12/11
- [PATCH 11/12] tests/fp: Do not emit implicit-fallthrough warnings in the softfloat tests, Thomas Huth, 2020/12/11
- [PATCH 09/12] target/sparc/win_helper: silence the compiler warnings, Thomas Huth, 2020/12/11
- Re: [PATCH 00/12] Compile QEMU with -Wimplicit-fallthrough, Thomas Huth, 2020/12/11
- Re: [PATCH 00/12] Compile QEMU with -Wimplicit-fallthrough, no-reply, 2020/12/11