From patchwork Thu Jun 20 09:07:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Zucchelli X-Patchwork-Id: 13705015 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 6B80BC27C79 for ; Thu, 20 Jun 2024 09:08:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744300.1151309 (Exim 4.92) (envelope-from ) id 1sKDmH-0001b7-15; Thu, 20 Jun 2024 09:08:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744300.1151309; Thu, 20 Jun 2024 09:08:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKDmG-0001b0-Ur; Thu, 20 Jun 2024 09:08:20 +0000 Received: by outflank-mailman (input) for mailman id 744300; Thu, 20 Jun 2024 09:08:19 +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 1sKDmF-0001au-Ii for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 09:08:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a1c8d708-2ee4-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 11:08:17 +0200 (CEST) Received: from delta.bugseng.com.homenet.telecomitalia.it (host-87-17-171-46.retail.telecomitalia.it [87.17.171.46]) by support.bugseng.com (Postfix) with ESMTPSA id 30ED64EE0738; Thu, 20 Jun 2024 11:08:15 +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: a1c8d708-2ee4-11ef-b4bb-af5377834399 From: Alessandro Zucchelli To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Alessandro Zucchelli , Simone Ballarin , Doug Goldstein , Stefano Stabellini Subject: [PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2 Date: Thu, 20 Jun 2024 11:07:36 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Rule 21.2 reports identifiers reserved for the C and POSIX standard libraries: or, and and xor are reserved identifiers because they constitute alternate spellings for the corresponding operators; however Xen doesn't use standard library headers, so there is no risk of overlap. This addresses violations arising from x86_emulate/x86_emulate.c, where label statements named as or, and and xor appear. No functional change. Signed-off-by: Alessandro Zucchelli Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 9fa9a7f01c..069519e380 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -498,6 +498,12 @@ still remain available." -config=MC3R1.R21.2,declarations+={safe, "!^__builtin_.*$"} -doc_end +-doc_begin="or, and and xor are reserved identifiers because they constitute alternate +spellings for the corresponding operators. +However, Xen doesn't use standard library headers, so there is no risk of overlap." +-config=MC3R1.R21.2,reports+={safe, "any_area(stmt(ref(kind(label)&&^(or|and|xor)$)))"} +-doc_end + -doc_begin="Xen does not use the functions provided by the Standard Library, but implements a set of functions that share the same names as their Standard Library equivalent. The implementation of these functions is available in source form, so the undefined, unspecified