Linux SPARSE checker discussions
 help / color / mirror / Atom feed
* [PATCH] Makefile: pass -Wno-vla to sparse while checking pre-process.c
@ 2017-07-30 23:27 Ramsay Jones
  2017-07-31  0:05 ` Christopher Li
  0 siblings, 1 reply; 8+ messages in thread
From: Ramsay Jones @ 2017-07-30 23:27 UTC (permalink / raw)
  To: Christopher Li; +Cc: Luc Van Oostenryck, Sparse Mailing-list


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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-31 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-30 23:27 [PATCH] Makefile: pass -Wno-vla to sparse while checking pre-process.c Ramsay Jones
2017-07-31  0:05 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox