discuss-gnustep
[Top][All Lists]
Advanced

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

Re: issue with auto-enable of Menus


From: David Chisnall
Subject: Re: issue with auto-enable of Menus
Date: Mon, 13 Nov 2017 10:24:21 +0000

On 13 Nov 2017, at 08:17, Wolfgang Lux <wolfgang.lux@gmail.com> wrote:
> 
> While sel_isEqual is just an alias for == on Apple's runtime (and the GNUstep 
> runtime, I assume), this need not be the case for other runtimes. In 
> particular, for the old GNU runtime sel_isEqual is not equivalent to ==, as 
> you've observed.

It’s also not == on the GNUstep runtime, and can’t easily be with a new ABI if 
we want it to work on ELF / COFF platforms.  Apple relies on the run-time 
linker deduplicating their selector table and inserting selectors into a 
contiguous region of memory.  

With the GNUstep (or GCC) runtime, == will work if both selectors are defined 
(i.e. created from @selector, or from a caller setting the _cmd parameter) in 
the same compilation unit.  With the new ABI that’s I’m (intermittently) 
working on, it will work in the same DSO, but in both cases it’s fragile.

Clang will warn if you do == comparisons on selectors (even on OS X), so I’m 
surprised that this code has survived the last few years.

PSA: Even if you really like GCC and want to use GCC for all of your shipping 
code, please make sure that it compiles with clang -Werror before spending ages 
trying to figure out why it’s broken.  The clang static analyser will also find 
a load more common bugs in Objective-C.

David




reply via email to

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