Re: Errors when compiling with GCC 4.1
On 2005-10-05 00:47:59 + 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
Re: Errors when compiling with GCC 4.1
Richard, --- Richard Frith-Macdonald <[EMAIL PROTECTED]> wrote: > 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. It seems to need the *precise* type now, AFAICT. I'm not sure it's a compiler bug. Hopefully, someone more familiar than I with the GCC internals can comment on this. Later, GJC Gregory John Casamento -- CEO/President Open Logic Corp. (A MD Corp.) ## Maintainer of Gorm (IB Equiv.) for GNUstep. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Errors when compiling with GCC 4.1
On Tue, 4 Oct 2005 17:47:59 -0700 (PDT), Greg 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 union > GSAttributedString.m:138: error: cast to union type from type not present > in union There's a ton of errors and warnings, especially about invalid conversion from 'unsigned char*' to 'const char*' > GCC 4.1 is the version of the compiler which is supposed to have a > working ObjC++ in it. We need to be totally ready for this release. :) It is. I've been playing around with g++41 for a while now, and it seems to indeed have a working ObjC++ -- though I only tested 'plain' ObjC, not with GNUstep (see problems above). If GNUstep can be readied for GCC 4.1 we can get WebKit... w00t 8-) -- Chris -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev