This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] aout+coff: Fix strict-aliasing rules error
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 8 Mar 2016 21:46:50 +0100
- Subject: Re: [patch] aout+coff: Fix strict-aliasing rules error
- Authentication-results: sourceware.org; auth=none
- References: <20160308135706 dot GA3994 at host1 dot jankratochvil dot net> <56DEE362 dot 2000002 at redhat dot com>
On Tue, 08 Mar 2016 15:36:18 +0100, Pedro Alves wrote:
> Not clear to me why this is producing a warning. This seems like a gcc trunk
> regression that should be reported and fixed in gcc instead. It's valid
> to cast the pointer to a struct to a pointer to its initial member and back.
>
> See C99 6.7.2.1 point 13 [1], or C11 6.7.2.1 point 15 [2].
>
> "A pointer to a structure object, suitably converted, points to its
> initial member (...), and vice versa."
I do not see the implication there myself but I have therefore filed it:
[6 Regression?] false strict-aliasing warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
Jan