univ-init: set default to -Wno-universal-initializer
PATCH 1/1 univ-init: set default to -Wno-universal-initializer
'{ 0 }' is the standard idiom for the universal zero initializer '{ }'.
But if the '0' is taken literally, warnings can be issued, for exemple for 'using 0 as NULL pointer' or for 'using a positional initializer' when the attribute 'designated_init' is used.
These warnings were not intended to be issued for this initializer and are confusing and annoying when people have to use or want to use standard code or ignore that '{ }' is fine to use with GCC, clang or Sparse.
So, set sparse default to -Wno-universal-initializer, suppressing any warnings caused by using '{ 0 }' instead of '{ }'.
Reference: https://lore.kernel.org/git/[email protected]/
Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95379
--- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib.c +1 -1
@@ -295,7 +295,7 @@ int Wtransparent_union = 0;int Wtypesign =0 ;int Wundef =0 ;int Wuninitialized =1 ; -int Wuniversal_initializer =1 ; +int Wuniversal_initializer =0 ;int Wunknown_attribute =0 ;int Wvla =1 ;
Signature · 1 line
2.26.2