From patchwork Fri May 20 10:49:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bertrand Marquis X-Patchwork-Id: 12856634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AC33C433FE for ; Fri, 20 May 2022 10:50:10 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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)/include/generated/autoconf.h $(call if_changed,cppcheck_xml) 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 # Put this in generated headers this way it is cleaned by include/Makefile $(objtree)/include/generated/compiler-def.h: