Re: [PATCH] add sparse flag to toggle sizeof(void) warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 06, 2018 at 11:50:38PM -1000, Joey Pabalinas wrote:
> Recent changes to the min()/max() macros in include/linux/kernel.h
> have added a lot of noise to sparse output; this is due to the
> *huge* number of new sizeof(void) warnings, most of which can
> largely be ignored.
> 
> Add the -Wsizeof_void flag to enable/disable these warnings on
> demand; the warning itself has been disabled by default to reduce the
> large influx of noise which was inadvertently added by commit
> 3c8ba0d61d04ced9f8 (kernel.h: Retain constant expression output
> for max()/min()).
> 
> Update the manpage to document the new flag.

Thanks. It looks good to me.

I've moved the s/gcc/GCC/ change in a separate commit
(cfr. git://github.com/lucvoo/sparse-dev.git sizeof-void ).
 
I've also seen that for GCC this warning is enabled by -Wpointer-arith.
I think we should do the same. Mind to respin with this change?

There is another thing that I think should be changed:
taking the size of a void is quite weird/counter-intuitive and is
a constraint violation in standard C. So, I think the flag should
be enabled by default but the kernel should have -Wno-pointer-arith
in CHECKFLAGS since it do pointer arithmetic on void (and a few 
places take the size of a function too).

Cheers,
-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux