tools/sparse: Allow null pointer subtraction
Used for the offsetof trick. Technically it is undefined behavior. A
patch to Sparse is waiting upstream:
https://lore.kernel.org/linux-sparse/20220321112119.23308-1-rpalethorpe@suse.com/T/#u
In the meantime we can disable the warning to make it compile.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
diff --git a/tools/sparse/Makefile b/tools/sparse/Makefile
index 4247dd8..d35c9ca 100644
--- a/tools/sparse/Makefile
+++ b/tools/sparse/Makefile
@@ -20,7 +20,7 @@
HOST_MAKE_TARGETS := sparse-ltp
MAKE_DEPS += $(SPARSE_SRC)/libsparse.a
-HOST_CFLAGS += -I$(SPARSE_SRC) -Werror
+HOST_CFLAGS += -I$(SPARSE_SRC) -Werror -Wno-null-pointer-subtraction
HOST_LDLIBS += $(SPARSE_SRC)/libsparse.a