[Top][All Lists]

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

Re: Errors when compiling with GCC 4.1

From: Richard Frith-Macdonald
Subject: Re: Errors when compiling with GCC 4.1
Date: Wed, 05 Oct 2005 01:05:14 +0000

On 2005-10-05 00:47:59 +0000 Gregory John Casamento <address@hidden> wrote:


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
GSAttributedString.m:138: error: cast to union type from type not present in

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.

reply via email to

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