diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-29 22:49:44 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-06-03 13:17:35 +0200 |
| commit | 41f651b442fa4ef2b562573aa4da1b6a644eed76 (patch) | |
| tree | 53a7db21858f232bff57de65e2a21ef3e19e944f /lib.c | |
| parent | 3800353ba503dc700ee3803a6fa4729f03e702ff (diff) | |
| download | sparse-dev-41f651b442fa4ef2b562573aa4da1b6a644eed76.tar.gz | |
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/e6796c60-a870-e761-3b07-b680f934c537@ramsayjones.plus.com/
Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95379
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'lib.c')
| -rw-r--r-- | lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -296,7 +296,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; |
