Subject: Re: GCC 12 warnings

From: Kees Cook <[email-masked]>
Date: Fri, 20 May 2022 16:30:52 -0700

On Fri, May 20, 2022 at 09:43:03PM +0000, David Laight wrote:
> From: Jakub Kicinski
> > Sent: 20 May 2022 18:24
> ...
> > > +ifeq ($(KBUILD_EXTRA_WARN),)
> > > +CFLAGS_kvaser_usb_hydra.o += -Wno-array-bounds
> > > +endif
> > 
> > Ah, thanks, I must have tried -Wno-array-bounds before I figured out
> > the condition and reverted back to full $(call cc-disable-warning, ..)
> > Let me redo the patches.
> 
> I think you need a check that the compiler actually supports
> -Wno-array-bounds.
> But that only needs be done once, not for every file
> that needs the option.

godbolt tells me that all kernel supported versions of GCC and Clang
handle -Wno-array-bounds. Let me know if there is a combination that
doesn't?

-- 
Kees Cook