Skip to contentSkip to conversation

tools/sparse: Update to v0.6.4

PATCH In review Richard Palethorpe via ltp 2 participants 4 messages Apr 12, 2022 – Apr 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tools/sparse: Update to v0.6.4

Use the latest version of Sparse upstream.

---
 tools/sparse/sparse-src | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sparse/sparse-src +1 -1
index 8af243292..c4706aa76 160000
@@ -1 +1 @@
-Subproject commit 8af2432923486c753ab52cae70b94ee684121080
+Subproject commit c4706aa764f3ae68258ba60be6325a5662900362
Signature · 5 lines
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH 2/2 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/[email protected]/T/#u

In the meantime we can disable the warning to make it compile.

---
 tools/sparse/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sparse/Makefile +1 -1
index 4247dd86e..d35c9cabf 100644
@@ -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
 
 
Signature · 5 lines
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 2/2
#2 lore raw

Re: [LTP] [PATCH 2/2] tools/sparse: Allow null pointer subtraction

Hi Richie,

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

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp