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

Re: [PATCH v2] docs/misra: add Rule 7.4 and 9.4


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 11 Jul 2023 09:26:40 +0000
  • Accept-language: en-GB, en-US
  • 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=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=CmPrWpP8E0VQmsh7J62o3XXi9X7B1nKDIKnDqgD7U18=; b=kMoj3PmMECQ3YUlmnzOuuHxP868G/kUuNy1QLItAcwE7P/+RRF810CYFAEp86fW+QbRg9jTbxw/ryiGZUYtPr+0EAKF6cZT8BwRGpAmlVzA+0zQbb4F2Rs5E+AzCFFgmR0HkOMKlS2NaaVn96WwNwK7dzCRqNKNIL7VDkFjP8KpOSsdepbEczFYBIDjhfxtSL6lJEO4y77hL6T7BW2VeJmqQMXWjPAvPsFMOB8kDaWUN/ox49IfgLceZ2Nwau8fL0Tf8CJ4bnuEVhLhcMMxVe9XY31imsYczBV2eFdRvby4JmA7amZelLmYT+/SllvCNmR+IsPYzQiwslAt+Vi5yzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGTjlpARXJkYqYDmy5ny8ldXDz0b0/Wiw/Xf2/anIeZLhQ+w+d1CYJdomf8pCHoTR31cYgzT3RDFeDFOMF7HtwfLLySTFq36PZZdlR0U3q4e+XOY0inCzSW9Bmqj8aGOGrlCoNfuqkNue8Bb/OuGw7mpg1EvSVD3965BcucUVzMKLFue9eHBiGetjcJRcyJSCSJ0qrwEqZJAdIpZlMJouI0o0rxBM3b4aONSv7oBTCjbH3V83VUNYfbqBw0sECcq+PDnITo/3iLf97Y0A3f8Q+Rrny6nw3mCT6t73V50oNNDzqieJuyvQy2W6DYU9Sgxpu/hupi01vAchRw3mA9XOQ==
  • 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>, Jan Beulich <jbeulich@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Tue, 11 Jul 2023 09:27:04 +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: AQHZs20uf0QgTgVHRk6JBQcFLVos0a+0TLIA
  • Thread-topic: [PATCH v2] docs/misra: add Rule 7.4 and 9.4


> On 10 Jul 2023, at 21:28, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> 
> Rule 9.4 is non-controversial and we have no violations.
> 
> Rule 7.4 is considered a good idea with the caveat that assigning a
> string literal to const void is allowed. I added a note to specify it.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> ---
> Changes in v2:
> - improve rule 7.4 note
> ---
> docs/misra/rules.rst | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> 
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 622f35410c..67ee8c029e 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -203,6 +203,15 @@ maintainers if you want to suggest a change.
>      - The lowercase character l shall not be used in a literal suffix
>      -
> 
> +   * - `Rule 7.4 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
> +     - Required
> +     - A string literal shall not be assigned to an object unless the
> +       objects type is pointer to const-qualified char

NIT: Should it be s/objects/object/ ?

> +     - All "character types" are permitted, as long as the string
> +       element type and the character type match. (There should be no
> +       casts.) Assigning a string literal to any object with type
> +       "pointer to const-qualified void" is allowed.
> +
>    * - `Rule 8.1 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_
>      - Required
>      - Types shall be explicitly specified
> @@ -275,6 +284,11 @@ maintainers if you want to suggest a change.
>        braces
>      -
> 
> +   * - `Rule 9.4 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_
> +     - Required
> +     - An element of an object shall not be initialized more than once
> +     -
> +
>    * - `Rule 12.5 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
>      - Mandatory
>      - The sizeof operator shall not have an operand which is a function
> -- 
> 2.25.1
> 
> 

Apart from that, I’ve used the file with our script to import the rules and it 
worked.

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>




 


Rackspace

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