This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFA and RFC: tweak -fstrict-aliasing docs, provide pointer-cast example
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: aph at redhat dot com
- Cc: hans-peter dot nilsson at axis dot com, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 24 Jun 2008 12:19:37 +0200
- Subject: Re: RFA and RFC: tweak -fstrict-aliasing docs, provide pointer-cast example
> Date: Tue, 24 Jun 2008 10:36:15 +0100
> From: Andrew Haley <aph@redhat.com>
> I thought cast-through-pointer-to-union didn't work and was already
> disallowed; we've been around all this already.
We also bless assignments through unions, and this could be
argued as assigning through a union, albeit casted.
> This patch of yours
> already documents uncontroversial behaviour.
That's what I hope, but the existence of that code together in
an *else* clause of #ifdef YES_ALIAS by a well-known author
makes it de-facto controversial IMHO. Note also that another
maintainer thought the code to be valid; see the PR.
> I don't like the phrase "might not work". It's better just to say "is not
> allowed".
I thought the wording to be uncontroversial :) as I copied it
from the previous example: "So, the code above will work as
expected. However, this code might not".
But, I agree with your sentiment and hope a reviewer agrees that
your wording is preferred.
brgds, H-P