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: Ivan Vučica
Subject: Re: libobjc: should nil be an id?
Date: Tue, 01 Aug 2017 06:46:58 +0000

Maybe clang treats 'nil' specially and it does not have to be #define'd?

But I would like to know about assumptions WebKit makes and what kind of errors you get. And what type does WebKit exactly expect nil to be?


On Tue, Aug 1, 2017, 07:01 Fred Kiefer <address@hidden> wrote:

> 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
_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev

reply via email to

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