From patchwork Sun Jul 30 23:27:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 9870735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 116CB60353 for ; Sun, 30 Jul 2017 23:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E30E728576 for ; Sun, 30 Jul 2017 23:28:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C620828584; Sun, 30 Jul 2017 23:28:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF00528576 for ; Sun, 30 Jul 2017 23:28:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbdG3X1p (ORCPT ); Sun, 30 Jul 2017 19:27:45 -0400 Received: from avasout05.plus.net ([84.93.230.250]:57838 "EHLO avasout05.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbdG3X1p (ORCPT ); Sun, 30 Jul 2017 19:27:45 -0400 Received: from [10.0.2.15] ([143.159.212.52]) by avasout05 with smtp id rBTi1v00218PUFB01BTjsN; Mon, 31 Jul 2017 00:27:43 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=Iav3YSia c=1 sm=1 tr=0 a=CKmocqUIrzA4K3l9YJ19NQ==:117 a=CKmocqUIrzA4K3l9YJ19NQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=EduSR6V_PEesreR1nkAA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 To: Christopher Li Cc: Luc Van Oostenryck , Sparse Mailing-list From: Ramsay Jones Subject: [PATCH] Makefile: pass -Wno-vla to sparse while checking pre-process.c Message-ID: Date: Mon, 31 Jul 2017 00:27:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-GB Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)