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

Re: [PATCH] docs/misra: adds Mandatory rules


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 22 May 2023 15:13:31 +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=+dMpDnEtIqS+4ZqN9Ar8dOyygSGAkVUmErcE18V8Wik=; b=NiLQp39EJn7dqfccnwO3usiyARqa96qQnxD1k7FWkgkdAICCxFLMSCRgZ/QL3zDibhl/uXLSH8LH1BfZUUWr2MXYgqWVwPCftq+VF8WR4g1MjMwYO4Lo9m0K4rrLGaf/yawBBdkh1tedZNmgifTZE/lEnD9fJBfJZ9dJZelYk+iwDUmVqCEhak55WHRdcbN1fN8Y9N5Wp+3LsjAWytXI9shSrDT9aHcAQuQZKj29j46YOSf35agiVaWVW19t+Nb3N0UTCT2sESUob6L8ztUJM1a/S5vtJySWWmAMfdjs0v5hgTghjbSZrhbcDqZMshCzfupYxBLH04qGiMG4hkRLkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PmStE4ngD+jbDetzy13gtNKppGWocF1ufjKykr1c2KPEAwQbl7PIB2qpbNzlPsGDXXzrgqGayfVGlGoNbft0hk2f21VQ1z+dCEZYAqEnFx67r2Q0Mv/DlDIOjxUooXYqt3idrEbrqzJcHRAM/BlmyhzKFZkBAWAYE60A6D7b/T/Uy5gNcR2ij911bm8v4R1HZ60cckZdwTAaPJIZA576jlRRaavWmIvZnNfyd26vHxX7nodVEV5xyxd4lWkgyoY8fs7YwYpJy8mwl55l0V84WM3FJrc4QXsHJlAFgWx2oy3bWwt8iYR/dheDTqpcf46oGWJvsT+oLQ5OXCWVRpgZQQ==
  • 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 Cooper <andrew.cooper3@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Mon, 22 May 2023 15:14:09 +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: AQHZhF+CDPpocrDIxEOFvzb4c9SB5a9mdySA
  • Thread-topic: [PATCH] docs/misra: adds Mandatory rules

Hi Stefano,


> On 12 May 2023, at 01:22, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> 
> Add the Mandatory rules agreed by the MISRA C working group to
> docs/misra/rules.rst.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>

Acked-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> docs/misra/rules.rst | 62 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
> 
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 83f01462f7..d5a6ee8cb6 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -204,6 +204,12 @@ existing codebase are work-in-progress.
>        braces
>      -
> 
> +   * - `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
> +       parameter declared as "array of type"
> +     -
> +
>    * - `Rule 13.6 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_06.c>`_
>      - Mandatory
>      - The operand of the sizeof operator shall not contain any
> @@ -274,3 +280,59 @@ existing codebase are work-in-progress.
>        in the same file as the #if #ifdef or #ifndef directive to which
>        they are related
>      -
> +
> +   * - `Rule 21.13 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_13.c>`_
> +     - Mandatory
> +     - Any value passed to a function in <ctype.h> shall be representable as 
> an
> +       unsigned char or be the value EOF
> +     -
> +
> +   * - `Rule 21.17 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_17.c>`_
> +     - Mandatory
> +     - Use of the string handling functions from <string.h> shall not result 
> in
> +       accesses beyond the bounds of the objects referenced by their pointer
> +       parameters
> +     -
> +
> +   * - `Rule 21.18 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_18.c>`_
> +     - Mandatory
> +     - The size_t argument passed to any function in <string.h> shall have an
> +       appropriate value
> +     -
> +
> +   * - `Rule 21.19 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_19.c>`_
> +     - Mandatory
> +     - The pointers returned by the Standard Library functions localeconv,
> +       getenv, setlocale or, strerror shall only be used as if they have
> +       pointer to const-qualified type
> +     -
> +
> +   * - `Rule 21.20 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_20.c>`_
> +     - Mandatory
> +     - The pointer returned by the Standard Library functions asctime ctime
> +       gmtime localtime localeconv getenv setlocale or strerror shall not be
> +       used following a subsequent call to the same function
> +     -
> +
> +   * - `Rule 22.2 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_02.c>`_
> +     - Mandatory
> +     - A block of memory shall only be freed if it was allocated by means of 
> a
> +       Standard Library function
> +     -
> +
> +   * - `Rule 22.4 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_04.c>`_
> +     - Mandatory
> +     - There shall be no attempt to write to a stream which has been opened 
> as
> +       read-only
> +     -
> +
> +   * - `Rule 22.5 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_05.c>`_
> +     - Mandatory
> +     - A pointer to a FILE object shall not be dereferenced
> +     -
> +
> +   * - `Rule 22.6 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_06.c>`_
> +     - Mandatory
> +     - The value of a pointer to a FILE shall not be used after the 
> associated
> +       stream has been closed
> +     -
> -- 
> 2.25.1
> 




 


Rackspace

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