qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Orit Wasserman <owasserm@redhat.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32
Date: Tue, 14 Aug 2012 06:37:56 -0600	[thread overview]
Message-ID: <502A46A4.50009@redhat.com> (raw)
In-Reply-To: <1344941747-30158-1-git-send-email-agraf@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On 08/14/2012 04:55 AM, Alexander Graf wrote:
> When compiling the xbzrle code on my ppc32 user space, I hit the following
> gcc compiler warning (treated as an error):
> 
>   cc1: warnings being treated as errors
>   savevm.c: In function ‘xbzrle_encode_buffer’:
>   savevm.c:2476: error: overflow in implicit constant conversion
> 
> Fix this by making the cast explicit, rather than implicit.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  savevm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/savevm.c b/savevm.c
> index 0ea10c9..9ab4d83 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -2473,7 +2473,7 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
>          /* word at a time for speed, use of 32-bit long okay */
>          if (!res) {
>              /* truncation to 32-bit long okay */
> -            long mask = 0x0101010101010101ULL;
> +            long mask = (long)0x0101010101010101ULL;

What a picky compiler - too bad it can't just read the comment above
that said we are okay with truncation :)

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

      reply	other threads:[~2012-08-14 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 10:55 [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32 Alexander Graf
2012-08-14 12:37 ` Eric Blake [this message]

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=502A46A4.50009@redhat.com \
    --to=eblake@redhat.com \
    --cc=agraf@suse.de \
    --cc=owasserm@redhat.com \
    --cc=qemu-devel@nongnu.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).