[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32 |
Date: |
Tue, 14 Aug 2012 06:37:56 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
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 <address@hidden>
> ---
> savevm.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
>
> 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 address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature