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!


Perhaps I misunderstand how you are defining failure here... what
would be the failure mode?  Perhaps if you could provide an example of
the ill-effects that could be seen as a result of this behavior it
would clarify the issue?

v/r,

Russell

On Wed, Mar 6, 2013 at 2:15 PM, N.M. Maclaren <nmm1@cam.ac.uk> wrote:
> On Mar 6 2013, Russell Brennan wrote:
>>>
>>>
>>> Ouch.
>>>
>>> This seems to be at odds with C's unions, where it is not allowed to do
>>> type punning.
>>
>>
>> As of gcc 4.4.6, the description above seems to match the C behavior:
>
>
> Er, no.  One simple test does not prove that it will always work; this
> sort of thing is most likely to fail because it interacts in very nasty
> ways with optimisation.  C99 introduced a horribly ill-defined concept
> called "effective types", which specifically allows type-dependent
> optimisations.  I have no idea whether gcc uses it at present, but it
> might well do so in the future.
>
> Regards,
> Nick Maclaren.
>
>


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