Richard Frith-Macdonald schrieb:

> However, while this cast to union feature is non-standard anyway its
> behavior is therefore hard to classify as a definite bug, I do think the
> new behavior is non-intuitive, and it would be better if it handled
> assignment of any pointer to a void* member and any object to an id
> member, for consistency with the normal rules of C and ObjC.

Agreed.  Non-intuitive in both cases but consistent.

> I guess the current rationale is probably that a union may have two or
> more members which a value could be cast to using normal casting rules,
> so it uses only exact matches to avoid any confusion ... but I think
> casts to any element of equivalent type should be allowed.

Well I could very much agree with the rationale if there is a case where
this 'confusion' would lead to a code generation issue but I can't think
of such a situation right now.  This looks like a pure compile time type
checking issue so it seems that at most I would have expected a warning.

But you are right, as a gcc extension, it's whatever gcc maintainers
want it to be.

Cheers,
David


_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to