
2 May
2013
2 May
'13
4:49 p.m.
On 05/02/2013 08:42 AM, Claudio Bley wrote:
Since the warning only ever refers to directly casting a function return value, wouldn't it suffice to introduce a (properly typed) variable first assigning the function result?
pthread_t self = pthread_self(); return (int)(intptr_t)self;
You _still_ need a (void*) in the mix; pthread_t and intptr_t are not necessarily compatible, but everything should be compatible with void*. But a union is still nicer than three casts in a row. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org