Linux Test Project
 help / color / mirror / Atom feed
From: Richard Palethorpe via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: Richard Palethorpe <rpalethorpe@suse.com>
Subject: [LTP] [PATCH 2/2] tools/sparse: Allow null pointer subtraction
Date: Tue, 12 Apr 2022 12:06:31 +0100	[thread overview]
Message-ID: <20220412110631.13865-2-rpalethorpe@suse.com> (raw)
In-Reply-To: <20220412110631.13865-1-rpalethorpe@suse.com>

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(-)

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
 
 
-- 
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-04-12 11:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 11:06 [LTP] [PATCH 1/2] tools/sparse: Update to v0.6.4 Richard Palethorpe via ltp
2022-04-12 11:06 ` Richard Palethorpe via ltp [this message]
2022-04-14 15:35   ` [LTP] [PATCH 2/2] tools/sparse: Allow null pointer subtraction Petr Vorel
2022-04-14 15:32 ` [LTP] [PATCH 1/2] tools/sparse: Update to v0.6.4 Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220412110631.13865-2-rpalethorpe@suse.com \
    --to=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox