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

Re: [PATCH] add more MISRA C rules to docs/misra/rules.rst


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 10 Jun 2022 17:54:51 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=2/HjZAoPu/UJkDRozx+9PbMjOL6X89wZ/5Jj0mzpoGw=; b=WKwchkz1qpAFXYTxZH5u+TNut3tioqZBWbsaHl0u4UR03P9tvrL2/gkJFdy86EOnPnJMbXoZbazeb0zAaU0vNE+9gxHAr8tocLqrXeMEotFujIwByMhMCg01OzloJlqxFnsuANh4Nmf/AFj/2yV/uYTaJaPzb9uqTpKads6rFCOkIe75fRAwTdeLSLmXCXEqAkY5Y4RU30TrrGuEGZT2LJAzMqB1Ioi2GDfEvmu5l9lFVg8RhwucZ/jz8J0+aigdNq7cdfJqKiNMwE/uYwD5OIjo11yr+R1jhF4v3wFSmFgoI/o7GZzrB91aPhYDalhU34Hgt51++4qdTN1VBQVtsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ALqAPiZgD3ZpJmwq0faFIoKCL/Zh5iREIAeu6FZBH+btpeFaA15g8bXj5gRWwWmGiaGVZDaRwfub1mNtibXaldzFUi7nukEpSHRKzUd7eZlNlFXjQ9cnKvfUlK4BxLD7N2EB6UDEuT0Puf+T2s2QQns24PjxlXletnqTH8mZj1/5e9wUeOEHHp3IbPoxFgcu+zu6I3Hc6WG9nYZJktHJGb2Sr35eJ6u8cxosAl1NTVo8ytt+rGTG2lNpE3qf1HzgY3iIC5Y5gabRGv8V/NqvBdcLrXRrSvijbObtCBdLQGhXXm8DGh3i9CMl3iY5kfLxcnCJ46YUXj8XZiCEthMuOg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, jbeulich@xxxxxxxx, George.Dunlap@xxxxxxxxxx, Artem_Mygaiev@xxxxxxxx, Andrew.Cooper3@xxxxxxxxxx, julien@xxxxxxx, Bertrand.Marquis@xxxxxxx
  • Delivery-date: Fri, 10 Jun 2022 15:55:10 +0000
  • Ironport-data: A9a23:pRKVKqgBFsgRlZvGKIFkSh39X161WhEKZh0ujC45NGQN5FlHY01je htvW2mAa/vfN2fzedBxOtm+pktV7J7Xz4diSApvpCgwHygb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXVrV4 YmaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YQAOJIqRsr4Xah9nOgB5PIAd2e/gDlHq5KR/z2WeG5ft69NHKRhseKE9pKNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuI4ehWhs7ixNNa+2i 84xcz1gYQ6GexRSElwWFIg/jKGjgXyXnzhw9wjL+vVrvjC7IApZ36fKc5mFKsCzTNx8vUmig mTWvGfAK0RPXDCY4X/fmp62vcfUhj/yUo8WELy+99ZpjUeVy2hVDwcZPXOrrP/8hkOgVtZ3L 00P5jFovaU07FasTNT2Q1u/unHslhwWVsdUEuY6wBqQ0aeS6AGcbkAtVCJMbesDpcA/RDE0/ lKRltavDjtq2JWXVHac+7G8vT60fy8PIgcqTyIeUREM5dWlhYgplw/OVf5qCqvzhdrwcQwc2 BiPpSk6wrkW08gC0vzh+Uid2m3w4J/UUgQy+wPbGHq/6R90b5KkYIru7kXH6fFHL8CSSVzpU GU4pvVyJdsmVfml/BFhis1UdF11z55p6AHhvGM=
  • Ironport-hdrordr: A9a23:ULUOlK4mgmPUy4/ykwPXwS6BI+orL9Y04lQ7vn2ZFiY+TiXIra uTdaogvSMc0AxhPk3Jmbi7WJVoMkmsjKKdgLNhS4tKOTOKhILGFvAH0WKP+VPd8k7Fh6dgPM VbAs9D4bTLZDQUsS+Q2njaLz9U+qjjzEnev5a9854Cd2BXQpAlyz08JheQE0VwSgUDL4E+Do Cg6s1OoCflUWgLb+ygb0N1FNTrlpnurtbLcBQGDxko5E2lljWz8oP3FBCew1M3Ty5P+7E/6m LI+jaJrJlL8svLhyM05VWjoKi+q+GRhOerMfb8xvT9ZA+cyzpAL74RI4Fq9ApF291Hrmxa2O Uk6i1QRfhb+jffeHq4rgDq3BSl2DEy62X6wVvdmnf7p9flLQhKfvapqLgpAScx0XBQzu2UEZ g7oV6xpt5SF1fNjS7979/HW1VjkVe1u2MrlaoWg2ZEWYUTZbdNpchHlXklZ6soDWb/8sQqAe NuBMbT6LJfdk6bdWnQui1qzMa3Vno+Ex+aSgwJu9CT0TJRgHdlpnFosPA3jzMF7tYwWpNE7+ PLPuBhk6xPVNYfaeZnCOIIUaKMexzwqNL3QROvyHjcZd060ij22uPKCZ0OlZ6XRKA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jun 09, 2022 at 05:48:26PM -0700, Stefano Stabellini wrote:
> Add the new MISRA C rules agreed by the MISRA C working group to
> docs/misra/rules.rst.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> 
> ---
> 
> I added the rules that we agreed upon this morning together with all the
> notes we discussed, in particular:
> 
> - macros as macro parameters at invocation time for Rule 5.3
> - the clarification of Rule 9.1
> - gnu_inline exception for Rule 8.10
> 
> 
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 6ccff07765..5c28836bc8 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -89,6 +89,28 @@ existing codebase are work-in-progress.
>         (xen/include/public/) are allowed to retain longer identifiers
>         for backward compatibility.
>  
> +   * - `Rule 5.2 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_02.c>`_
> +     - Required
> +     - Identifiers declared in the same scope and name space shall be
> +       distinct
> +     - The Xen characters limit for identifiers is 40. Public headers
> +       (xen/include/public/) are allowed to retain longer identifiers
> +       for backward compatibility.
> +
> +   * - `Rule 5.3 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_03.c>`_
> +     - Required
> +     - An identifier declared in an inner scope shall not hide an
> +       identifier declared in an outer scope
> +     - Using macros as macro parameters at invocation time is allowed,
> +       e.g. MAX(var0, MIN(var1, var2))

I think you want to use the {min,max}_t macros as examples, because
those do define local variables.

The rest LGTM:

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.



 


Rackspace

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