This is the mail archive of the
mailing list for the GDB project.
Re: [pushed] Fix struct sockaddr/sockaddr_in/sockaddr_un strict aliasing violations
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 09 Mar 2015 11:38:53 +0000
- 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>
On 03/09/2015 11:10 AM, Pedro Alves wrote:
> With all that said, I'm having second thoughts on this ... Per
> 126.96.36.199 ("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...