Skip to contentSkip to conversation

h8300:let the checker know that size_t is ulong

PATCH In review Luc Van Oostenryck 2 participants 2 messages May 30, 2018 – Jul 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 h8300:let the checker know that size_t is ulong

All 64bit archs use unsigned long for size_t and most 32bit archs use 'unsigned int'. By default, this is what is assumed by sparse.

However, on h8300 (a 32bit arch) size_t is unsigned long which can led sparse to emit wrong warnings.

Fix this by passing to sparse the flag -msize-long, telling it that size_t is unsigned long.

---
 arch/h8300/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/h8300/Makefile +2 -0
index e1c02ca23..eaac6685f 100644
@@ -22,6 +22,8 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 
+CHECKFLAGS += -msize-long
+
 ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
 endif
Signature · 1 line
2.17.0
#1 lore raw
Quoted 32 lines · Luc Van Oostenryck

All 64bit archs use unsigned long for size_t and most 32bit archs use 'unsigned int'. By default, this is what is assumed by sparse.

However, on h8300 (a 32bit arch) size_t is unsigned long which can led sparse to emit wrong warnings.

Fix this by passing to sparse the flag -msize-long, telling it that size_t is unsigned long.

---
 arch/h8300/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/h8300/Makefile +2 -0
index e1c02ca23..eaac6685f 100644
@@ -22,6 +22,8 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 
+CHECKFLAGS += -msize-long
+
 ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
 endif
Signature · 1 line
2.17.0

Sorry too late replay.
Applied to h8300-next.
Thanks.

Signature · 1 line
Yosinori Sato