Re: [PATCH] Avoid cast to unit64_t on 32bit platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/11/2013 12:40 PM, Guido Günther wrote:
> Fixes compilation on 32bit platforms:
> 
> xen/xen_hypervisor.c: In function 'virXen_setvcpumap':
> xen/xen_hypervisor.c:1785:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> xen/xen_hypervisor.c:1785:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> cc1: all warnings being treated as errors
> ---
>  src/xen/xen_hypervisor.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
> index 9b7dd2e..e3de0b2 100644
> --- a/src/xen/xen_hypervisor.c
> +++ b/src/xen/xen_hypervisor.c
> @@ -1782,7 +1782,7 @@ virXen_setvcpumap(int handle,
>          memset(&xen_cpumap, 0, sizeof(cpumap_t));
>          for (j = 0; j < maplen; j++) {
>              if ((j & 7) == 0)
> -                pm = (uint64_t *)((uint64_t)&xen_cpumap + (j & ~0x7UL));
> +                pm = (uint64_t *)((intptr_t)&xen_cpumap + (j & ~0x7UL));

I was afraid of this.  :(

I would ask that we hold off on this patch, and instead use a PROPER
patch that quits violating aliasing constraints.  I'll hopefully have
one posted later today (if not, then we can push this to fix builds as
an interim measure, but it feels lousy already having 2, and this would
make 3, patches to clean up what was supposed to be a simple Coverity
cleanup original patch).

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]