All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xen.org
Subject: Re: staging aarch64 build fails in xc_dom_arm.c
Date: Tue, 30 May 2017 16:34:54 +0100	[thread overview]
Message-ID: <7ec75007-2067-8c71-625c-b22ba5f0f0d9@citrix.com> (raw)
In-Reply-To: <20170530152735.GA19868@aepfle.de>

On 30/05/17 16:27, Olaf Hering wrote:
> With gcc7 the aarch64 build in staging fails:
>
>  xc_dom_arm.c: In function 'meminit':
>  xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       if ( domctl.u.address_size.size == 0 )
>            ~~~~~~~~~~~~~~~~~~~~~^~~~~

That's because it really will be uninitialised if the caller passes
anything other than "xen-3.0-aarch64" or "xen-3.0-armv7l" into guest type.

Does

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index e7d4bd0..e669fb0 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -223,6 +223,8 @@ static int set_mode(xc_interface *xch, domid_t
domid, char *guest_type)
 
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
+    domctl.u.address_size.size = 0;
+
     for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;

help?

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-05-30 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 15:27 staging aarch64 build fails in xc_dom_arm.c Olaf Hering
2017-05-30 15:34 ` Andrew Cooper [this message]
2017-05-30 15:40   ` Olaf Hering
2017-05-30 15:43     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ec75007-2067-8c71-625c-b22ba5f0f0d9@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.