From nobody Mon Nov 25 00:27:00 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 171826966498298.59067539985585; Thu, 13 Jun 2024 02:07:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.739723.1146658 (Exim 4.92) (envelope-from ) id 1sHgQb-0007fw-1L; Thu, 13 Jun 2024 09:07:29 +0000 Received: by outflank-mailman (output) from mailman id 739723.1146658; Thu, 13 Jun 2024 09:07:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sHgQa-0007fo-UH; Thu, 13 Jun 2024 09:07:28 +0000 Received: by outflank-mailman (input) for mailman id 739723; Thu, 13 Jun 2024 09:07:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sHgQZ-0007fI-A7 for xen-devel@lists.xenproject.org; Thu, 13 Jun 2024 09:07:27 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5aa6ba75-2964-11ef-90a3-e314d9c70b13; Thu, 13 Jun 2024 11:07:26 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.79.104]) by support.bugseng.com (Postfix) with ESMTPSA id 5EFCE4EE0756; Thu, 13 Jun 2024 11:07:25 +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: 5aa6ba75-2964-11ef-90a3-e314d9c70b13 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] automation/eclair: add deviation for MISRA C Rule 17.7 Date: Thu, 13 Jun 2024 11:07:11 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718269667059100001 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 --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++ docs/misra/deviations.rst | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 447c1e6661..7bae804569 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||strlcat||strlcpy))"} +-doc_end + # # Series 18. # diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 36959aa44a..0bbac3cb9a 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -364,6 +364,17 @@ 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() + - strlcat() + - strlcpy() + * - 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