From nobody Fri Nov 22 07:05:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1718356580400387.6316380223766; Fri, 14 Jun 2024 02:16:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.740532.1147613 (Exim 4.92) (envelope-from ) id 1sI32C-0002Ln-Ki; Fri, 14 Jun 2024 09:15:48 +0000 Received: by outflank-mailman (output) from mailman id 740532.1147613; Fri, 14 Jun 2024 09:15:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sI32C-0002Lg-HW; Fri, 14 Jun 2024 09:15:48 +0000 Received: by outflank-mailman (input) for mailman id 740532; Fri, 14 Jun 2024 09:15:47 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sI32B-0002LY-Cl for xen-devel@lists.xenproject.org; Fri, 14 Jun 2024 09:15:47 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ae1600f4-2a2e-11ef-b4bb-af5377834399; Fri, 14 Jun 2024 11:15:45 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-82-58-35-96.retail.telecomitalia.it [82.58.35.96]) by support.bugseng.com (Postfix) with ESMTPSA id 41CEE4EE0756; Fri, 14 Jun 2024 11:15:44 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ae1600f4-2a2e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Simone Ballarin , Doug Goldstein , Stefano Stabellini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH v3] automation/eclair: add deviation for MISRA C Rule 17.7 Date: Fri, 14 Jun 2024 11:15:38 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718356582474100001 Content-Type: text/plain; charset="utf-8" Update ECLAIR configuration to deviate some cases where not using the return value of a function is not dangerous. Signed-off-by: Federico Serafini Acked-by: Stefano Stabellini --- Changes in v3: - removed unwanted underscores; - grammar fixed; - do not constraint to the first actual argument. Changes in v2: - do not deviate strlcpy and strlcat. --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++ docs/misra/deviations.rst | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 447c1e6661..97281082a8 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -413,6 +413,10 @@ explicit comment indicating the fallthrough intention = is present." -config=3DMC3R1.R17.1,macros+=3D{hide , "^va_(arg|start|copy|end)$"} -doc_end =20 +-doc_begin=3D"Not using the return value of a function does not endanger s= afety if it coincides with an actual argument." +-config=3DMC3R1.R17.7,calls+=3D{safe, "any()", "decl(name(__builtin_memcpy= ||__builtin_memmove||__builtin_memset||cpumask_check))"} +-doc_end + # # Series 18. # diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 36959aa44a..f3abe31eb5 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -364,6 +364,15 @@ Deviations related to MISRA C:2012 Rules: by `stdarg.h`. - Tagged as `deliberate` for ECLAIR. =20 + * - R17.7 + - Not using the return value of a function does not endanger safety i= f it + coincides with an actual argument. + - Tagged as `safe` for ECLAIR. Such functions are: + - __builtin_memcpy() + - __builtin_memmove() + - __builtin_memset() + - cpumask_check() + * - R20.4 - The override of the keyword \"inline\" in xen/compiler.h is present= so that section contents checks pass when the compiler chooses not to --=20 2.34.1