This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined behavior due to 6.5.16.1p3
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 11 Mar 2015 17:39:31 +0100
- Subject: Re: Undefined behavior due to 6.5.16.1p3
- Authentication-results: sourceware.org; auth=none
- References: <54FDF3CE dot 6030507 at robbertkrebbers dot nl> <54FF195B dot 5060604 at redhat dot com> <54FF1F7C dot 5050501 at robbertkrebbers dot nl> <54FF2182 dot 1090800 at robbertkrebbers dot nl> <alpine dot DEB dot 2 dot 10 dot 1503102153590 dot 10726 at digraph dot polyomino dot org dot uk> <550042BD dot 8000608 at robbertkrebbers dot nl> <20150311160815 dot GA2967 at ypig dot lip dot ens-lyon dot fr> <20150311161155 dot GM1746 at tucnak dot redhat dot com> <20150311163101 dot GA4384 at ypig dot lip dot ens-lyon dot fr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Mar 11, 2015 at 05:31:01PM +0100, Vincent Lefevre wrote:
> > (in C only one union member can be active at any time,
> > we as extension allow type punning through unions etc.)
>
> I disagree that it is an extension. The standard does not say
> that "one union member can be active at any time".
That is not a standard wording, but what I meant is
6.2.6.1p7 - that when you store some union member other union members take
unspecified values.
Jakub