On 2005-10-05 00:47:59 +0000 Gregory John Casamento <[EMAIL PROTECTED]> wrote:

Hi,

Getting the following error when compiling with GCC 4.1 prerelease:

GSAttributedString.m: In function cacheAttributes:
GSAttributedString.m:130: error: cast to union type from type not present in
union
GSAttributedString.m:138: error: cast to union type from type not present in
union

I have spoken with Andrew Pinski and we both believe this is not a problem with
the compiler, but a problem with the gnustep code.

The error, specifically, is that the line in question attempts to coerce a
NSDictionary into a GSIMapKey (GSUNION). The compiler finds no matching type
in the union for the NSDictionary and fails.  I suppose that, in previous
versions of the compiler, this was matching with the NSObject which is part of
the union.   This no longer seems to be working.

It should have been matching with the 'id' part of the union.
My understanding of the language is that you should be able to assign any object to a variable of type 'id' ... so I'd be inclined to call it a compiler bug. I guess we might be able to work around it by explicitly casting the NSDictionary to be an id first ... (GSIMapKey)(id)attrs ... but that's not very nice.



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to