Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: [PATCH] Makefile: pass -Wno-vla to sparse while checking pre-process.c
Date: Mon, 31 Jul 2017 00:27:42 +0100	[thread overview]
Message-ID: <c318f85f-43e5-e902-3032-89eeddcb4ffa@ramsayjones.plus.com> (raw)


Introduce a $(CHECKER_FLAGS) variable to allow adding flags, using
target specific variable assignments, to specific $(CHECKER) command
invocations. In particular, in a new pre-process.cs target, include
'-Wno-vla' in the flags while checking pre-process.c.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Chris,

This is what I had in mind for the selfcheck of pre-process.c.
With this patch, selfcheck is clean for me on Linux, but not
on cygwin (I will look at fixing that later).

Thanks!

ATB,
Ramsay Jones

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 64146db..c20ea2c 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ LD = gcc
 AR = ar
 PKG_CONFIG = pkg-config
 CHECKER = ./cgcc -no-compile
+CHECKER_FLAGS =
 
 ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS)
 #
@@ -198,11 +199,13 @@ endif
 
 c2xml.o c2xml.sc: CFLAGS += $(LIBXML_CFLAGS)
 
+pre-process.sc: CHECKER_FLAGS += -Wno-vla
+
 %.o: %.c $(LIB_H)
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
 
 %.sc: %.c sparse
-	$(QUIET_CHECK) $(CHECKER) -c $(ALL_CFLAGS) $<
+	$(QUIET_CHECK) $(CHECKER) $(CHECKER_FLAGS) -c $(ALL_CFLAGS) $<
 
 ALL_OBJS :=  $(LIB_OBJS) $(foreach p,$(PROGRAMS),$(p).o $($(p)_EXTRA_DEPS))
 selfcheck: $(ALL_OBJS:.o=.sc)
-- 
2.13.0

             reply	other threads:[~2017-07-30 23:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 23:27 Ramsay Jones [this message]
2017-07-31  0:05 ` [PATCH] Makefile: pass -Wno-vla to sparse while checking pre-process.c Christopher Li
2017-07-31  0:12   ` Christopher Li
2017-07-31 15:05     ` Ramsay Jones
2017-07-31 15:29       ` Ramsay Jones
2017-07-31 15:51         ` Christopher Li
2017-07-31 16:21           ` Ramsay Jones
2017-07-31 19:32             ` Christopher Li

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=c318f85f-43e5-e902-3032-89eeddcb4ffa@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=sparse@chrisli.org \
    /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