[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] docs/misra: add R17.2 and R18.2
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 17 Sep 2024 06:13:38 +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=arm.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=arcselector10001; 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=bfNqV2p8BMG5O6m2j7bfUHzy/n8uELaIv/sXp3O5RaA=; b=XWG/LYCfxDhvsmfH4RvyxDpPQy2wYUJcyPxOQhZLlQI9emK9wYoin9NJx9M5UvWoutmS+U0FMfxR16wvTuMJUJeVW1VTHELj37IQJrsF47+MTCVKpgFljRqbUfvrdf9QtEoE/CV5lTMy1ErHjn9JLqbQBMSbcarQ9iqNTblrFwcpgWcAoEHolKgOVm9veiubdpOyyV4yaReieyBOgt/BEioFkkkHJGo/ynnYEeAz/j6zv52dl736l7aLms3dyKz+7DEdK1lPt+b+XxiEvEbpyR2jn6Xtrpyt9ZqV5QwcaPnM8ihAmyet30viOl0tDt8bMp/dBQ+ddtbch7Y+bdbVsw==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bfNqV2p8BMG5O6m2j7bfUHzy/n8uELaIv/sXp3O5RaA=; b=bqV7QeJXOJMr/pNMgRSAeC6sol9yLQrgNBHFrODnbhKmiWMR0eFzt7MoEoJoeKKCy30kOJ4pwBkP0be7xyIpiTZ1J51q5S6Ks6CmbrTZdVeXD/CPzJ6+bXnW8ti5c76QbF1S31d6a/zBRzj7U2VZjMQPNpVGGm9w1VvZydrGQ2Tx8rKTP+1b5hwV6beqBgVQ/5dgi2+qaDFvfPH7o4rqtIamuvAechY2Yd9hwP6kF4ESSnQnWXIPTCJ0YBfYtrK1jvrzOM7CGwXTimZQ1GAxVCM41AQVSSYmp+t49hwDo0LbAUwT+4G7/9FEZDkm1zhbztOXkV6ngNL59jCPrMCKsQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=DDaul7AWmpQaQOiGofsFQ2iQph4M8SQiw5b4yjgCWBufsph6USQFafR467N+8Dwnf5jNwugVYSN4SJCsCDEl5ZQaIORQBW6NA0+I9u4ddOhtabwJHd8FtgiR+DEIF1Hmh4EL9W7kYdSpn6mWzRoyR36ikFyfeG1ZxsvcxOrbNz2eA8TkjM2nH/W/q2wA4g265stJXdfJDLeyXwm1wPrn/GXIMbK9XfKoG8QSABr7EVBZWR7IcvD7r9MCFeX0Ljqaw9I+DgJt70NKqwab2rqQrVVrY+lkoC5ysvEqe4ZWZ9lMC9PMtjyH4pxbUCRieGBDDxw//B4cEzxF2kNovUwg9A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AJyTZiTvUkMpESej8a9OszLbGePtliuVUge/1/XRATOBcdqquwl48sqAiLEEVpW7kljYT5ZWRVB3v/z2vxp9uni9/tcElBchVwD9jCjyhaA7V8ITHPCsXBfDTh48JWVeLXQztRdnXKw3BM+Fgo35pUqgf1MPVW7/wj2HUGsk+D7IB8W1gqm+n5pRtEVKNKlP9mARL9j/vheICsP1LrTPiEpbiHHcZFV4R+2zEc1MHcrjVXeE6+hwLyg8+i3Bzo8hr48okrhOcYxlDkUB0JosQD/rLU5MzxuZvobSc9EMR0QD03VeGOWQeMJbdb+Z3WJG7rHhE9OcyeM5t8QfjUQbzw==
- 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Tue, 17 Sep 2024 06:16:07 +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: AQHbCIyV13ovZBRQAUKHbnBglP2HvbJbgFMA
- Thread-topic: [PATCH] docs/misra: add R17.2 and R18.2
Hi Stefano,
> On 17 Sep 2024, at 01:02, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>
> The Xen community is already informally following both rules. Let's make
> it explicit. Both rules have zero violations, only cautions. While we
> want to go down to zero cautions in time, adding both rules to rules.rst
> enables us to immediately make both rules gating in the ECLAIR job part
> of gitlab-ci.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
>
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index e99cb81089..9acd92cf78 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -561,6 +561,12 @@ maintainers if you want to suggest a change.
> - The features of <stdarg.h> shall not be used
> -
>
> + * - `Rule 17.2
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_02.c>`_
> + - Required
> + - Functions shall not call themselves, either directly or indirectly
> + - Limited forms of recursion are allowed if the recursion is bound
> + (there is an upper limit and the upper limit is enforced)
NIT: . missing at the end.
Should we add a comment to say that the bounding needs to be explained in a
comment or in a deviation ?
> +
> * - `Rule 17.3
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_03.c>`_
> - Mandatory
> - A function shall not be declared implicitly
> @@ -593,6 +599,12 @@ maintainers if you want to suggest a change.
> submitting new patches please try to decrease the number of
> violations when possible.
>
> + * - `Rule 18.1
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_01.c>`_
> + - Required
> + - A pointer resulting from arithmetic on a pointer operand shall
> + address an element of the same array as that pointer operand
NIT: . missing at the end.
More than that i do not find the sentence quite clear.
How about: Pointer arithmetic on an array should only address elements in the
given array.
There might a better way to state that in english.
Or is this the "extract" from the misra rule directly ?
Cheers
Bertrand
> + -
> +
> * - `Rule 18.2
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
> - Required
> - Subtraction between pointers shall only be applied to pointers
|