From: Jan Beulich <jbeulich@suse.com>
To: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
Cc: consulting@bugseng.com,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: address violation of MISRA C Rule 11.1
Date: Wed, 11 Dec 2024 12:17:15 +0100 [thread overview]
Message-ID: <bded3d90-0644-46c2-a43e-d6b06faa5650@suse.com> (raw)
In-Reply-To: <7debd63f3900bad62bcbcc03081e4c04e6099135.1733914487.git.alessandro.zucchelli@bugseng.com>
On 11.12.2024 12:02, Alessandro Zucchelli wrote:
> Rule 11.1 states as following: "Conversions shall not be performed
> between a pointer to a function and any other type".
>
> Functions "__machine_restart" and "__machine_halt" in "x86/shutdown.c"
> and "halt_this_cpu" in "arm/shutdown.c" are defined as noreturn
> functions and subsequently passed as parameters to function calls.
> This violates the rule in Clang, where the "noreturn" attribute is
> considered part of the function"s type.
I'm unaware of build issues with Clang, hence can you clarify how Clang's
view comes into play here? In principle various attributes ought to be
part of a function's type; iirc that's also the case for gcc. Yet how
that matters to Eclair is still entirely unclear to me.
> By removing the "noreturn"
> attribbute and replacing it with uses of the ASSERT_UNREACHABLE macro,
> these violations are addressed.
Papered over, I'd say. What about release builds, for example?
Deleting the attribute also has a clear downside documentation-wise. If
we really mean to remove them from what the compiler gets to see, I think
we ought to still retain them in commented-out shape.
Jan
next prev parent reply other threads:[~2024-12-11 11:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 11:02 [PATCH] xen: address violation of MISRA C Rule 11.1 Alessandro Zucchelli
2024-12-11 11:17 ` Jan Beulich [this message]
2024-12-12 2:27 ` Stefano Stabellini
2024-12-12 10:32 ` Jan Beulich
2024-12-13 0:53 ` Stefano Stabellini
2024-12-13 10:08 ` Jan Beulich
2024-12-13 14:02 ` Alessandro Zucchelli
2024-12-13 21:34 ` Stefano Stabellini
2024-12-16 7:26 ` Jan Beulich
2024-12-18 11:16 ` Stefano Stabellini
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=bded3d90-0644-46c2-a43e-d6b06faa5650@suse.com \
--to=jbeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=alessandro.zucchelli@bugseng.com \
--cc=andrew.cooper3@citrix.com \
--cc=bertrand.marquis@arm.com \
--cc=consulting@bugseng.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--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.