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

Re: [PATCH] automation/eclair: deviate intentionally unreachable code


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Wed, 30 Jul 2025 16:32:03 +0200
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1753885923; h=DKIM-Signature:MIME-Version:Date:From:To:Cc:Subject:In-Reply-To: References:Message-ID:X-Sender:Organization:Content-Type: Content-Transfer-Encoding; bh=JGK+l6xNtCHiM7X+6nM8oDz/jcHuDDBSul6H9Pk32t0=; b=Ev71c6r+OT9B81zftsQkGBh6uqVU9muVNyzvZmeOKSY3KO78RVXhZlfSAYdBW8FmcsCz phwyTr2IiD6wSdXZbcLeCDrLFT0XnSg3dn0kHIsQ7Xz/X84rV5qhOKDwZ+914Svq0offO IM0eh5R0nCoZdg+XFq/wtNE7L/lCucC4VLDFIYArQHHTK31O930ERC0/xLH51l4ePB4zo jyMrtvbrmwFB2vzVnfElphT28rSv8IdwV36PEQlCmuTpaK2aon44G5Lvml0iqtz0EiUG7 Hp4ZejuP8ZoHohDxTFWLtB9WIFWelp40LPd2FkERqJbXxXzjH5cenXttudiXq4aApM6hS JLr0u0umSdssD/GM0NzQtNktvOJYCAfCca/mYZwmWpB27z6haNAJYAoQESoCQKjrBmDus KvlX+Gpx9akeiWwLGx2VBBvqyUvnt3AC/XI5X4joMaLCKT7L8Z0tBz16in7/upahOb7G7 Ig7fejJzkR3XPpi2BRz+sV/aeDALYMULRmA4NxiqF+fUgTwcEhKGA8UQEq982644TKUBV dA2GKksvA3bJe2dFUDdxCjlFHyBhRcufT5rLlo3HWP1KOtowq7fR5aAYU/Yc/efqnkMSX nrsn3s6UwSoho8tOG8529aaP9Bj7x2fyYJgBb5pBskuBbJFddfT39c45CgN9AZ0=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1753885923; b=zdv5kuXoVZqPDM9C2AGS0WHbg4i8TYKWeJPVxN6BUGSE4EOzR82ljgWn3D5CPwAtKlpd FcEN63G0T7oC1sEZRFHJ1HvI52Y9M0mYdj/WzsuTPEv/Dixl8dLgalQZgd+5K0wh4brMp Bnfeo28Tv6xfJ6lwvrhgnJA4epcMrlB4O9JGOk49oP/94j+l+/oqRIc+ljbzg1MeCKC7w KA6N5C0r/2V+oM5BBemkqpoYhl71G4xCTLHVLFFBJhQSvEg08TDkxj5iHMeotuMFuCsZG kUnkkxT/am3vXeK0jJeZRsdZFEaEVn2Dee0nrzcmJ/8twgh2YFLeMYf7fMIGJCMPqxHy4 AdPqCw7/D0af3yiATek4ud+Su6tXq71T4vMv2yLH0n5d+FWcnlowJDkguP+/bXOlm/GVR kovmL5V9qX1lEEG26rwMnlJqXqGKwOGfqCmrcIzxmxCs9B0BslUI7BnHOy20w4RAExy6U IXejV8yd4r/UxX7YCaYt/5vLt4i07KueP6JB0fBllsghSetIcJn2rgVAUmMlx4hrCRwe5 mG560603LkkCqtZdPql26ls29ZN5kUXTO9Ils7f4b+p/4Z4gzrEpNI3V6v1t1NhnJI1Xc Ksts+X45x9H/iR2aqhFlEYJDrPEZd2rL6G+FBv6N8L7UA9e7sB5p9bluuJPYoME=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 30 Jul 2025 14:32:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-07-30 16:15, Andrew Cooper wrote:
On 30/07/2025 3:06 pm, Dmytro Prokopchuk1 wrote:
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index e78179fcb8..fba75be2ee 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -86,6 +86,14 @@ Deviations related to MISRA C:2012 Rules:
        generate definitions for asm modules.
      - Tagged as `deliberate` for ECLAIR.

+   * - R2.1
+ - Calls to the `__builtin_unreachable` function inside the expansion of + the `ASSERT_UNREACHABLE()` macro may cause a function to be marked as + non-returning. Since this only happens in debug configurations, + the `noreturn` property for `__builtin_unreachable` is overridden in + these contexts, resulting in the absence of reports that do not have
+       an impact on safety, despite being true positives.
+

I'm not sure how best to phrase this, but it's probably worth saying
that Xen expects developers to write code which would fail safe in a
release build when the assertion was removed.

I.e. it's more than just "there may be code there".  It's expected that
there is.


Yes, I had some trouble finding the proper wording here, so feel free to improve it. It's just to highlight that the code would be truly unreachable in debug builds, so an assessor expecting violations there won't find them because of this configuration.

~Andrew

--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253



 


Rackspace

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