This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding UNION/MAP -- Feedback and tips pls!


On Wed, Mar 6, 2013 at 11:46 AM, N.M. Maclaren <nmm1@cam.ac.uk> wrote:
> 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?

The documentation is not clear on whether data is preserved.  I
believe that as a matter of fact the data is preserved, but I don't
think we need to guarantee it.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]