Em Fri, 13 Sep 2019 11:42:38 -0700
Joe Perches <joe(a)perches.com> escreveu:
On Fri, 2019-09-13 at 15:26 +0100, Rob Herring wrote:
> On Fri, Sep 13, 2019 at 3:12 PM Joe Perches <joe(a)perches.com> wrote:
> > On Thu, 2019-09-12 at 13:01 -0700, Bart Van Assche wrote:
> >
> > > Another argument in favor of W=1 is that the formatting of kernel-doc
> > > headers is checked only if W=1 is passed to make.
> >
> > Actually, but for the fact there are far too many
> > to generally enable that warning right now,
> > (an x86-64 defconfig has more than 1000)
> > that sounds pretty reasonable to me.
> It's in the 1000s on arm because W=1 turns on more checks in building
> .dts files. There are lots of duplicates as most of the dts content is
> as an include file (e.g. board dts includes soc dts).
Yeah, dts[i] files in arm compilations are very noisy at W=1
so moving those message types to W=2 seems sensible.
$ { opt="ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi-" ; make $opt clean ;
make $opt defconfig ; make $opt W=1 -j4 ; } > arm_make.log 2>&1
$ grep -i -P 'dtsi?:.*warning' arm_make.log | wc -l
69164
Yeah, makes sense moving them to W=2, or to make them somehow produce
less noise.
Just fyi: for an x86-64 defconfig with gcc 8.3
$ { make clean ; make defconfig ; make -j4 W=1 ; } > make.log 2>&1
There are ~300 W=1 for non kernel-doc -W<foo> warnings.
$ grep -i -P -oh '\[\-W[\w\-]+\]' make.log |sort | uniq -c | sort -rn
163 [-Wmissing-prototypes]
69 [-Wunused-but-set-variable]
16 [-Wempty-body]
10 [-Wtype-limits]
6 [-Woverride-init]
2 [-Wstringop-truncation]
2 [-Wcast-function-type]
1 [-Wunused-but-set-parameter]
On my eyes, it doesn't sound too much. I suspect that,
with gcc-9, it should produce more warnings, though.
Perhaps we could "promote" most of those to W=0.
And there are ~1000 kernel-doc only messages in various files
A significant amount of those warnings appear with "make htmldocs".
Not having the kernel-doc warning as part of W=0 helps to make
very hard to have them cleared.
IMHO, those should be enabled by default with W=0, at least for the
files that are included on some kernel-doc tag.
I mean, perhaps, when W=0, Kernel build could run:
$ ./scripts/kernel-doc -none $(git grep kernel-doc:: Documentation/|cut -d:
-f4-|sort|uniq|grep -vE "\bsource\b")
That produces 165 warnings (against v5.3-rc4 + media -next patches).
Thanks,
Mauro