From: Jan Beulich <jbeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
george.dunlap@citrix.com, bertrand.marquis@arm.com,
roberto.bagnara@bugseng.com, nicola.vetrini@bugseng.com,
Stefano Stabellini <stefano.stabellini@amd.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] docs/misra: add 14.3
Date: Fri, 8 Sep 2023 08:12:57 +0200 [thread overview]
Message-ID: <6f865f65-9c3d-94c5-e3d4-86365feeeb65@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2309071441400.6458@ubuntu-linux-20-04-desktop>
On 07.09.2023 23:45, Stefano Stabellini wrote:
> On Thu, 7 Sep 2023, Jan Beulich wrote:
>> On 07.09.2023 03:22, Stefano Stabellini wrote:
>>> @@ -385,6 +386,17 @@ maintainers if you want to suggest a change.
>>> - A loop counter shall not have essentially floating type
>>> -
>>>
>>> + * - `Rule 14.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_14_03.c>`_
>>> + - Required
>>> + - Controlling expressions shall not be invariant
>>> + - Due to the extensive usage of IS_ENABLED, sizeof compile-time
>>> + checks, and other constructs that are detected as errors by MISRA
>>> + C scanners, managing the configuration of a MISRA C scanner for
>>> + this rule would be unmanageable. Thus, this rule is adopted with
>>> + a project-wide deviation on if ?: and switch statements.
>>
>> Do we want to go as far as permitting this uniformly for all switch()? In
>> my earlier reply I had included sizeof() for a reason.
>
> I agree with you that it would be better to restrict it to only some
> switch uses, rather than all of them.
>
> But if we are going to restrict the deviation to switch(sizeof()), which
> I think is a good idea and I am in favor, wouldn't it be better to
> handle these cases as individual deviations? E.g. docs/misra/safe.json?
> I am assuming there are only few cases like that and adding it here
> makes the rule more complicated.
Personally I think it wants to be both anyway. For one, anything written
here still needs respective SAF annotations for scanners to be uniformly
aware (dealing with deviations in just the Eclair configuration is imo
dubious). And then my general view is that by stating patterns here we
make clear that we tolerate new instances of such constructs, whereas in
other cases we'd be aiming at no deviations in new code.
Jan
next prev parent reply other threads:[~2023-09-08 6:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 1:22 [PATCH v2] docs/misra: add 14.3 Stefano Stabellini
2023-09-07 7:12 ` Jan Beulich
2023-09-07 21:45 ` Stefano Stabellini
2023-09-08 6:12 ` Jan Beulich [this message]
2023-09-08 9:02 ` Nicola Vetrini
2023-09-08 20:27 ` Stefano Stabellini
-- strict thread matches above, loose matches on Subject: below --
2023-08-31 1:53 Stefano Stabellini
2023-08-31 9:28 ` Jan Beulich
2023-09-07 1:21 ` Stefano Stabellini
2023-09-07 6:45 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6f865f65-9c3d-94c5-e3d4-86365feeeb65@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=bertrand.marquis@arm.com \
--cc=george.dunlap@citrix.com \
--cc=julien@xen.org \
--cc=nicola.vetrini@bugseng.com \
--cc=roberto.bagnara@bugseng.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=stefano.stabellini@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.