All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Juergen Gross <jgross@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Marek Marczykowski <marmarek@invisiblethingslab.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH] tools/kdd: silence gcc 8 warning a different way
Date: Mon, 16 Apr 2018 16:20:44 +0100	[thread overview]
Message-ID: <20180416152044.GA84326@deinos.phlegethon.org> (raw)
In-Reply-To: <20180416082948.g6yhqwilqlorfciw@citrix.com>



At 09:29 +0100 on 16 Apr (1523870989), Wei Liu wrote:
> Cc Tim
> On Thu, Apr 12, 2018 at 06:04:49AM -0600, Jan Beulich wrote:
> > Older gcc doesn't like "#pragma GCC diagnostic" inside functions.
> > 
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > --- a/tools/debugger/kdd/kdd.c
> > +++ b/tools/debugger/kdd/kdd.c
> > @@ -695,10 +695,10 @@ static void kdd_handle_read_ctrl(kdd_sta
> >              KDD_LOG(s, "Request outside of known control space\n");
> >              len = 0;
> >          } else {
> > -#pragma GCC diagnostic push
> > -#pragma GCC diagnostic ignored "-Warray-bounds"
> > -            memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
> > -#pragma GCC diagnostic pop
> > +            /* Suppress bogus gcc 8 "out of bounds" warning. */
> > +            const uint8_t *src;
> > +            asm ("" : "=g" (src) : "0" ((uint8_t *)&ctrl.c32 + offset));

That's terrifying!  Does casting the offset to uint32_t not DTRT?

Tim.

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

  reply	other threads:[~2018-04-16 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 12:04 [PATCH] tools/kdd: silence gcc 8 warning a different way Jan Beulich
2018-04-16  8:29 ` Wei Liu
2018-04-16 15:20   ` Tim Deegan [this message]
2018-04-16 10:33 ` Wei Liu
2018-04-16 11:15   ` Ian Jackson
2018-04-16 12:00   ` Jan Beulich
2018-04-16 12:43     ` Marek Marczykowski
2018-04-23 14:21       ` Wei Liu
2018-04-16 13:26     ` Ian Jackson
2018-05-22 10:54 ` Wei Liu
2018-05-22 19:43   ` Marek Marczykowski

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=20180416152044.GA84326@deinos.phlegethon.org \
    --to=tim@xen.org \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.