Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 8/17/21 18:23, Nathan Chancellor wrote:
>>>> # Warn about unmarked fall-throughs in switch statement.
>>>> # Clang prior to 14.0.0 warned on unreachable fallthroughs with
>>>> # -Wimplicit-fallthrough, which is unacceptable due to IS_ENABLED().
>>>> # https://bugs.llvm.org/show_bug.cgi?id=51094
>>>> ifeq ($(firstword $(sort $(CONFIG_CLANG_VERSION) 140000)),140000)
>>>> KBUILD_CFLAGS += -Wimplicit-fallthrough
>>>> endif
> 
> Very clever and nifty trick! I have verified that it works for clang 13 and 14 along with a theoretical clang 15. Gustavo, feel free to stick a
> 
> Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> 
> if you so desire.

Yep; I just tested it locally with clang 13 and 14, too.

Thanks
--
Gustavo





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux