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

Re: [PATCH 1/2] docs/misra: introduce rules.rst


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 26 May 2022 13:04:58 +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=7jay3+7lyNDMyBDzDj/eGQXTyToY8fHMYY10srTpnBY=; b=JAq/PTFYBx3lJtBGh0NsXe0O3zyRGGq87Sf7a04qw5oxD4V/l6aBLWE5tFXrOJ/QOxtwn8YsICbSu4iXe0lAEMocH+MPKX7iiA2Qg2YO6s97lmDJy+gYHzlic7hX+CVZYc+OqQdYY44fUbVeLo5zrUPEes6c1JmkQfp9/JGB4u87j7DFkdBXdpQJm4KGGvRltEGGLtQoOdv98rKbnEtgX5WGLojBS0U3CQH7YVt68TQfu4mNK/zKQjJRAGAL54RYFIC5slepJ7pOmDjnrupDhQBaOWk7Myo+hCdputfS/MS5kGEnusyRXuNMXUL865XTrhL6aKIZXr1WCl7Ps86Tqw==
  • 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=7jay3+7lyNDMyBDzDj/eGQXTyToY8fHMYY10srTpnBY=; b=RQ73MFKATlijdIGlxOO7MmKY6M/Q1aIfyT2sD7gGSik/JS7WAomZkLuJD9wfBKtwC70wr2yjGnDdUUU7Amo5M2IQQgFKVjzrpJC4HMbtvJ5fyYgCULHpDN97Eyp1sXAeJQxCitt4ep/TX1YJxmtTzLpPWJiZlw0xwOJh/t1TNVLAmkFg/qPD8G/zGy5m4668TpB37n7idDrUSmF61g9RR6ULo1RdmEH0sNEixlCrFuq9xPoQ0OC5rvtCd34nCMQD3EZq2mSJ1NFcqPS9hZMHyBbqXhg65+dz25l9czjU3N042rjSSwrU7sKpx43oTzzvQBT8VGDeRqGNJdhG7OYXeQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=a+Li1gpV1JX4wx8Rl9pipUBBg9iyBXfA88gktk3+OipbniDDMws0hpkQ3mh/XCnt1xGVSnHP9JXsGxeeFUD5bB/bOZHv6eTA6sZRq+0K/qYGldOEd4b3kgJGd+0/aeafyhg+pUU8zFOwuwTW6vbAksAKOWVOGQ1oqjusMWutv2StG//pDIzIoFsHpiL+u+Ss7gs2vakHBl7AyOgbhYn6f/mcK5dycYKosaaSer3NUUW7YR5wJIP5PuG1f0gWtrZLYqHOzmOBR8sRlnnc4C34/NC18M9Bv+Ca8tcK+nin3o1Wc2LUQ38xQGbkpO24ObuUZID4RDvVxwAMpFAYT+AAJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGqQ/SMISuo5BXWNGl3VbmJL8bjcuhywdAnNLCjYOg/m/JUTKWGctxSJlTWkE2yRE9qxwStWqqB5J368NssQUdvgzLypd1Y1vfwHnh9UERVvlB7AYMn4khStYa8J6zkY5WklmcFj9ReBcFRfdGWYgTsE8VkjfaXdG00l6rpn1hv8FNbRSsGLV5jUr9jt1eae6o9GU/QFR5+JTeyGrBCI3s9vuTVKGoFY0yoLRmTbif3aplQOa2dfI/NiR0CSH//62VqhRrBBDDCIY0s+GL78TWXuaAg031AsdcsEhCOLGhFwSNzAyftsGFXredFAuK8/2OY3PlYnyZUAaUXiI3Y0ow==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "George.Dunlap@xxxxxxxxxx" <George.Dunlap@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 26 May 2022 13:05:28 +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: AQHYb89Ql1y5oYxB8EW1dQIiqL2u/a0vNXYAgAEjhQCAAJGbAIAAAxAAgAAFpwCAAC97AA==
  • Thread-topic: [PATCH 1/2] docs/misra: introduce rules.rst

Hi Jan,

> On 26 May 2022, at 11:15, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 26.05.2022 11:54, Bertrand Marquis wrote:
>> Hi Jan,
>> 
>>> On 26 May 2022, at 10:43, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> 
>>> On 26.05.2022 03:02, Stefano Stabellini wrote:
>>>> On Wed, 25 May 2022, Julien Grall wrote:
>>>>> On 25/05/2022 01:35, Stefano Stabellini wrote:
>>>>>> +- Rule: Dir 4.7
>>>>>> + - Severity: Required
>>>>>> + - Summary: If a function returns error information then that error
>>>>>> information shall be tested
>>>>>> + - Link:
>>>>>> https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_07.c
>>>>> 
>>>>> 
>>>>> ... this one. We are using (void) + a comment when the return is ignored 
>>>>> on
>>>>> purpose. This is technically not-compliant with MISRA but the best we can 
>>>>> do
>>>>> in some situation.
>>>>> 
>>>>> With your proposed wording, we would technically have to remove them (or 
>>>>> not
>>>>> introduce new one). So I think we need to document that we are allowing
>>>>> deviations so long they are commented.
>>>> 
>>>> Absolutely yes. All of these rules can have deviations as long as they
>>>> make sense and they are commented. Note that we still have to work out
>>>> a good tagging system so that ECLAIR and cppcheck can recognize the
>>>> deviations automatically but for now saying that they need to be
>>>> commented is sufficient I think.
>>>> 
>>>> So I'll add the following on top of the file:
>>>> 
>>>> """
>>>> It is possible that in specific circumstances it is best not to follow a
>>>> rule because it is not possible or because the alternative leads to
>>>> better code quality. Those cases are called "deviations". They are
>>>> permissible as long as they are documented with an in-code comment.
>>>> """
>>> 
>>> Hmm, so you really mean in-code comments. I don't think this will scale
>>> well (see e.g. the DCE related intended deviation), and it also goes
>>> against the "no special casing for every static analysis tool" concern
>>> I did voice on the call.
>> 
>> On this subject the idea was more to define a “xen” way to document
>> deviations in the code and do it in a way so that we could easily substitute
>> the “flag” to adapt it for each analyser using tools or command line options.
> 
> I think the basic scheme of something like this would want laying out
> before doc changes like the one here actually go in, so that it's clear
> what the action is if a new deviation needs adding for whatever reason
> (and also allowing interested people to start contributing patches to
> add respective annotations).

We will work on that but if we wait for everything to be solved we will
never progress.
I have a task on my side (ie at arm) to work on that and Luca Fancellu
will start working on it next month.
Now I do not think that this should block this patch, agreeing on rules does
not mean will respect all of them in the short term so we can wait a bit as I
definitely think that how to document violations in the code and in general
will be a work package on its own and will require some discussion.

Bertrand

> 
> Jan


 


Rackspace

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