This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC aliasing rules: more aggressive than C99?
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Joshua Haberman <jhaberman at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 03 Jan 2010 12:22:39 +0100
- Subject: Re: GCC aliasing rules: more aggressive than C99?
- References: <loom.20100103T063932-636@post.gmane.org>
* Joshua Haberman:
> To me this allows the following:
>
> int i;
> union u { int x; } *pu = (union u*)&i;
> printf("%d\n", pu->x);
I think the cast on the secodn line is undefined, not the access on
the third.