Nick Desaulniers
unread,May 19, 2020, 8:26:31 PM5/19/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Li, Philip, Masahiro Yamada, Borislav Petkov, lkp, Christoph Hellwig, kbuil...@lists.01.org, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor
On Tue, May 19, 2020 at 4:49 PM Li, Philip <
phil...@intel.com> wrote:
>
> > Subject: Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous
> > prototype for function 'x86_has_pat_wp'
> >
> > Masahiro and Philip,
> > We're seeing a bunch of -Wmissing-prototypes warnings from 0day bot
> > suddenly today. Did something change on the Kbuild or 0day bot side?
> Hi Nick, W=1 was added to make. This leads to extra warnings.
Ah, ok. Good to know the change is in 0day bot which rules out
changes to Kbuild and Clang.
It might be helpful to note in the email that this is a W=1 build,
since it's non obvious and cannot be set via config.
Generally, the kernel is not W=1 clean. I realize that 0day bot can
filter old vs new. Why -Wmissing-prototypes is a problem is that:
1. there are already many instances of it throughout the kernel;
references without forward declarations or correct includes.
2. it's easy for someone to call a function like code that already
exists in the translation unit they're touching.
So by adding another implicit call, they get warned for the whole
file. Generally, the fix is trivial; just include the correct header.
If that leads to tangly-sphagetti-limbo/circular includes, then raw
forward declarations can be used (though it's easy for those to get
out of sync, which can lead to spooky bugs).
I think having in the top of the warning that this is a W=1 build will
make it more obvious.
I get that -Wmissing-prototypes can be noisy, but it's trivial to fix.
I do worry what other warnings lurk in W=1 though...
--
Thanks,
~Nick Desaulniers