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

Re: [RFC REPOST] xen: Enable -Wwrite-strings


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Jul 2023 13:58:05 +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=sU905YrKktMBCfFR15qVudU/8Wy7M4d02lF7wjb0bpw=; b=lh4cypj3hcueVJ+QPI4c03iSlpiDyaP41fHWijkPT0EiJoSnW1TQo/275tL8sJxxyEWbtrcmNwF/yWvf6Ttgjxrar/h1Xtb5LRigASdzi/7FYas+2DjFTmv9UcePBfonpgJOjClO5pNTuJzhrJNdjDdDPK7NKjmuyEXK52WqsIt7v6hp91+XO2vo+8mFuPkjRnQ5CGHkUgK1vay4kESDBa/MYEd9z2Id5qBZVYzXWmEikxWNKKFCPEahQ4l58CIsO72S0XotXq6Xz2uEBKIZ5EPkQQp1truRXh93hD0gVua1dkVkvA9VlUZewT4l4jIPBSsv3RsuQklJeLRtz71K6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DOYi3fymMqIQ+aUWg0xuBiDh1qcKCP3+8dSBu5jmwjySwrAy1DX81nd7sA0THWcIDYWUkPTpTOO1RGViDkkqQ9Fu8/dkOlXynfcJIF+5ItF474D+hrvVfaEwW2ZZsSCTlAlMu83VIHyQwHfS5kCjettCyd+gN5+gEbJO7xspGPtSteMnFQYuUITFWo+mv0h7G/W67tcD/ecEv2wtyW+k8nBPAkkvDUwVAg4VtrXgxQS+DVRu+UgXgLaUWcolbnQ0bWMO6Yl6606JEmdZ1D3BUDStsqG/5aEGLD1UTtYDupXRvyVHQWPNm4UqwKq+0PqNDfMemUJaP5visOIG0L4zkg==
  • 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>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 19 Jul 2023 11:58:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.07.2023 13:38, Andrew Cooper wrote:
> This is the remainder change to get x86 compiling with -Wwrite-strings.  ARM
> still has some cleanup to go.
> 
> There are two swamps left.
> 
>   1) efi_arch_handle_cmdline().  Swapping name.s for name.cs makes the code
>      compile, but only because the underlying union launders the pointer back
>      to being mutable.

To address (part of?) this concern, ...

> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -324,7 +324,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 
> *image_name,
>          w2s(&name);
>      }
>      else
> -        name.s = "xen";
> +        name.cs = "xen";
>      place_string(&mbi.cmdline, name.s);

... how about changing this function invocation to also pass
name.cs? The function already takes const char *, it's just that
there was no "cs" union member back at the time.

Jan



 


Rackspace

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