[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] xen: Add MISRA support to cppcheck make rule
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Thu, 23 Jun 2022 07:23:02 +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=MzNd+DFQj7zzWXf4w12CX13CUGMp8yTcSkyDCfjEFec=; b=KgIaHG1Item6e467LIPHjOYwd+Z8OD6xUdfCRjwx9GA8TrpMhTctumv7EakTQElwVZBt1ubnTSeqry4WROvSmB5gigtqWeaZHCfm8m1xEo1lMab7In0vhZEWp5ebQaqUP09KxZu0BkT57tHG+vmC/wmno41lkjGv5sEG5DeumksVg/RyTf8kheQ6T9Lv3+RLxcnemK/pAC+Yqj+1F54h1lPB1Krov7nsjqwWn3NJu/E7lpo6Q6nvJ1swAFpIJaoJeGXzYv7Zeerc/PpocfaEh3/ROa8caZfzTS07JFq7cZ8fAz7xsSy7hd4bNNB0iZX2RP2j41mjyI+c8lqtG5+gRQ==
- 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=MzNd+DFQj7zzWXf4w12CX13CUGMp8yTcSkyDCfjEFec=; b=AXjSZ8bOuQRizIPQsHtbgMi7u2+YFzJQXGZMOWobxyx1oaM/Po9EUeoKLbgBGKZ8ahYNaws/QfZz5rS31Iv7D5Ag61X5CPihJO+qOIpSdsJPEjCroWnzRoCGmk9is3Eafh972D9N9dohqwJw7iQ+0gkYAQwmP2q2Ko+Cfghx+0aQ3sid09hsZQtkYYoKYtba2PPlNQQetqw+JR15VDnVh8oqh9pB7mH5aK8FUh9YhESIvTraTFNKPc8W4C3AO6oDkGnvKUsH6ywN7sAqI+kU83VZJ3fwwLyf8qYqo8jSItas11RgM03Er4pke+w8W5OFTse5/11sID9cDe/HakoUmw==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=IclGPQf6c9ddUt8tj199QjiQjjo6qIA1lFkj++60lxeqOxpacMvuO/TRiCo7PrD0gj+hrdz72cHzYpWNje767i7rESiWpmrJH1MhNpvLtxr/hMc+MefFFNKdi1XKPZiEp8905qRHEXjZVis4u/Qgup5f7tdw3fsMg8qNiRmS5isUk17Y73me+AyXC6sRBTqXQ4Ezr+tTpMdv+BIfT60MmsZqscNFOpx7tZSBq10h1PDo87vvo6wnGHJ0aETPp4D/2uxd09EhXw87nYeoYbOFCW3OmzhQluC+94pqDjfXwQpAbU6HPTQEgEFdJ7qRZ9ueY2n7fuNEoLXqLODnL70YLg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HzR1LQxkzOdsQrKTzdrSICMMTTdDL347ZPAdPvF/R1RpNH8sdAdTKxmsqP/kNbqMPsBVEkTc9YcwlajtfYqmON2eQbZP0gkU2gOhU9fyfj4XtX6DeRrc6P4hRXun6HVQ+G4FlL7IWCeXhK9BrpKTRksRbkFCIn8G2bn7YCtzBi7qNbVWIjuLU5Ily7sHtEJ1WLaSD4RomZie+EDfPRA1ZW2uwQ4R7g7EShtg6F9FWQiDTdXNbPAhZxXMgHOyP8TbNP9VW4Hr779+PL/9CVBTDwyXr3esamfNP6RHPacnyB5k3CLf/mJ2LfznjSgLGWjqwaTgkcEy3U3q1HFH6H6Img==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 23 Jun 2022 07:23:32 +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: AQHYfKpzLyGOfeb87kCDJ/BIB2eZQa1anOUAgACd+ACAANB4AIAAn3sA
- Thread-topic: [PATCH v3] xen: Add MISRA support to cppcheck make rule
Hi Stefano,
> On 22 Jun 2022, at 22:52, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>
> On Wed, 22 Jun 2022, Bertrand Marquis wrote:
>> Hi Stefano,
>>
>>> On 22 Jun 2022, at 01:00, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>>>
>>> On Fri, 10 Jun 2022, Bertrand Marquis wrote:
>>>> cppcheck MISRA addon can be used to check for non compliance to some of
>>>> the MISRA standard rules.
>>>>
>>>> Add a CPPCHECK_MISRA variable that can be set to "y" using make command
>>>> line to generate a cppcheck report including cppcheck misra checks.
>>>>
>>>> When MISRA checking is enabled, a file with a text description suitable
>>>> for cppcheck misra addon is generated out of Xen documentation file
>>>> which lists the rules followed by Xen (docs/misra/rules.rst).
>>>>
>>>> By default MISRA checking is turned off.
>>>>
>>>> While adding cppcheck-misra files to gitignore, also fix the missing /
>>>> for htmlreport gitignore
>>>>
>>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>>>
>>> Hi Bertrand,
>>>
>>> I tried this patch and I am a bit confused by the output
>>> cppcheck-misra.txt file that I get (appended.)
>>>
>>> I can see that there are all the rules from docs/misra/rules.rst as it
>>> should be together with the one line summary, but there are also a bunch
>>> of additional rules not present in docs/misra/rules.rst. Starting from
>>> Rule 1.1 all the way to Rule 21.21. Is the expected?
>>
>> To make cppcheck happy I need to give a text for all rules so the python
>> script is generating a dummy sentence for not declared Misra rules to
>> prevent cppcheck warnings. To make it simpler I just did it for 1 to 22 for
>> main and sub numbers.
>>
>> So yes this is expected.
>
> No problem about the dummy text sentence. My question was why are all
> those additional rules listed?
>
> If you see below, the first few rules from 2.1 to 20.14 are coming from
> docs/misra/rules.rst. Why are the other rules afterward from 1.1 to
> 21.21 listed and where are they coming from?
Those are dummy entries generated by the python script.
>
> Is it because all rules need to be listed? And the ones that are enabled
> are marked as "Required"?
If a rule is not listed in the file, cppcheck will give a warning.
>
> I take we couldn't just avoid listing the other rules (the ones not in
> docs/misra/rules.rst)?
I can but each cppcheck command will output a warning for each rule which has
no description in the generated file.
Cheers
Bertrand
|