[Spice-devel] [PATCH v2] remove a warning building a test

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu May 19 20:25:38 UTC 2016


On 05/18/2016 07:14 AM, Christophe Fergeau wrote:
> On Wed, May 18, 2016 at 12:46:03PM +0300, Uri Lublin wrote:
>>
>> In man cmsg examples I see they use a pointer:
>> int *pi = (int*) CMSG_DATA(cmsg);
>> *fd = *pi;
> 
> It seems to work this way, but I'm not sure why this works ;)
> 


I read an excelent post from Thiago Macieira (Qt) about this types of
warnings a long time ago, maybe it will make things clearer for you too...

http://blog.qt.io/blog/2011/06/10/type-punning-and-strict-aliasing/

-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com


More information about the Spice-devel mailing list