Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jun 2015 13:54:15 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r268137 - head/sys/sys
Message-ID:  <FE96503D-D821-4B7F-8AA5-7A80E4051CFA@FreeBSD.org>
In-Reply-To: <558403C4.4040500@selasky.org>
References:  <201407020845.s628jRG5031824@svn.freebsd.org> <5BE3492F-86A0-4CE3-A27C-8DB5EB662C64@FreeBSD.org> <5583F2C9.1030409@selasky.org> <1EB851FC-CA78-4A7B-BE5D-4F050C61A14C@FreeBSD.org> <558403C4.4040500@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19 Jun 2015, at 12:57, Hans Petter Selasky <hps@selasky.org> wrote:
>=20
> Hi,
>=20
>> Then they will get a compile error no matter what GNUstep=E2=80=99s =
Foundation.h does.  It can=E2=80=99t prevent cdefs.h from redefining =
__weak to be something different.
>>=20
>=20
> Except "#undef __weak=E2=80=9D

Please read the example that I wrote.  This will *not* be fixed by =
#undef __weak.  In particular, the __weak keyword is implemented in =
Clang as a pre-defined macro, so after *any* inclusion of any C standard =
library header, every program that uses zeroing weak references needs to =
redefine __weak to whatever (implementation-defined and subject to =
change thing) that the compiler defines it to.

>> I=E2=80=99ve just looked at the GNUstep base changelog since that =
NetBSD commit and there are no relevant changes, so I=E2=80=99ve no idea =
what the NetBSD people are thinking there.
>>=20
>=20
> 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.

Portable code should not rely on anything in cdefs.h.

> 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=E2=80=99m not sure what we have any code in ports yet that uses ARC or =
GC in Objective-C, but I definitely know of people building out-of-ports =
programs on FreeBSD whose code you have just broken (including myself, =
though I do Objective-C stuff on 10, so haven=E2=80=99t yet encountered =
the breakage).

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

Taking off my FreeBSD Core Team hat and putting on my GNUstep libobjc =
maintainer hat: Please fix this and do not define C-family language =
keywords or compiler reserved words to be incompatible things in =
cdefs.h.

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE96503D-D821-4B7F-8AA5-7A80E4051CFA>