From nobody Fri Nov 22 08:22:19 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 1718346697107952.5945312985389; Thu, 13 Jun 2024 23:31:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.740400.1147481 (Exim 4.92) (envelope-from ) id 1sI0Sz-0001b9-34; Fri, 14 Jun 2024 06:31:17 +0000 Received: by outflank-mailman (output) from mailman id 740400.1147481; Fri, 14 Jun 2024 06:31:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sI0Sz-0001b2-0R; Fri, 14 Jun 2024 06:31:17 +0000 Received: by outflank-mailman (input) for mailman id 740400; Fri, 14 Jun 2024 06:31:16 +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 1sI0Sy-0001aw-9L for xen-devel@lists.xenproject.org; Fri, 14 Jun 2024 06:31:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b2641d6d-2a17-11ef-b4bb-af5377834399; Fri, 14 Jun 2024 08:31:14 +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 097F64EE0756; Fri, 14 Jun 2024 08:31:12 +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: b2641d6d-2a17-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 v2] automation/eclair: add deviation for MISRA C Rule 17.7 Date: Fri, 14 Jun 2024 08:31:05 +0200 Message-Id: <5d4294f9a33cd647b6365614d88665b19a89d62b.1718346542.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718346698134100001 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 --- 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 do not endanger saf= ety if it coincides with the first 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..2a10de5a66 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 do not endanger safety if = it + coincides with the first 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