[pushed] Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations

Pedro Alves palves@redhat.com
Mon Mar 9 11:38:00 GMT 2015


On 03/09/2015 11:10 AM, Pedro Alves wrote:

> With all that said, I'm having second thoughts on this ...  Per
> 6.3.2.3 ("A pointer to an object or incomplete type may be converted to
> a pointer to a different object or incomplete type"), as long as we don't
> actually access the fields of sockaddr through the "struct sockaddr *" pointer,
> then the cast should be OK.  In the bind/accept cast, it should be the
> internals of those functions that need the union trick.  Gosh, what a mess.
> 
> So I'll revert the union patch, and apply the original one that added
> the missing cast to tracepoint.c...

Done.  Sorry for the noise...

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list