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

Re: [PATCH] x86/common: Use const char * for string literals


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jul 2023 09:59:07 +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=15ePut3Ap2jogJhygcZr2RNjPS0PRbnl7OL8Wr4yxNk=; b=UJRwD8RLOMdj8dHe/EVGq/LNr4RI8DAH4VysJTBvkgmBxld9JVn9glHQLNDnR7z+w3mVRLawS1Xb6hVN9qlngbgRm3ZKhgnUet04unf8rGULYmhzcBjRov+Yjzgg5y44piA0AKzBflgfIN2FbS1o/U1AecdbnSjQnKUw4hJTMYlNj7p7fcNDyzVfZ8SYpiS0qJKq48yneuR4m/twboSgFp8DYzwq/CAtWcdURVikFtMRrcvfmKuFCxfyKBbtCgtpvhJivWZ7KUrf88r+Xo8LMhu4ggP2M3E40Av9KfHoU4TuelIp2BJPYA2pRIw46yrkv7ku/Rh84TBsYNbT9FVBtQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJqFRbHGZ1O8rjoZSC2J1J4WmGC+6j25hk5kXLrNj6Bge2GLNA1Bkp2IEy3b0blmbe6waAL0oqU0wvLpcZoPOBdsmsS84pz8pDWNprKsvIbHzfq5fi1YyAgI0HECfUGOgn+s/ViLTwazKh2OP0EYwKlKDAfptDKCV8B73kiOQzfcmsQog9M2FNTEvI0cyBHsFJe2jPswUH23BvSQWZg4cmNRhLMWFDG09YlzZBRuNh3QVd9GfP3rMT5AVDd1EAmb19Gf72i8nNbGhxoDUkNHrV12AErXSKR67UZ+npJCOZvLfHsX7Fele4oO02uMihubpxbi8zcVtRqiNThoF78xUw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 17 Jul 2023 07:59:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.07.2023 13:00, Andrew Cooper wrote:
> For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
> it is undefined behaviour to mutate them.
> 
> Swap char *'s to const char *'s for variables which hold string literals.
> 
> This fixes several violations of MISRA Rule 7.4:
> 
>   A string literal shall not be assigned to an object unless the object's type
>   is "pointer to const-qualified char".
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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