[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] docs/misra: add R11.1 R11.2 R11.3 R11.6


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Nov 2023 10:36:08 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v8PVvPEP6qOan3iDkRjIIaq4ey1gM914yQVa5yGASS4=; b=Q0msDxMFZgtfETMHUTEKA2MtD2zGYDfnqXJEHc2NeRyzS/iJvPDxN28WfrdP1zTx66vGuuI5/7ZqyEvlNTE9qFiUdrl5YFomLgEKVejZS2Ye08FYoZHkvgKwC1x7qTaA5ONoRPlkEGPGRwbRn1KM87gfxgLbzIxvZ//HZjH79eALFLPm3bTFjEzWMqqwQ3oRiPg7+Gki2WuDxjElRUkxLJUQfPypsW/QiZolf9gV0qT3m19WT/DtCafPCk8vFAbnRn2Oj50GL4X4CJlTAZr7Et91tUJP/UgIir6AosBu5bKY9Ww7wfiykDKN1rLTQpTSQqWOy2Z7PILEtVDzZZFdTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WbfMm/NZkR8FxVCfsklDEj+bxle+QXVHlUacjM7KbzsKi/5rcJlyH8dsufCXJR/NOIYdT0UjrYXHasXmUnkXs6+7eT+1RXc8ZmQlD75Ju0L+Pq99Xd5LV6xht0U4VnUr8ARcZeINpb/SD/TsmWiyB6Z7+H3e4ZL1tRPEXiaPgEQ0njH94y55TvS8h6dFE82yjGbOFSjeJWX1DsBOC4OZw1k/D04rXUhEs6t/4mPISBYLL6TDoIgwxSJmLOKb7nZXxn8I1HPW7rpONssbtyVsCdrBBFQGY3cvv0guzzDSwvFKk01fiYKwhhwFJAea8s/SCQ/EUQiFt5R/JwZ4B1bFRw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 14 Nov 2023 09:36:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.11.2023 00:44, Stefano Stabellini wrote:
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -383,6 +383,38 @@ maintainers if you want to suggest a change.
>  
>         CFLAGS="-Warith-conversion -Wno-error=arith-conversion" make -C xen
>  
> +   * - `Rule 11.1 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_01.c>`_
> +     - Required
> +     - Conversions shall not be performed between a pointer to a
> +       function and any other type
> +     - All conversions to integer types are permitted if the destination
> +       type has enough bits to hold the entire value. Conversions to
> +       bool and void* are permitted.
> +
> +   * - `Rule 11.2 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_02.c>`_
> +     - Required
> +     - Conversions shall not be performed between a pointer to an
> +       incomplete type and any other type
> +     - All conversions to integer types are permitted if the destination
> +       type has enough bits to hold the entire value. Conversions to
> +       bool and void* are permitted.

Assuming the rule's exception 2 really means void, not void*, the mentioning
of void* here is still fine.

> +   * - `Rule 11.3 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_03.c>`_
> +     - Required
> +     - A cast shall not be performed between a pointer to object type
> +       and a pointer to a different object type
> +     - All conversions to integer types are permitted if the destination
> +       type has enough bits to hold the entire value. Conversions to
> +       bool and void* are permitted.

Here and ...

> +   * - `Rule 11.6 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_06.c>`_
> +     - Required
> +     - A cast shall not be performed between pointer to void and an
> +       arithmetic type
> +     - All conversions to integer types are permitted if the destination
> +       type has enough bits to hold the entire value. Conversions to
> +       bool and void* are permitted.

... here, however I consider its mentioning misleading: "void" is neither
an object type nor an arithmetic one.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.