Re: [PATCH v2] remove a warning building a test

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

 



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@xxxxxxxxxx
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]