All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
	xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
	consulting@bugseng.com, andrew.cooper3@citrix.com,
	roger.pau@citrix.com, George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH 0/4] address MISRA C:2012 Rule 15.2
Date: Tue, 07 Nov 2023 12:10:30 +0100	[thread overview]
Message-ID: <61648922e51442f7ccaf10ccbc1e0dd2@bugseng.com> (raw)
In-Reply-To: <88e164aa-4b7f-d86e-3ee6-0f720dcd21ed@suse.com>

On 2023-11-07 11:52, Jan Beulich wrote:
> On 07.11.2023 11:33, Nicola Vetrini wrote:
>> This series is aimed at presenting some strategies that can be used to 
>> deal with
>> violations of Rule 15.2:
>> "The goto statement shall jump to a label declared later in the same 
>> function".
> 
> I don't recall this rule being discussed on any of the meetings.
> 

This series is aimed mainly at collecting opinions on the possible 
resolution strategies,
and based on the feedback decide what to focus the discussion on in the 
meetings.

>> The rule's rationale is about possible developer confusion, therefore 
>> it could
>> be argued that there is no substantial gain in complying with it, 
>> given the
>> torough review process in place.
> 
> To be honest, forward goto have potential of developer confusion as 
> well: All
> other entities need to be declared / defined before they can be used. 
> Just
> labels don't. (Or have I missed any other outlier?) IOW if I saw Misra 
> make
> any rule here, I think it ought to suggest to avoid using "goto" 
> altogether.
> 
> Jan

There is Rule 15.1 that says precisely that "do not use goto", but it's 
advisory and has never been proposed
(there are likely hundreds of violations, and some are perhaps 
legitimate uses of goto).
MISRA says that, if 15.1 is not followed, then a constrained use of goto 
is regulated by subsequent
rules 15.2 and 15.3.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


  reply	other threads:[~2023-11-07 11:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 10:33 [RFC PATCH 0/4] address MISRA C:2012 Rule 15.2 Nicola Vetrini
2023-11-07 10:33 ` [RFC PATCH 1/4] xen/vsprintf: replace backwards jump with loop Nicola Vetrini
2023-11-07 11:36   ` Andrew Cooper
2023-11-21 13:52     ` Jan Beulich
2023-11-07 10:33 ` [RFC PATCH 2/4] x86/dom0: make goto jump forward Nicola Vetrini
2023-11-21 13:57   ` Jan Beulich
2023-11-07 10:33 ` [RFC PATCH 3/4] xen/arm: GICv3: address MISRA C:2012 Rule 15.2 Nicola Vetrini
2023-11-07 12:34   ` Julien Grall
2023-11-07 10:33 ` [RFC PATCH 4/4] automation/eclair: add deviation for certain backwards goto Nicola Vetrini
2023-11-07 12:44   ` Julien Grall
2023-11-07 14:45     ` Nicola Vetrini
2023-11-07 17:35       ` Julien Grall
2023-11-08 10:10         ` Nicola Vetrini
2023-11-07 10:52 ` [RFC PATCH 0/4] address MISRA C:2012 Rule 15.2 Jan Beulich
2023-11-07 11:10   ` Nicola Vetrini [this message]
2023-11-21 14:41 ` Nicola Vetrini

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=61648922e51442f7ccaf10ccbc1e0dd2@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=cardoe@cardoe.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=simone.ballarin@bugseng.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /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.