Message ID | 20220412110631.13865-2-rpalethorpe@suse.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] tools/sparse: Update to v0.6.4 | expand |
Hi Richie,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Fortunately we can workaround the issue with compiler flag.
Hopefully we never need to fork remote repo due need to add a patch to source
code.
Kind regards,
Petr
diff --git a/tools/sparse/Makefile b/tools/sparse/Makefile index 4247dd86e..d35c9cabf 100644 --- a/tools/sparse/Makefile +++ b/tools/sparse/Makefile @@ -20,7 +20,7 @@ $(SPARSE_SRC)/libsparse.a: $(SPARSE_SRC)/Makefile 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
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> --- tools/sparse/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)