This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adding UNION/MAP -- Feedback and tips pls!
- From: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>
- To: gcc at gcc dot gnu dot org, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: 06 Mar 2013 19:46:58 +0000
- Subject: Re: Adding UNION/MAP -- Feedback and tips pls!
- References: <51314549.6080902@earthlink.net> <Prayer.1.3.5.1303020815470.18790@hermes-1.csi.cam.ac.uk> <CAGkQGiL7Qg0RAqJrT5i4LDzjnsr3jQ42Ws2BQFDpPUHyQe3+WQ@mail.gmail.com> <CAKwh3qgyS0nRcGSE5UT+DN+11kjYRE9Vu7SsQ_AGPtuD7VV4dA@mail.gmail.com> <Prayer.1.3.5.1303021519480.2329@hermes-1.csi.cam.ac.uk> <CAAKgPaHZwaoSBVg-hNZxan-uAtnmEBjPxyv9iuh=xdOshFp1uQ@mail.gmail.com> <Prayer.1.3.5.1303041813340.19357@hermes-1.csi.cam.ac.uk> <CAAKgPaGtNQoA=2h+5Z8DmvgsEBKUKX78Ojwi_SY2RG8hUcksOg@mail.gmail.com> <Prayer.1.3.5.1303042034040.18634@hermes-1.csi.cam.ac.uk> <51378C6D.5060609@netcologne.de> <CA+=Sn1kGyBabx+JgrPFJQ6GKU+PbfagygG16=oAhC6qyW1b7Rg@mail.gmail.com>
On Mar 6 2013, Andrew Pinski wrote:
Except GCC implements C's unions as allowing to do type punning as an
extension and as far as GCC is concerned that is not going to change
any time soon.
This is a documented exception to the aliasing/type punning rules.
The problem is that this is worse than type punning, because it also
allows the preservation of data. Does the extension guarantee that,
or would it need a change to at least the documentation?
Regards,
Nick Maclaren.