Hack in gcc/c-decl.c?

Mike Stump mrs@apple.com
Thu Dec 29 20:20:00 GMT 2005


On Dec 29, 2005, at 11:32 AM, Gabriel Dos Reis wrote:
> I believe, but I'm not sure, that GCC is using type puning not
> guaranteed to work (except "common sense" from "obvious model".)

I think the C family of language standards should think about the  
issue and clarify their exact intent...  I know C at least was kinda  
inadequate from my perspective.

> I guess we just have to wait till GCC is miscompiled (probably by
> itself) to see whether the Middle End would cite chapter and verse :-)

Or, we can talk about it first.  I'd prefer that we talk though the  
corner cases instead of just assuming and putting them in.  I'd argue  
that we should enhance the manual with the corner cases so as to  
guide the language standard into making the `right' decision.

In this area, I don't think we do anything unfriendly.  What was your  
concern?

I see we make use of

struct S { int first; } s;

&s == &s.first, and we upcast and down cast via pointer arithmetic,  
and we assume we can change type when a pointer has the right value,  
none of these run afoul of what gcc does afaik.



More information about the Gcc mailing list