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

Re: [PATCH] docs/misra: add Rule 7.4 and 9.4


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 7 Jul 2023 08:52:28 +0200
  • 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=2uasM40HRG7OgJnwBX5gG/lDzbEOH6AcY4QQKmPvDoY=; b=NV77b5ckSU7hltv29uQ7L3CGEQ5PbQb9KvZP5r5LzjtLbCI32UXvOju26iKOfuO5B8BQ88rqpywkgLAM+wxh3H435Kiixck+3VmbchfTMWDUQxep+MgGnZdjKJiv9RS9F0+UyCc3brWCgN3qNsKg8tsxgmO/zFZUpw/cO8gQr3gfN3g9bvj6D6r0IIjS7HE3JOQO1MARdIlug6QybKNwSKjbi9PoNRpDF4Slij1a+R2o1JEXTi3Oy+FhnYJM/+d9drwqFeBFLR6xesljnPiNOExUA2tPSWzo7+TignotzMtgENHBprsKdo9nO1zf665DTrwhKrRWkdzNcS2Kvsq6Yg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PpJfqU2LNVCzTiFFlOj2P2VMoXcXkIwF281J2Kjr1o7qRPQabobQoQonDvlrYTvkxc8jTBiSMzlUUKkaOv3a0zlDm+7irupnLwejUl9pEQ76eqBN2cXL4N04+HQD3yp+oF0mW2ljeLxSq3q5OTQCKXvqup3WCCOFwW9wU+NQ+kTRdu7KanzkIfT5IppMl/PzN0BnNd7xdg3LR4Sxu2uXyB+sWDyJHCDXJo5IHYo9g9ut9//S7JqbG1N61qN5VeB2hYAg0aVkxDZEsV7lgqUWVkbUkhOqIr9QDcYTKolLwsV++evQa3w3ctcus3CG1VclF+0EnVPnFwz2mstrJGYvaQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, julien@xxxxxxx, george.dunlap@xxxxxxxxxx, bertrand.marquis@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 07 Jul 2023 06:53:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2023 00:46, Stefano Stabellini wrote:
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -203,6 +203,13 @@ maintainers if you want to suggest a change.
>       - The lowercase character l shall not be used in a literal suffix
>       -
>  
> +   * - `Rule 7.4 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
> +     - Required
> +     - A string literal shall not be assigned to an object unless the
> +       objects type is pointer to const-qualified char
> +     - Assigning a string literal to any object with type
> +       "pointer to const-qualified void" is allowed

I guess this is relevant also in a few other cases: Considering the
significant difference between title and actual text of the rule, and
further assuming people looking here won't always pull out the full
doc (they may not even have a copy of it), I think it is important to
also mention in a remark that despite the title all "character types"
are permitted, as long as string element type and character type match.
Since the compiler won't allow mismatches when the lhs type isn't void,
mandating no use of casts to "satisfy" the rule may be a way to express
our intentions.

Jan



 


Rackspace

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