From patchwork Fri Mar 31 19:15:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9657173 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 03D23601D2 for ; Fri, 31 Mar 2017 19:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8A77286F2 for ; Fri, 31 Mar 2017 19:17:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9E1A286F7; Fri, 31 Mar 2017 19:17:44 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C1D3286F2 for ; Fri, 31 Mar 2017 19:17:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cu21A-0006eS-85; Fri, 31 Mar 2017 19:15:28 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cu218-0006ds-NW for xen-devel@lists.xenproject.org; Fri, 31 Mar 2017 19:15:26 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 36/FA-27545-ECAAED85; Fri, 31 Mar 2017 19:15:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRWlGSWpSXmKPExsVybKJsh+7ZVfc iDPacUbP4vmUykwOjx+EPV1gCGKNYM/OS8isSWDNuvVzKWnBSomLzgyksDYwTRboYuTiEBKYy SrSc2ssK4exmkpi0/j1LFyMnB5uAocTfJ5vYQGwRASWJe6smM4HYzAJFEge6rzCD2MICVhIX3 x8Ci7MIqEr83fOEHcTmFXCTuH1xEVivhICcxMljk1lBbE4Bd4k1V55CLWtjlHhwcS4zRFGGxL yeOawQtpfEohuXoGw1iavnNjFPYORbwMiwilGjOLWoLLVI19hIL6koMz2jJDcxM0fX0MBMLze 1uDgxPTUnMalYLzk/dxMjMFQYgGAH4+l1gYcYJTmYlER5vxffixDiS8pPqcxILM6ILyrNSS0+ xCjDwaEkweu7EignWJSanlqRlpkDDFqYtAQHj5II7+MVQGne4oLE3OLMdIjUKUZFKXHeKyAJA ZBERmkeXBssUi4xykoJ8zICHSLEU5BalJtZgir/ilGcg1FJmDcdZDtPZl4J3PRXQIuZgBZbfL 0LsrgkESEl1cAYeubB73N7fsSVas9KjePbWnxDwqhbVW1dz7rNZ9Y1y1Ut+O908NdpD8foLSz 30lWenp8kEHg7kveL1YQzrWpu23lOpLxKS7W2jNHZ5b9mQRRL/yGT1eLe8Xy5RcfKf7Ktv2DA d1/KP9Y6SvDb2X7zI+tX5M8I/Nd33PBLkKPtmbJeraxCJXklluKMREMt5qLiRAABADVojwIAA A== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1490987724!84660395!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5824 invoked from network); 31 Mar 2017 19:15:25 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 31 Mar 2017 19:15:25 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 163AB20272; Fri, 31 Mar 2017 19:15:23 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.attlocal.net (104-6-25-238.lightspeed.sntcca.sbcglobal.net [104.6.25.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E99E02026C; Fri, 31 Mar 2017 19:15:21 +0000 (UTC) From: Stefano Stabellini To: xen-devel@lists.xenproject.org Date: Fri, 31 Mar 2017 12:15:17 -0700 Message-Id: <1490987719-25452-2-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490987719-25452-1-git-send-email-sstabellini@kernel.org> References: <1490987719-25452-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: Stefano Stabellini , sstabellini@kernel.org, JBeulich@suse.com Subject: [Xen-devel] [PATCH v8 2/4] xen: introduce a C99 headers check X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce a C99 headers check, for non-ANSI compliant headers: 9pfs.h and pvcalls.h. In addition to the usual -include stdint.h, also add -include string.h to the C99 check to get the declaration of memcpy and size_t. For the same reason, also add -include cstring to the C++ check when necessary. Signed-off-by: Stefano Stabellini CC: JBeulich@suse.com CC: konrad.wilk@oracle.com Reviewed-by: Jan Beulich --- .gitignore | 3 +-- xen/include/Makefile | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 443b12a..0265c1e 100644 --- a/.gitignore +++ b/.gitignore @@ -273,8 +273,7 @@ xen/arch/*/efi/boot.c xen/arch/*/efi/compat.c xen/arch/*/efi/efi.h xen/arch/*/efi/runtime.c -xen/include/headers.chk -xen/include/headers++.chk +xen/include/headers*.chk xen/include/asm xen/include/asm-*/asm-offsets.h xen/include/asm-x86/cpuid-autogen.h diff --git a/xen/include/Makefile b/xen/include/Makefile index aca7f20..fd57ce4 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -90,11 +90,12 @@ compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH)) -all: headers.chk headers++.chk +all: headers.chk headers99.chk headers++.chk PUBLIC_HEADERS := $(filter-out public/arch-% public/dom0_ops.h, $(wildcard public/*.h public/*/*.h) $(public-y)) -PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h, $(PUBLIC_HEADERS)) +PUBLIC_C99_HEADERS := +PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS)) headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile for i in $(filter %.h,$^); do \ @@ -104,16 +105,21 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile done >$@.new mv $@.new $@ +headers99.chk: $(PUBLIC_C99_HEADERS) Makefile + rm -f $@.new + $(foreach i, $(filter %.h,$^), $(CC) -x c -std=c99 -Wall -Werror \ + -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \ + -S -o /dev/null $(i) || exit $$?; echo $(i) >> $@.new;) + mv $@.new $@ + headers++.chk: $(PUBLIC_HEADERS) Makefile - if $(CXX) -v >/dev/null 2>&1; then \ - for i in $(filter %.h,$^); do \ - echo '#include "'$$i'"' \ - | $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \ - -include stdint.h -include public/xen.h -S -o /dev/null - \ - || exit 1; \ - echo $$i; \ - done ; \ - fi >$@.new + rm -f $@.new + $(CXX) -v >/dev/null 2>&1 || exit 0; \ + $(foreach i, $(filter %.h,$^), echo "#include "\"$(i)\" \ + |$(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \ + -include stdint.h -include public/xen.h \ + $(foreach j, $($(i)-prereq), -include c$(j)) -S -o /dev/null - \ + || exit $$?; echo $(i) >> $@.new;) mv $@.new $@ endif @@ -128,5 +134,5 @@ all: $(BASEDIR)/include/asm-x86/cpuid-autogen.h endif clean:: - rm -rf compat headers.chk headers++.chk + rm -rf compat headers*.chk rm -f $(BASEDIR)/include/asm-x86/cpuid-autogen.h