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

Re: [PATCH v2] docs/misra: new rules addition


  • To: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 12 Jun 2023 11:50:32 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=H615CpVv+w/SpkQvGfcGh+cMYoDODlyezwbCeGvGAhM=; b=IT12K5O0Ci24p8qh9+6l5yrvCj8wJ0Fssra/3kI13oB4DqKN0tu751D6Tn6TflsJ0C8wh9Ca2A7sMMWiB8qahB8yPcNaY/kbpiAzixViW3xSFofvMLSXDM9jQQ366yQqgPrlSWmSyZcEHDyd3pU+X+A/S2ozx95PHxWoAcl3l3vf+ithLO+kSiNisaHbtJ64/TXfLlLj3kMRhyMsRTzVs0K80snfNx7coxxxtxiO9me9xmco/DtcdWU8KbGzB7JhMgIIiShjOlxmCsO+uqb4xXVf+wi8593dkhiQvIhBnWQ/YjM33t9gLRQ+BgM8zr3kJLSOJTQ9FX3n5+CckgqbIQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c1gbdWhzuHc11ddPK6QW7e1U6I7ecfwumu9tAsI7/MXjWvb/OiurnM7JzZiWIEZmAhoadbiGoNZ8uaM1/nyYnsA1VXtdmlUeOzdIBgeA1ATEowfcsqJKTIflxFrV8OqSw1riN6FqRIl6m4UPEmNBjURQBbZgNjaGp+S+U09+zt3xHLdfQrXc0ipRZJVCEdvQqxhhsj2k7pfD3H/W3HzovI5ANirRFHXrrrk40dEY98+1KQdZOFX59RCciVi7cCXOzaqUZW83sL6rIIK16U7pVNRljx4RQUbGjjeKuJns+KJ2Hj/Z4zAbMxrUs3iOU9k7TB/QKl4HQz301woWlilTeg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: julien@xxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, bertrand.marquis@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 12 Jun 2023 09:50:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.06.2023 11:34, Roberto Bagnara wrote:
> On 12/06/23 09:33, Jan Beulich wrote:
>> On 09.06.2023 19:45, Stefano Stabellini wrote:
>>> @@ -143,6 +163,12 @@ existing codebase are work-in-progress.
>>>        - Octal constants shall not be used
>>>        -
>>>   
>>> +   * - `Rule 7.2 
>>> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_02.c>`_
>>> +     - Required
>>> +     - A "u" or "U" suffix shall be applied to all integer constants
>>> +       that are represented in an unsigned type
>>> +     -
>>
>> I continue to consider "represented in" problematic here without
>> further qualification.
> 
> We should distinguish two things here.  The headline of Rule 7.2
> is non negotiable: it is simply as it is.

I understand this, and ...

>  As all headlines,
> it is a compromise between conciseness and mnemonic value.
> If what is wanted there is not the headline, then you can add
> "implicitly" before "represented".  Or you may leave the headline
> and add an explanatory note afterwards.

... such a note is what my comment was heading towards.

>>> @@ -314,6 +340,11 @@ existing codebase are work-in-progress.
>>>          used following a subsequent call to the same function
>>>        -
>>>   
>>> +   * - Rule 21.21
>>> +     - Required
>>> +     - The Standard Library function system of <stdlib.h> shall not be used
>>> +     -
>>
>> Still no "inapplicable" note (whichever way it would be worded to also
>> please Roberto)?
> 
> I am not the one to be pleased ;-)
> 
> But really, I don't follow: when you say the rule is inapplicable
> your reasoning is, IIUC, "nobody would even dream using system() in Xen".
> Which is exactly what the rule is asking.  If Xen adopts the rule,
> tooling will make sure system() is not used, and seeing that the rule
> is applied, assessors will be pleased.

My point is that "not using functions of stdlib.h" is ambiguous: It may
mean functions implemented in an external library (which the hypervisor
doesn't use), or it may mean functions of identical name (and purpose).
The full text goes even further and forbids the use of these
identifiers (plural; see next paragraph), so it's clearly not only
about an external library, and we also can't put it off as inapplicable.
(I wouldn't be surprised if we had a local variable or label named
"exit" or "abort".)

Btw - I can't find a rule 21.21 in my two (slightly different) copies
of the doc, nor one with this headline and a different number. What I
have is "21.8 The Standard Library functions abort, exit and system of
<stdlib.h> shall not be used". (I further wonder why neither of the two
docs allows me to copy-and-paste a line out of it.)

Jan



 


Rackspace

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