Re: [GIT PULL] Enable -Wimplicit-fallthrough for Clang for 5.16-rc1

From: Gustavo A. R. Silva
Date: Sat Nov 13 2021 - 19:04:13 EST


On Sat, Nov 13, 2021 at 03:20:19PM -0800, Linus Torvalds wrote:
> On Sat, Nov 13, 2021 at 1:36 PM Gustavo A. R. Silva
> <gustavoars@xxxxxxxxxx> wrote:
[..]
> Wouldn't something like this (TOTALLY UNTESTED!) work and do the right thing?
>
> This seems like a natural for a Kconfig decision.
>
> Also, does -Wimplicit-fallthrough=5 work with clang too? That would
> simplify things a bit, and then we could just use a regular boolean
> and do
>
> KBUILD_CFLAGS-$(CC_IMPLICIT_FALLTHROUGH) += -Wimplicit-fallthrough=5

It doesn't work:

error: unknown warning option '-Wimplicit-fallthrough=5'; did you mean '-Wimplicit-fallthrough'? [-Werror,-Wunknown-warning-option]

However, your patch does work. :)

I'll send it as a proper patch, shortly.

Thanks
--
Gustavo