From patchwork Tue Apr 16 19:27:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13632427 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 D2A9CC4345F for ; Tue, 16 Apr 2024 19:28:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.707091.1104594 (Exim 4.92) (envelope-from ) id 1rwoTC-0001rs-IW; Tue, 16 Apr 2024 19:27:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 707091.1104594; Tue, 16 Apr 2024 19:27:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rwoTC-0001rl-ES; Tue, 16 Apr 2024 19:27:54 +0000 Received: by outflank-mailman (input) for mailman id 707091; Tue, 16 Apr 2024 19:27:52 +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 1rwoTA-0001rd-Db for xen-devel@lists.xenproject.org; Tue, 16 Apr 2024 19:27:52 +0000 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6729aa58-fc27-11ee-94a3-07e782e9044d; Tue, 16 Apr 2024 21:27:48 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E4E8FCE117E; Tue, 16 Apr 2024 19:27:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A4A2C4AF0C; Tue, 16 Apr 2024 19:27:42 +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: 6729aa58-fc27-11ee-94a3-07e782e9044d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713295663; bh=U8tzrv9FyflCl7J9eLzS/qexsRCa8ukLXPjHuTuQzyA=; h=Date:From:To:cc:Subject:From; b=ZwgIWEcaYaV3JwNyC2A3W4sKaOknkqfPGlSq+NwKc0OCWviJkcQbNs9CU559o9gsK 5xv+reMGMHKcYCgShB2x3Hns5+jRbVuDUbfWDRxIhGXTwDE9Z9xNjWf9BEix+iarCR GezzofNcZl94EFTUTe/hzQxLEd0//PkTCe1/iq9LG0LV4VUCvuLTR4E61/FSNaCv1d cX5G36tfNmu/2M8V3lh86wD4Z/t6AhfDa5XmwdRGDIZOR01zmfw5S8KvHG+jffcgUq UoWWiirz76ILIJzEWsjceLLvyv8OW/u3JSJ2jD2kiE/t73FbEizPPIA/CY1p1BdRo7 TDlFwbWTtC0Vg== Date: Tue, 16 Apr 2024 12:27:38 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Jan Beulich , Andrew Cooper , Julien Grall , Bertrand Marquis , Michal Orzel Subject: docs/misra: add R21.6 R21.14 R21.15 R21.16 Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Also add two specific project-wide deviations for R21.6 and R21.15. Signed-off-by: Stefano Stabellini Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 32b02905d1..9123c8edb5 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -387,6 +387,22 @@ Deviations related to MISRA C:2012 Rules: of the Rule due to uses of this macro. - Tagged as `deliberate` for ECLAIR. + * - R21.6 + - The use of snprintf() and vsnprintf() is justifiable as, despite + the fact that such functions have the same names of the + corresponding standard library functions, each configuration of + Xen has a unique implementation for them; the code implementing + such functions is subject to the analysis, so that any undefined + or unspecified behavior associated to them falls under the + responsibility of other MISRA guidelines + - Tagged as `safe` for ECLAIR. + + * - R21.15 + - The use of void* arguments is justifiable as the rationale for + the rule is to indicate possible mistakes, and void* is + frequently used in Xen to represent virtual memory addresses + - Tagged as `deliberate` for ECLAIR. + Other deviations: ----------------- diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index b7b447e152..00db02ad34 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -652,12 +652,38 @@ maintainers if you want to suggest a change. declared - See comment for Rule 21.1 + * - `Rule 21.6 `_ + - Required + - The Standard Library input/output routines shall not be used + - See the snprintf() and vsnprintf() deviation in deviations.rst + * - `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.14 `_ + - Required + - The Standard Library function memcmp shall not be used to compare + null terminated strings + - + + * - `Rule 21.15 `_ + - Required + - The pointer arguments to the Standard Library functions memcpy, + memmove and memcmp shall be pointers to qualified or unqualified + versions of compatible types + - void* arguments are allowed, see deviations.rst + + * - `Rule 21.16 `_ + - Required + - The pointer arguments to the Standard Library function memcmp + shall point to either a pointer type, an essentially signed type, + an essentially unsigned type, an essentially Boolean type or an + essentially enum type + - + * - `Rule 21.17 `_ - Mandatory - Use of the string handling functions from shall not result in