[Tarantool-patches] [PATCH luajit 13/19] ARM: Fix GCC 7 -Wimplicit-fallthrough warnings.

Sergey Bronnikov sergeyb at tarantool.org
Thu Aug 17 10:44:34 MSK 2023


Hi, Sergey!

LGTM, but I have a question inline


On 8/9/23 18:36, Sergey Kaplun wrote:
> From: Mike Pall <mike>
>
> (cherry-picked from commit 9bd5a722bee2ee2c5b159a89937778b81be49915)
>
> This patch adds the `/* fallthrough */` comments elsewhere, where it was
> missing for the ARM build, so the `-Wimplicit-fallthrough` [1] warning
> is trigerred.
>
> Also, this commits sets the correspoinding flag in the
> <cmake/SetTargetFlags.cmake>.
>
> [1]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
>
> Sergey Kaplun:
> * added the description for the commit
>
> Part of tarantool/tarantool#8825
> ---
>   cmake/SetTargetFlags.cmake | 6 ++++++
>   src/lj_asm.c               | 2 +-
>   src/lj_asm_arm.h           | 4 ++--
>   3 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake
> index 3b9e481d..d309989e 100644
> --- a/cmake/SetTargetFlags.cmake
> +++ b/cmake/SetTargetFlags.cmake
> @@ -8,6 +8,12 @@
>   
>   include(CheckUnwindTables)
>   
> +# Clang does not recognize comment markers.
> +if (CMAKE_C_COMPILER_ID STREQUAL "GNU"
> +    AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.1")

GCC 7.1 because there was no 7.0 in release series 7 [1], right?

1. https://gcc.gnu.org/gcc-7/

> +  AppendFlags(TARGET_C_FLAGS -Wimplicit-fallthrough)
> +endif()
> +
>   if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
>     set(BUILDVM_MODE machasm)
>   else() # Linux and FreeBSD.


<snipped>



More information about the Tarantool-patches mailing list