svn commit: r268137 - head/sys/sys

Hans Petter Selasky hps at selasky.org
Fri Jun 19 11:57:04 UTC 2015


On 06/19/15 13:42, David Chisnall wrote:
> On 19 Jun 2015, at 11:45, Hans Petter Selasky <hps at selasky.org> wrote:
>>
>> Appearently this will be fixed in GNUSTEP base:
>>
>> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/cdefs_elf.h?only_with_tag=MAIN
>>
>> Is this still an issue?
>
> It is impossible to fix it in GNUstep Base, because we can’t guarantee that user code doesn’t include system headers after including GNUstep headers (not to mention the fact that GNUstep is not the only Objective-C standard library implementation out there).  If the user does, for example:
>
> #import <Foundation/Foundation.h>
> #include <something_that_includes_cdefs.h>
>
> void example()
> {
> 	__weak id foo = bar();
> 	baz(foo);
> }
>

Hi,

> Then they will get a compile error no matter what GNUstep’s Foundation.h does.  It can’t prevent cdefs.h from redefining __weak to be something different.
>

Except "#undef __weak"

> I’ve just looked at the GNUstep base changelog since that NetBSD commit and there are no relevant changes, so I’ve no idea what the NetBSD people are thinking there.
>

I think we should have a common cross-BSD solution for the proper 
definition of __weak, so that user-space applications which use it 
follow along. Is there a procedure for that? Possibly we should do an 
exp-run after changing this to ensure that we don't break more than we fix.

I'll ask some GNUstep people I know about this.

--HPS



More information about the svn-src-head mailing list