From nobody Sun May 19 04:55:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1683847412; cv=none; d=zohomail.com; s=zohoarc; b=dP80BpQkWSoZx8g/inZj4vGCNXXBELg5BcmAJkO2xvI720RrV3T54L1Vcbz4iyKksDW4qXBeWOFY7hoC1epMuVwTO0dVb6j7eM0BkQlQSUoUnk0k7ZO2RtBi06slUuL2kaeT+u0ZxnFn9PsiHyuuOGbHJDTA1VcV2IjkCuDLG5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683847412; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=4Pl17PI1t4oOoGRFLpu+b6VGx9SIj5E27j5bVSRccl8=; b=Xhc7j7qei0iMsw68f7ObRmbfzSX+dpG1bffeefCcdPgpbCu2AdDnyWlRohazFjgkoWS2IyePRj9VPpSOcE4PAxJGEvmUuK2dx4nQmKgjZ4iVBEjIMa6yeJ6u6GNWD8GDrJ5fr6I7En1vyxNUPy0vGao4FLzBNRco+YBjY5C049o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16838474129841003.626365025722; Thu, 11 May 2023 16:23:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533662.830488 (Exim 4.92) (envelope-from ) id 1pxFcT-0008Uc-Ln; Thu, 11 May 2023 23:22:45 +0000 Received: by outflank-mailman (output) from mailman id 533662.830488; Thu, 11 May 2023 23:22:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pxFcT-0008UV-IK; Thu, 11 May 2023 23:22:45 +0000 Received: by outflank-mailman (input) for mailman id 533662; Thu, 11 May 2023 23:22:44 +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 1pxFcS-0008UP-N2 for xen-devel@lists.xenproject.org; Thu, 11 May 2023 23:22:44 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ba26587c-f052-11ed-b229-6b7b168915f2; Fri, 12 May 2023 01:22:42 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8C56065283; Thu, 11 May 2023 23:22:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE4F9C433D2; Thu, 11 May 2023 23:22:39 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ba26587c-f052-11ed-b229-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683847361; bh=fm56nYRPn8WoeCpx9USW1lPIRzH1T19T/S8+YXGvkn0=; h=From:To:Cc:Subject:Date:From; b=HF65XH8mKAPt4SOhO1tBxNFaOBqLVkppKVQ1I1ItoLkK5SvQA959/iCwyHeKBRQUo E1Quahst0Dj1SYHf9W3KHxvXrLGZPAA/lIR9V1HWiknMYBjv0aES79TgnK0hCDl/Zn Du7hMk+wDTW04yNdmOE7aqoxKyirlX+LiMXsVqBz9g3yk5bX3SSwMxIzPJewA6o+Yx a4ajwIOVBS4gwmQKo5pVyvKf7W5tRm8djM8t7GmW4jUeUQPhwSFw9SNIxcARJUJTeq TcuDx/i+K3OQgOOB9CautTkCX9nskijwsGPII+hgyfrfQEiyCbnfUOS7JdtmWJikYU O5yNwNsi4f5dw== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Bertrand.Marquis@arm.com, julien@xen.org, sstabellini@kernel.org, Stefano Stabellini Subject: [PATCH] docs/misra: adds Mandatory rules Date: Thu, 11 May 2023 16:22:37 -0700 Message-Id: <20230511232237.3720769-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1683847414940100001 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Add the Mandatory rules agreed by the MISRA C working group to docs/misra/rules.rst. Signed-off-by: Stefano Stabellini Acked-by: Bertrand Marquis Acked-by: Jan Beulich Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu --- docs/misra/rules.rst | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 83f01462f7..d5a6ee8cb6 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -204,6 +204,12 @@ existing codebase are work-in-progress. braces - =20 + * - `Rule 12.5 `_ + - Mandatory + - The sizeof operator shall not have an operand which is a function + parameter declared as "array of type" + - + * - `Rule 13.6 `_ - Mandatory - The operand of the sizeof operator shall not contain any @@ -274,3 +280,59 @@ existing codebase are work-in-progress. in the same file as the #if #ifdef or #ifndef directive to which they are related - + + * - `Rule 21.13 `_ + - Mandatory + - Any value passed to a function in shall be representable = as an + unsigned char or be the value EOF + - + + * - `Rule 21.17 `_ + - Mandatory + - Use of the string handling functions from shall not resu= lt in + accesses beyond the bounds of the objects referenced by their point= er + parameters + - + + * - `Rule 21.18 `_ + - Mandatory + - The size_t argument passed to any function in shall have= an + appropriate value + - + + * - `Rule 21.19 `_ + - Mandatory + - The pointers returned by the Standard Library functions localeconv, + getenv, setlocale or, strerror shall only be used as if they have + pointer to const-qualified type + - + + * - `Rule 21.20 `_ + - Mandatory + - The pointer returned by the Standard Library functions asctime ctime + gmtime localtime localeconv getenv setlocale or strerror shall not = be + used following a subsequent call to the same function + - + + * - `Rule 22.2 `_ + - Mandatory + - A block of memory shall only be freed if it was allocated by means = of a + Standard Library function + - + + * - `Rule 22.4 `_ + - Mandatory + - There shall be no attempt to write to a stream which has been opene= d as + read-only + - + + * - `Rule 22.5 `_ + - Mandatory + - A pointer to a FILE object shall not be dereferenced + - + + * - `Rule 22.6 `_ + - Mandatory + - The value of a pointer to a FILE shall not be used after the associ= ated + stream has been closed + - --=20 2.25.1