[libvirt] [PATCH] build: avoid shadowing devname() on BSD systems

Eric Blake eblake at redhat.com
Sat Dec 4 20:51:47 UTC 2010


On 12/03/2010 10:48 AM, Justin Clift wrote:
>>>  event.c: In function 'virEventInterruptLocked':
>>>  event.c:656: warning: cast from pointer to integer of different size
>>> [-Wpointer-to-int-cast]
>>>
>         VIR_DEBUG("Skip interrupt, %d %d", eventLoop.running, (int)eventLoop.leader.thread);
>         return 0;
>     }
> 
> Like 656 is the VIR_DEBUG() line.
> 
> Having trouble finding where eventLoop.leader.thread is defined though.  Probably because
> I'm more sleepy than optimal.  Thinking it might be some kind of problem with OSX and gnulib?

Rather, it's due to the fact that pthread_t is allowed to be a pointer
type, and on 64-bit systems, a pthread_t pointer is truncated when cast
to int (it just happens that pthread_t is an integer rather than a
pointer on glibc, so we don't notice this on Linux).

But we already have virThreadSelfID which works around this issue for
the current thread; all we need to do is extend it to other threads.
Patch coming up soon!

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101204/7123356e/attachment-0001.sig>


More information about the libvir-list mailing list