Re: [PATCH] x86/boot: Address clang -Wimplicit-fallthrough in vsprintf()

From: Borislav Petkov
Date: Fri May 24 2024 - 12:40:29 EST


On Thu, May 23, 2024 at 04:12:25PM -0700, Kees Cook wrote:
> There isn't a bug _here_, but this is about making the code unambiguous
> everywhere in the kernel. We've already done the work to get rid of
> all these warnings; this one is newly introduced, so let's get it fixed.

Nah, it has been there since forever (forever == 2007 in this case). It
fires because I enabled the warning in the decompressor.

> We don't want to have the same flow-control statement reachable from two
> different "case"s where the resulting behaviors are different. Otherwise
> we can't determine if a "fallthrough" is missing or intentional.

I'd agree if this warning wasn't enabled by default but were a W=123...
diagnostic thing which does the additional checks. But right now clang
is warning for a perfectly valid, albeit a bit confusing C.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette