From patchwork Thu Jun 20 14:02: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: 13705586 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 36ED7C27C79 for ; Thu, 20 Jun 2024 14:02:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744609.1151684 (Exim 4.92) (envelope-from ) id 1sKIN2-00083w-SA; Thu, 20 Jun 2024 14:02:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744609.1151684; Thu, 20 Jun 2024 14:02:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKIN2-00083n-OA; Thu, 20 Jun 2024 14:02:36 +0000 Received: by outflank-mailman (input) for mailman id 744609; Thu, 20 Jun 2024 14:02:35 +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 1sKIN1-0007p2-2p for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 14:02:35 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bda636d8-2f0d-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 16:02:33 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 7F0E14EE0755; Thu, 20 Jun 2024 16:02:32 +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: bda636d8-2f0d-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 01/13] automation/eclair: consider also hypened fall-through Date: Thu, 20 Jun 2024 16:02:12 +0200 Message-Id: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718892030.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Update ECLAIR configuration to deviate MISRA C Rule 16.3 using different version of hypened fall-through and search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra/deviations.rst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index b8f9155267..b99a6b8a92 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -400,7 +400,7 @@ safe." -doc_end -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe." --config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"} +-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all[ -]?through.? \\*/.*$,0..2))))"} -doc_end -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch." diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 41cdfbe5f5..411e1fed3d 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -353,6 +353,10 @@ Deviations related to MISRA C:2012 Rules: However, the use of such comments in new code is deprecated: the pseudo-keyword "fallthrough" shall be used. - Tagged as `safe` for ECLAIR. The accepted comments are: + - /\* fall-through \*/ + - /\* Fall-through. \*/ + - /\* Fall-through \*/ + - /\* fall-through. \*/ - /\* fall through \*/ - /\* fall through. \*/ - /\* fallthrough \*/