This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [pushed] Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 09 Mar 2015 18:04:41 +0200
- Subject: Re: [pushed] Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations
- Authentication-results: sourceware.org; auth=none
- References: <1425750266-14385-1-git-send-email-palves at redhat dot com> <83r3t0lmb9 dot fsf at gnu dot org> <54FB4162 dot 5090601 at redhat dot com> <83oao4ljwg dot fsf at gnu dot org> <54FD79B4 dot 8070201 at redhat dot com> <54FD7F9D dot 9070809 at redhat dot com> <54FD864D dot 8030403 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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 ;-)