[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] build: Fix make warning if there is no cppcheck


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 20 May 2022 13:23:32 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7tI4pZCi9R5KxIuaVk09t7Djqp4YupJZ8MLecdi6brM=; b=lwwUDylp6nKxJ4dn2ofoVUKHQ7KEBb8LKPrAZBnMvRCNPChtEggzXdiJNeh2iu60r19Vn2xiElyhP+45HRo/U6HDpCuZJdUhfjM4MQihYL+r1Dn1KOHA3/cnp20sSas7Xcw90T8zlzl+btlg7gc1YdHd6q8/KaBEYye9UltBeY7Luk82A9ONfHcgClQBtFD42Ukwi7rbs4DDaZfvFysLTmpCHDfsbhZEx3YCw1Z48Xdl+IwKFkmFz5h9HlAybBmCW9P+DviXrDXlZ7ya5VBQPcrAVkSupUi4Dx59AfOT9N+9wk/u8gkD4Q/k2dxH2GIUKjf6BOC+CjCMS1cJYocdJg==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7tI4pZCi9R5KxIuaVk09t7Djqp4YupJZ8MLecdi6brM=; b=lWLUnYNfWol9N1jMIwlmjfzdBlbDy3ksY+EurL9lOpQiavFvhFT3gvzm6D82u3Fr52SrmH78xhbuDkBjG5I1OaDsrKdQcY6rNCTTKEpusdxb0Bf8ctHOj4s5wpjFEtzzOy5dGyU4ZF1hbcSrL2AYPAT9A2iCgkr2EKIUvKMT/ec24y31nqf+S1jWyzHH7AivVNvxx9y7gOO/q6co1/C6lqweTSTnUxcdBLu2wowuTkVawvHqaY4WYZXYB8VqEKf7TDIH7J7hc5qio0tcWorj+cxSRhVM+r8JkilkRFsDNqAvyGpEpQKkob/yLnZfJVCv8Sduj7xC8/OLIW5brQbA0Q==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=gg6AeYzXkYLeVpKkl7O28+9T4+Yervw/tKqcOFyDiZTut9gTlYGFH009UGFnrhzYVHXs13VYyDZRQLby3BogstVsQ7opFBjSh34qHWV2/S7Qfm7sKFA98x17rl281zQI/+iCUbxBKTRCnSxhfOunHd7J/cE649LtfDGRHBjU48zBmcZJj/llQQvQU1NDxJN2mXsq9IQEol9Rq9+UqF1ICmu1erYyL8dydmrzsesmYr2dtHnMZzlba7s/5qhnp+0myzN77m7X2Jp33q+RhQcTQy6W2NKpIGXvsCRM9P6XS6CSa4mqeHFivdFnN4Zgxd4hgz9Zt7l1K+n1LjmHIfL+HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oPQHN0TyM6FX8h80G2GTNXSIdRKANIds8iU/Blkm3tA/aa39PlTAVMWDRXg7LNE/J+FWpqajax10S8DgKJjiT61Ri3ZG3lDeZFBOulNESy6sFxOXEdh4zrbFn2ZWfhcRmDehqXX60GTW1cAoKu0epiU7BUdIwJWZ0r8eMFMfE5ZvLZT12l1rsrO/OjA0I4CocdMHhZjEpa6YeRnqT3xOVloBXOxvmlOkkx2w4eIDAQj0/mYjl6dby0XeJ8hcQ+ls8VutPKgyz0UJQC5nolDzsbBewvX0U1fkfqPpEud7l5HXdFi7KMVihLUCvTGIe8Iz/5ysSVt2+Ox8DGK66HZA8A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 20 May 2022 13:24:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYbEM7+m9qlHUq+EuzILzbZuQ4Yq0nuAgAgAAJCoA=
  • Thread-topic: [PATCH v2] build: Fix make warning if there is no cppcheck

Hi,

> On 20 May 2022, at 13:51, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 20.05.2022 14:14, Bertrand Marquis wrote:
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -694,12 +694,14 @@ $(objtree)/%.c.cppcheck: $(srctree)/%.c 
>> $(objtree)/include/generated/autoconf.h
>>      $(call if_changed,cppcheck_xml)
>> 
>> cppcheck-version:
>> -ifeq ($(shell which $(CPPCHECK)),)
>> -    $(error Cannot find cppcheck executable: $(CPPCHECK))
>> -endif
>> -ifeq ($(shell $(CPPCHECK) --version | awk '{print ($$2 < 2.7)}'),1)
>> -    $(error Please upgrade your cppcheck to version 2.7 or greater)
>> -endif
>> +    @if ! which $(CPPCHECK) > /dev/null 2>&1; then \
>> +            echo "Cannot find cppcheck executable: $(CPPCHECK)"; \
>> +            exit 1; \
>> +    fi
>> +    @if [ "$$($(CPPCHECK) --version | awk '{print ($$2 < 2.7)}')" -eq 1 ]; 
>> then \
>> +            echo "Please upgrade your cppcheck to version 2.7 or greater"; \
>> +            exit 1; \
>> +    fi
>> 
>> # Put this in generated headers this way it is cleaned by include/Makefile
>> $(objtree)/include/generated/compiler-def.h:
> 
> Fine with me, even if - as said on v1 - I would have preferred $(if ...).

Could you explain why and what you mean exactly ?
I thought the code would be more complex and less clear using if and I
do not see how it would solve the issue with which being called.

> One question though: Wouldn't it better be $(Q) instead of the two plain
> @? Preferably with that adjustment (which I guess can be made while
> committing):

I thought of it but who would be interested in actually seeing those
commands which are not “building” anything.

> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
Thanks

Bertrand


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.