Re: [PATCH] kconfig: Add support for -Wimplicit-fallthrough

From: Linus Torvalds
Date: Sun Nov 14 2021 - 16:26:15 EST


On Sun, Nov 14, 2021 at 1:18 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> It feels a little odd to have this in Kconfig but if it works and gets
> the warning enabled, then so be it.

We've actually been actively moving more and more of the compiler
flags configuration to Kconfig time.

The Kconfig language makes it fairly easy and natural to do these
days, and in some cases the compiler flags end up having a number of
other dependencies (not in this case, but look at things like
CC_HAS_KASAN_GENERIC etc, where the existence of some compiler flag
ends up then also affecting whether other options can be enabled).

So the whole "move it to config time" ends up being the direction
we've been going, and the only really unusual case here is that it
ends up being done as a string config rather than as a boolean.

And that's just because the different compilers also have different
flags in this case ;(

Linus