[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Diff to make core compile with gcc-4.1 prerelease

From: David Ayers
Subject: Re: Diff to make core compile with gcc-4.1 prerelease
Date: Fri, 07 Oct 2005 12:40:53 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050817)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]