From patchwork Thu Jun 13 09:07:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13696462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64DAEC27C4F for ; Thu, 13 Jun 2024 09:07:40 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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=MC3R1.R17.1,macros+={hide , "^va_(arg|start|copy|end)$"} -doc_end +-doc_begin="Not using the return value of a function do not endanger safety if it coincides with the first actual argument." +-config=MC3R1.R17.7,calls+={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. + * - 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