From patchwork Fri May 3 09:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13652594 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 8FA18C25B4F for ; Fri, 3 May 2024 09:59:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.716316.1118419 (Exim 4.92) (envelope-from ) id 1s2pgt-0002F7-Gl; Fri, 03 May 2024 09:58:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 716316.1118419; Fri, 03 May 2024 09:58:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s2pgt-0002EG-DZ; Fri, 03 May 2024 09:58:55 +0000 Received: by outflank-mailman (input) for mailman id 716316; Fri, 03 May 2024 09:58:54 +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 1s2pgs-0002BX-Oq for xen-devel@lists.xenproject.org; Fri, 03 May 2024 09:58:54 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bef5dcdc-0933-11ef-b4bb-af5377834399; Fri, 03 May 2024 11:58:52 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-36-52-167.retail.telecomitalia.it [79.36.52.167]) by support.bugseng.com (Postfix) with ESMTPSA id EEE5F4EE074A; Fri, 3 May 2024 11:58:51 +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: bef5dcdc-0933-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [XEN PATCH 1/2] docs/misra: add Terms & Definitions section to rules.rst Date: Fri, 3 May 2024 11:58:43 +0200 Message-Id: <05d9d4b4319f28d602b7366f2964c451a3a50ce3.1714727807.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add a section for terms and definitions used by MISRA but expressed in terms of the C specification. Add a definition of "switch clause" to the newly-introduced section. Link the first use of the term "switch clause" in the document to its definition. Suggested-by: Jan Beulich Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- Jan you were not completely satisfied by the definition but I didn't find a better one. --- docs/misra/rules.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index b7b447e152..d3b70fdf04 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -489,8 +489,7 @@ maintainers if you want to suggest a change. * - `Rule 16.3 `_ - Required - - An unconditional break statement shall terminate every - switch-clause + - An unconditional break statement shall terminate every switch-clause_ - In addition to break, also other unconditional flow control statements such as continue, return, goto are allowed. @@ -712,3 +711,14 @@ maintainers if you want to suggest a change. - The value of a pointer to a FILE shall not be used after the associated stream has been closed - + +Terms & Definitions +------------------- + +.. _switch-clause: + +A *switch clause* can be defined as: +"the non-empty list of statements which follows a non-empty list of +case/default labels". +A formal definition is available within the amplification of MISRA C:2012 +Rule 16.1.