path: root/Makefile
diff options
authorLuc Van Oostenryck <>2020-05-22 00:25:02 (GMT)
committerJunio C Hamano <>2020-05-24 23:41:21 (GMT)
commit1c966423263cf77bb3fd2d87df4537d31853b58f (patch)
tree144bce596c3efdf4577b3cdd1c6b120d6481f4a2 /Makefile
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
sparse: allow '{ 0 }' to be used without warnings
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 idiom without these warnings [1,2]. To allow this, an option have now been added to Sparse: 537e3e2dae univ-init: conditionally accept { 0 } without warnings So, add this option to the SPARSE_FLAGS variable. Note: The option have just been added to Sparse. So, to benefit now from this patch it's needed to use the latest Sparse source from The option will simply be ignored by older versions of Sparse. [1] [2] Signed-off-by: Luc Van Oostenryck <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Makefile')
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9804a07..c58b781 100644
--- a/Makefile
+++ b/Makefile
@@ -1188,7 +1188,7 @@ PTHREAD_CFLAGS =
# For the 'sparse' target
+SP_EXTRA_FLAGS = -Wno-universal-initializer
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
# usually result in less CPU usage at the cost of higher peak memory.