This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> Date: Mon, 09 Mar 2015 11:38:53 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org
> 
> 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...

I should be sorry first ;-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]