From nobody Wed May 15 05:35:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 165304382420146.16555036204113; Fri, 20 May 2022 03:50:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.333788.557690 (Exim 4.92) (envelope-from ) id 1ns0Ck-0007OS-Iz; Fri, 20 May 2022 10:49:58 +0000 Received: by outflank-mailman (output) from mailman id 333788.557690; Fri, 20 May 2022 10:49:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns0Ck-0007OL-G9; Fri, 20 May 2022 10:49:58 +0000 Received: by outflank-mailman (input) for mailman id 333788; Fri, 20 May 2022 10:49:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns0Ck-0007OF-07 for xen-devel@lists.xenproject.org; Fri, 20 May 2022 10:49:58 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 962674e2-d82a-11ec-bd2c-47488cf2e6aa; Fri, 20 May 2022 12:49:56 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AF7E51477; Fri, 20 May 2022 03:49:55 -0700 (PDT) Received: from e109506.cambridge.arm.com (e109506.cambridge.arm.com [10.1.199.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA1953F718; Fri, 20 May 2022 03:49:54 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 962674e2-d82a-11ec-bd2c-47488cf2e6aa From: Bertrand Marquis To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH] build: Fix make warning if there is no cppcheck Date: Fri, 20 May 2022 11:49:42 +0100 Message-Id: <11fe35abe0a4cc79e6f7253d04ed12d951f1d09d.1653043632.git.bertrand.marquis@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1653043825506100001 Content-Type: text/plain; charset="utf-8" If cppcheck is not present, the following warning appears during build: which: no cppcheck in ([...]) /bin/sh: cppcheck: command not found Fix this by hiding the error output from which and only try to execute cppcheck --version if we have a cppcheck. Reported-by: Julien Grall Signed-off-by: Bertrand Marquis Acked-by: Julien Grall --- xen/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 15388703bc..f42be3d0ab 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -694,12 +694,13 @@ $(objtree)/%.c.cppcheck: $(srctree)/%.c $(objtree)/in= clude/generated/autoconf.h $(call if_changed,cppcheck_xml) =20 cppcheck-version: -ifeq ($(shell which $(CPPCHECK)),) +ifeq ($(shell which $(CPPCHECK) 2> /dev/null),) $(error Cannot find cppcheck executable: $(CPPCHECK)) -endif +else ifeq ($(shell $(CPPCHECK) --version | awk '{print ($$2 < 2.7)}'),1) $(error Please upgrade your cppcheck to version 2.7 or greater) endif +endif =20 # Put this in generated headers this way it is cleaned by include/Makefile $(objtree)/include/generated/compiler-def.h: --=20 2.25.1