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 C6FAEC43334 for ; Fri, 24 Jun 2022 12:22:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.355505.583202 (Exim 4.92) (envelope-from ) id 1o4iKH-0002pJ-3p; Fri, 24 Jun 2022 12:22:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 355505.583202; Fri, 24 Jun 2022 12:22:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4iKH-0002pC-0O; Fri, 24 Jun 2022 12:22:17 +0000 Received: by outflank-mailman (input) for mailman id 355505; Fri, 24 Jun 2022 12:22:15 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4iKF-0002p6-Aj for xen-devel@lists.xenproject.org; Fri, 24 Jun 2022 12:22:15 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4iKE-0005Yu-VL; Fri, 24 Jun 2022 12:22:14 +0000 Received: from 54-240-197-238.amazon.com ([54.240.197.238] helo=[192.168.4.76]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o4iKE-0007nu-Oz; Fri, 24 Jun 2022 12:22:14 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=Mu5cI+Pils4nDP2905FyerWfuU2zuaXL4QcvVQU3wNI=; b=ixqCn7UrU1S0zCgLLYdrkGVqMC FA6LzlNZ2ilViU83HGe9uZ6mrQkbcE9ciClnYQRrfffy5nq3y8GmvgkM+63AK9qxZ/0AeRZFCWe8H 539x/I7sLNk+IQrjPYV7LkjMRfzYjrOHKfPFrwwvZmqljAQbS8kYIOWGTC+pqHHpZOe8=; Message-ID: <581ae1a2-bf1b-7dca-fa0b-a772ad7c489a@xen.org> Date: Fri, 24 Jun 2022 13:22:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] docs/misra: Add instructions for cppcheck To: Bertrand Marquis Cc: Luca Fancellu , xen-devel , Wei Chen , Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu References: <20220624105311.21057-1-luca.fancellu@arm.com> <692d09fa-5513-132a-6b5b-4bc62e46a443@xen.org> From: Julien Grall In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24/06/2022 13:18, Bertrand Marquis wrote: > Hi Julien, Hi Bertrand, > >> On 24 Jun 2022, at 13:08, Julien Grall wrote: >> >> >> >> On 24/06/2022 12:40, Bertrand Marquis wrote: >>> Hi Julien, >> >> Hi Bertrand, >> >>>> On 24 Jun 2022, at 12:20, Julien Grall wrote: >>>> >>>> Hi Luca, >>>> >>>> On 24/06/2022 11:53, Luca Fancellu wrote: >>>>> Add instructions on how to build cppcheck, the version currently used >>>>> and an example to use the cppcheck integration to run the analysis on >>>>> the Xen codebase >>>>> Signed-off-by: Luca Fancellu >>>>> --- >>>>> docs/misra/cppcheck.txt | 66 +++++++++++++++++++++++++++++++++++++++++ >>>>> 1 file changed, 66 insertions(+) >>>>> create mode 100644 docs/misra/cppcheck.txt >>>>> diff --git a/docs/misra/cppcheck.txt b/docs/misra/cppcheck.txt >>>>> new file mode 100644 >>>>> index 000000000000..4df0488794aa >>>>> --- /dev/null >>>>> +++ b/docs/misra/cppcheck.txt >>>>> @@ -0,0 +1,66 @@ >>>>> +Cppcheck for Xen static and MISRA analysis >>>>> +========================================== >>>>> + >>>>> +Xen can be analysed for both static analysis problems and MISRA violation using >>>>> +cppcheck, the open source tool allows the creation of a report with all the >>>>> +findings. Xen has introduced the support in the Makefile so it's very easy to >>>>> +use and in this document we can see how. >>>>> + >>>>> +First recommendation is to use exactly the same version in this page and provide >>>>> +the same option to the build system, so that every Xen developer can reproduce >>>>> +the same findings. >>>> >>>> I am not sure I agree. I think it is good that each developper use their own version (so long it is supported), so they may be able to find issues that may not appear with 2.7. >>> Right now the reality is not that great: >>> - 2.8 version of cppcheck has bugs and Misra checking is not working >> >> Can you be more specifics for "bugs". Is it Xen specific? > > No it is not Xen specific (see [1] for more info) Thanks for the information. How about writing something like: " The minimum version required for cppcheck is 2.7. Note that at the time of writing (June 2022), the version 2.8 is known to be broken [1]. " [1] https://sourceforge.net/p/cppcheck/discussion/general/thread/bfc3ab6c41/?limit=25 Cheers, -- Julien Grall