From patchwork Fri Mar 1 15:04:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13578590 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 C6797C5478C for ; Fri, 1 Mar 2024 15:04:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.687720.1071475 (Exim 4.92) (envelope-from ) id 1rg4Qy-0008EX-Kh; Fri, 01 Mar 2024 15:04:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 687720.1071475; Fri, 01 Mar 2024 15:04:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rg4Qy-0008EQ-Hm; Fri, 01 Mar 2024 15:04:24 +0000 Received: by outflank-mailman (input) for mailman id 687720; Fri, 01 Mar 2024 15:04:23 +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 1rg4Qx-0008EK-OS for xen-devel@lists.xenproject.org; Fri, 01 Mar 2024 15:04:23 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fbe8bbf0-d7dc-11ee-a1ee-f123f15fe8a2; Fri, 01 Mar 2024 16:04:21 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.208.221.10]) by support.bugseng.com (Postfix) with ESMTPSA id 153D14EE0737; Fri, 1 Mar 2024 16:04:20 +0100 (CET) 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: fbe8bbf0-d7dc-11ee-a1ee-f123f15fe8a2 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 , Wei Liu Subject: [XEN PATCH] automation/eclair: add deviation for MISRA C:2012 Rule 16.6 Date: Fri, 1 Mar 2024 16:04:12 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Update ECLAIR configuration to take into account the deviations agreed during MISRA meetings. Signed-off-by: Federico Serafini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++ docs/misra/deviations.rst | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 02eae39786..0e62a7029f 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -378,6 +378,10 @@ explicit comment indicating the fallthrough intention is present." -config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"} -doc_end +-doc_begin="A switch statement with a single switch clause and no default label is deliberate and improves readability with respect to an equivalent if statement." +-config=MC3R1.R16.6,switch_clauses+={deliberate, "default(0)"} +-doc_end + # # Series 18. # diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 123c78e20a..041f8db4ee 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -322,6 +322,12 @@ Deviations related to MISRA C:2012 Rules: - /\* Fallthrough \*/ - /\* Fallthrough. \*/ + * - R16.6 + - A switch statement with a single switch clause and no default label is + deliberate and improves readability with respect to an equivalent if + statement. + - Tagged as `deliberate` for ECLAIR. + * - R20.7 - Code violating Rule 20.7 is safe when macro parameters are used: (1) as function arguments;