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

Re: [PATCH] docs/misra: Add instructions for cppcheck


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 24 Jun 2022 13:34:14 +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=t2Qn+jG3krrZu6rweNVUSTRPzv5l48WUrKJdU/Z1VZs=; b=VDgsE+S/PEFXLmyeyyTgzJHCS5UuxFDV6F5WnC3Y4mQrMTX2eNKjPHUCue9nN3cltjZPIa3cUQiPjyUZ8xX7XFgwehp12UlAfpCkPzhdzEvgDDsRvTPgiJmHig4FmXFADKnR2+d87S8o8KqgOjMfCpX5NIm2xgrDw+wkdqysrc+OurqJptVjjLVtB1i+i1TfZd+qqSNSb4g79jD6xLqUyT78HBMWCr8doTvG+oveLy8w/P6Hbdro4ha4Jxvp8DI4r2zLEfncKcW3HhXsg+lTCWbWsOT2JJCO0CEvmnGHJbXmis/S6D1MtMqrJSWp6LvyWahbJrCtDFUVpKMLs/pBXA==
  • 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=t2Qn+jG3krrZu6rweNVUSTRPzv5l48WUrKJdU/Z1VZs=; b=XKMQ89nhit8faPTJ9kmq88DAFNCQ6X3iHUHX2ECUCwhrFnIZZH0nc3YculrFeMkEjmhD8egMeg7+foXQJeFPL3FRhY5y9hhM6I1DSreHoyBsM9AgS+Y/9GmGQfMgsjAFI7d0cSZrJaLM8bvZNmeS3I+ph6LKTKwu0t69ucJGAMHBGCSVNpZYrYndVAo8fr5M1D4Ncb6GwglSP8eLbTJgc4512MUAngaed5z3blc3kLtex89Ek28+0SJ7+TXD58pEb6WfckvH3Rt6YFiP9EX5Wa42/rYI+BE5ToBI80rtoa4U52wBjgWLCikYG9WkYU8V10VFrmze1fCAJPYCZNrUrQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=dKtGKVQMJ5jlTScw8XhuP2vkbzJBljMDmS6KJbc1gviu+PCZkYIOq8J1Ry7IAOLSFN2o9C7NCTNi8AJM8+PDJN4YKWeCR78GyNFvWOjwXijxEsngXQezF9zobhW/BCsR1NfGdum4Xex8o9eMI2TOeCKer3DyYB/0kugGBbvPoSH5A2RxIUx0XKkLFf+5ftQvyT2/yatnpV8oLfYYZLubOkiO2lG7c6V3biUFG0hl7vQxPRYSkMZnjQMxW9XSbYuiy3JUbp57sxwDKLjKGQOV8QVwoCLWlWZq7h6gv389DoHVfPqSCQrOo6dyF4inRH0YbWZgjFn88MSI+BlDYDWquA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mBdW4NgddW0ESM8fyd7/VlfeKlEW1mVjijoyKr1Zbj34bAbxi3X3DXKE6y/IvTLD5s2aj/Yd64w5b8ZtCD/emti2MKYMbiiqR8GmY3fF+ebm8mv0eptunWY703SGhjUhBFEgFsRFSO1SYDFUCfRycJi+Vkna+ejyEr7yu/NkFFckbSe6ukddkJcBWCbCJKlRFRDWkUNpgR8zX8o38g4rXMAUPouXuQUzpCDkLrYjVSa22oho/R3lm1wKNPwp/WB1EJgqAL6Tdz6BdOxW0kpHrW12J1MQj6K8vsvn29UErMzqqzDUp8bewg1dZrLT3R7qAuEbVbWSEDdQPwzsaC1oGw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 24 Jun 2022 13:34:47 +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: AQHYh7nJHM8+T3fZ/0Gr0RGCgDxGeq1eaYGAgAALcICAAARSgIAAFXiA
  • Thread-topic: [PATCH] docs/misra: Add instructions for cppcheck


> On 24 Jun 2022, at 13:17, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 24/06/2022 13:01, Luca Fancellu wrote:
>> Hi Julien,
> 
> Hi Luca,
> 
>>>> +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.
>> Yes I understand, but as Bertrand says, other version of this tool doesn’t 
>> work quite well. 
> 
> I have replied to this on Bertrand e-mail.
> 
> 
>> I agree that everyone should use their own version, but for the sake of 
>> reproducibility
>> of the findings, I think we should have a common ground.
> 
> I will reply to this below.
> 
>> The community can however propose from time to time to bump the version as 
>> long as we can say it works (maybe
>> crossing the reports between cppcheck, eclair, other proprietary tools).
> 
> This would mean we should de-support 2.7 which sounds wrong if it worked 
> before.

Sure, I guess that as long as we don’t see regressions from version X to X+1 we 
are fine with versions >= X.

>>> 
>>>> +
>>>> +Install cppcheck in the system
>>> 
>>> NIT: s/in/on/ I think.
>> Sure will fix
>>> 
>>>> +==============================
>>>> +
>>>> +Cppcheck can be retrieved from the github repository or by downloading the
>>>> +tarball, the version tested so far is the 2.7:
>>>> +
>>>> + - https://github.com/danmar/cppcheck/tree/2.7
>>>> + - https://github.com/danmar/cppcheck/archive/2.7.tar.gz
>>>> +
>>>> +To compile and install it, here the complete command line:
>>>> +
>>>> +make MATCHCOMPILER=yes \
>>>> + FILESDIR=/usr/share/cppcheck \
>>>> + CFGDIR=/usr/share/cppcheck/cfg \
>>>> + HAVE_RULES=yes \
>>>> + CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" \
>>>> + install
>>> 
>>> Let me start that I am not convinced that our documentation should explain 
>>> how to build cppcheck.
>>> 
>>> But if that's desire, then I think you ought to explain why we need to 
>>> update CXXFLAGS (I would expect cppcheck to build everywhere without 
>>> specifying additional flags).
>> Yes you are right, this is the recommended command line for building as in 
>> https://github.com/danmar/cppcheck/blob/main/readme.md section GNU make, I 
>> can add the source.
> 
> I think we should remove the command line and tell the user to read the 
> cppcheck README.md.

Ok sounds good to me

> 
>> My intention when writing this page was to have a common ground between Xen 
>> developers, so that if one day someone came up with a fix for something, we 
>> are able to reproduce
>> the finding all together.
> Well, if someone find a fix you want to check against all versions not the 
> one that warns. Otherwise, you can end up in a situation where you silence 
> cppcheck 2.10 (just making up a version) but then introduce a warning in 
> cppcheck 2.7.
> 
> To me this is no different than other software used to build Xen. We don't 
> tell the user that they should always build with GCC x.y.z. Instead, we 
> provide a minimum version. This has multiple benefits:
> 1) The user doesn't need to rebuild the software and can use the one provided 
> by the distributions
> 2) Different versions find different (most of the time) valid bugs. So we are 
> getting towards a better codebase.
> 

Ok I see your point, instead of saying “we use version X.Y, I will say >=X.Y”, 
your comment on Bertrand’s reply is on this line.

I would keep the section about compiling cppcheck since many recent distro 
doesn’t provide cppcheck >=2.7 yet (and 2.8 is broken),
If you agree with it.

For this one:
> 
> 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
> 
> 

Sure, I can add it and rephrase that section.

Cheers,
Luca



 


Rackspace

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