xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	tim@xen.org, Marek Marczykowski <marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] tools/kdd: silence gcc 8 warning a different way
Date: Mon, 16 Apr 2018 09:29:49 +0100	[thread overview]
Message-ID: <20180416082948.g6yhqwilqlorfciw@citrix.com> (raw)
In-Reply-To: <5ACF678102000078001BAA8E@prv1-mh.provo.novell.com>

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));
> +            memcpy(buf, src, len);
>          }
>      }
>  
> 
> 
> 

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

  reply	other threads:[~2018-04-16  8:29 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 [this message]
2018-04-16 15:20   ` Tim Deegan
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=20180416082948.g6yhqwilqlorfciw@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=tim@xen.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).