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: Andrew Haley <aph at redhat dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 24 Jun 2008 10:36:15 +0100
- Subject: Re: RFA and RFC: tweak -fstrict-aliasing docs, provide pointer-cast example
- References: <200806240144.m5O1iGvr006631@ignucius.se.axis.com>
Hans-Peter Nilsson wrote:
> There's background in
> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36593>. Neither
> Richi nor me could find the union-assignment "gcc extension" at
> a glance, probably because it's not an *extension* but an
> implementation-defined behavior, and actually duly documented as
> such. However, to cross-reference that section together with
> the clarifying type-punning blurb in the -fstrict-aliasing
> documentation seems would be an improvement, and apparently
> there's enough confusion about casting, pointers and unions to
> call for an extra example, covering the offending code in the
> PR.
>
> So far the RFA. The RFC is whether (to reject this patch and
> call for another) to allow the cast-through-pointer-to-union in
> the example and the PR as a variant of the blessed
> implementation-defined type-punning using unions. IMHO not, but
> the offending code is from a canonical strtod implementation
> imported into newlib, and enough people are confused already,
I thought cast-through-pointer-to-union didn't work and was already
disallowed; we've been around all this already. This patch of yours
already documents uncontroversial behaviour.
I don't like the phrase "might not work". It's better just to say "is not
allowed".
Andrew.