gnustep-dev
[Top][All Lists]
Advanced

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

Re: libobjc: should nil be an id?


From: Fred Kiefer
Subject: Re: libobjc: should nil be an id?
Date: Tue, 1 Aug 2017 08:00:48 +0200

> Am 01.08.2017 um 01:43 schrieb Daniel Ferreira (theiostream) <address@hidden>:
> In libobjc2, `nil` is defined as a null pointer cast to an `id`[1].
> However, this breaks a lot of stuff targeted to Apple's libobjc which
> relies on `nil` and `NULL` being interchangeable.
> 
> I've experimented removing that cast from the runtime.h header and
> this works fine for compiling WebKit. This breaks libs-base and
> libs-gui, though, with stuff like:
> 
>> NSKeyedUnarchiver.m:862:33: error: cast to union type from type 'void *' not 
>> present in union
>>                       GSIArrayAddItem(_objMap, (GSIArrayItem)nil);
> 
> How do you suggest handling this issue?
> 
> -- Daniel.
> 
> [1]: https://github.com/gnustep/libobjc2/blob/master/objc/runtime.h#L207


Hi Daniel,

as I wrote before I think this is a bug on Apple’s side. nil should be an id, 
that is the whole purpose of this variable.
Are the compiler messages you get when compiling WebKit warnings or errors? If 
they are warnings we may just ignore them for now and only report a bug to 
WebKit. If it is an error we need a work around. How about a redefine in a 
specific header that only gets included when compiling Apple software?

Fred 


reply via email to

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