[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240517151833.GB3660288@thelio-3990X>
Date: Fri, 17 May 2024 08:18:33 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, patches@...ts.linux.dev,
kernel test robot <lkp@...el.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] x86/boot: Address clang -Wimplicit-fallthrough in
vsprintf()
On Fri, May 17, 2024 at 11:51:10AM +0200, Borislav Petkov wrote:
> On Thu, May 16, 2024 at 07:03:41AM -0700, Nathan Chancellor wrote:
> > After enabling -Wimplicit-fallthrough for the x86 boot code, clang
> > warns:
> >
> > arch/x86/boot/printf.c:257:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> > 257 | case 'u':
> > | ^
> >
> > Clang is a little more pedantic than GCC, which does not warn when
> > falling through to a case that is just break or return.
>
> Is anyone fixing Clang?
>
> :-P
There was a patch to make Clang match GCC's behavior a few years ago but
I think Kees made a good argument that GCC's behavior leaves potential
bugs on the table, so that was not pursued further.
https://reviews.llvm.org/D91895#2417170
It was brought up to GCC as well but they did not want to change their
behavior:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432
Cheers,
Nathan
Powered by blists - more mailing lists