From patchwork Thu May 11 23:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13238535 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 1DA11C77B7F for ; Thu, 11 May 2023 23:23:17 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 From: Stefano Stabellini Add the Mandatory rules agreed by the MISRA C working group to docs/misra/rules.rst. Signed-off-by: Stefano Stabellini Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu Acked-by: Jan Beulich Acked-by: Bertrand Marquis --- 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 - + * - `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 result in + accesses beyond the bounds of the objects referenced by their pointer + 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 opened 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 associated + stream has been closed + -