Re: [PATCH] sparse: allow '{ 0 }' to be used without warnings

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

 



On Thu, May 21, 2020 at 5:46 PM Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> In standard C, '{ 0 }' can be used as an universal zero-initializer.
> However, Sparse complains if this is used on a type where the first
> member (possibly nested) is a pointer since Sparse purposely wants
> to warn when '0' is used to initialize a pointer type.
>
> Legitimaly, it's desirable to be able to use '{ 0 }' as an idom
> without these warnings [1,2].

s/idom/idiom/

> An option have now been added to Sparse to turn off such warnings.
> So, add this option to the SPARSE_FLAGS variable.

Do you have a reference to the commit or Sparse release notes which
mention this new option? It might be nice to include it here in the
commit message. Also, should this minimum Sparse version be mentioned
somewhere in documentation so that people invoking the "sparse"
makefile target aren't greeted with an error about
-Wno-universal-initializer being an unrecognized option (assuming that
older Sparse would complain about it)?

> [1] https://lore.kernel.org/r/e6796c60-a870-e761-3b07-b680f934c537@xxxxxxxxxxxxxxxxxxxx
> [2] https://lore.kernel.org/r/xmqqd07xem9l.fsf@xxxxxxxxxxxxxxxxxxxxxx
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux