From owner-svn-src-all@FreeBSD.ORG Sun Jun 21 01:15:42 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 402C71F3 for ; Sun, 21 Jun 2015 01:15:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm28.bullet.mail.bf1.yahoo.com (nm28.bullet.mail.bf1.yahoo.com [98.139.212.187]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD86EF65 for ; Sun, 21 Jun 2015 01:15:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1434849339; bh=BrK1jYP+5GzzVJIiEw3NvM879S/6YQvRYXOCi/lonWU=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=LQZTEyZ+Ln1/3Vai5cgcI5XynprUmCWDZCt05fVsTZUILMh01hObsYBEdjr+LH88JNM0NMKwvMBiXCw7W3rF73GQwFEsAT82c8GN2jIQZiL/ZO3cwFoK5D5CiMQ91lzK8iYwwGU4sDXXXn2dxSdGZEO/k6CR8qQp/Pxx8BnP6w7QM1ZsGTLocryjzizcCV2NzDxlLQB2CdBHmn50cRfF3rzAqSj6E4xKzF5sTQ0ECxHJcgmzxfYlje5/ugm4NskiGRj8bU2LlPHWAv6GnaHjuGbzWJAcK1AIV/WvICRfGdfTMJh34k+l217sjSCHkFOxKpBgncM620HOIC2yR9aQlQ== Received: from [98.139.170.180] by nm28.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jun 2015 01:15:39 -0000 Received: from [68.142.230.71] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jun 2015 01:15:39 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 21 Jun 2015 01:15:39 -0000 X-Yahoo-Newman-Id: 504158.16384.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4oLYOaAVM1lrqAUAz8jvDVEn.HbHGDGzsdkK5.6JT.xrcWy OGJA_divAvpjtSkmhTiwchouZucStaIMG0V_PR0ON8lel0Ey4TbJ01U3LRJl OGqNqWg2swW6Lm3remiHAxieDSietwRtduFsyHUXP82ZMdXge6hakgVFfyAr tp.SYzrmeqZFbbpTwqiGcSaQksFQm0JQp1j2E2zZdwPb20HoFqs5OtSFT9dx NoGJ36YCAteBoVtP7HOt4OlLPLUk7Hna5Fo9MwarX5JoFRZOe1kagO75RpZk ouVxXvnHNH1KYPDKs.aBj1y8urkNh1EFv31cy_G8hJwGei435q3WTqzVEHJr rU96wnwzuBPcs_fRXH8Xkvv7IQ3vTHroyp8dkLi0td3g.uY2Gktn.XqWw518 Slssk_a6EtfbqMbaSsXf7OPsA92MZkMUuictgqP3tD1He7wsaIpsKTjUEaYj ljkx56139uKrAArXGdLFQ6a.ewN.rjcwhbeKOoz6lvIMddfrlhp2aXdwOz98 0.s04tVHI87VHMLFDVeH4.B7hK5wzQ044 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55861046.4050501@FreeBSD.org> Date: Sat, 20 Jun 2015 20:15:50 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Bruce Evans , Dimitry Andric CC: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268137 - head/sys/sys References: <201407020845.s628jRG5031824@svn.freebsd.org> <5BE3492F-86A0-4CE3-A27C-8DB5EB662C64@FreeBSD.org> <55842F16.5040608@FreeBSD.org> <20150620023835.N2562@besplex.bde.org> In-Reply-To: <20150620023835.N2562@besplex.bde.org> Content-Type: multipart/mixed; boundary="------------010609030301090209060008" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2015 01:15:42 -0000 This is a multi-part message in MIME format. --------------010609030301090209060008 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 06/19/15 12:23, Bruce Evans wrote: > On Fri, 19 Jun 2015, Dimitry Andric wrote: > >> On 19 Jun 2015, at 17:02, Pedro Giffuni wrote: >>> >>>> On 19/06/2015 05:16 a.m., David Chisnall wrote: >>>>> I only just caught this (having seen the fallout from NetBSD doing >>>>> the same thing in a shipping release and the pain that it’s caused): >>>>> >>>>> __weak is a reserved keyword in Objective-C, please pick another >>>>> name for this. This in cdefs.h makes it impossible to include any >>>>> FreeBSD standard headers in Objective-C programs (of which we have >>>>> a couple of hundred in ports) if they use any of the modern >>>>> Objective-C language modes. >> ... >>> Closely related to this, we are redefining _Noreturn, which is a >>> reserved keyword in C11. >> >> No, sys/cdefs.h has: >> >> 254 /* >> 255 * Keywords added in C11. >> 256 */ >> 257 >> 258 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L >> || defined(lint) >> [...] >> 284 #if defined(__cplusplus) && __cplusplus >= 201103L >> 285 #define _Noreturn [[noreturn]] >> 286 #else >> 287 #define _Noreturn __dead2 >> 288 #endif >> [...] >> 320 #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ >> >> So the whole block redefining all the _Xxx identifiers is skipped for >> C11 and higher. > > I probably pointed this out incorrectly to Pedro. > > All uses of _Noreturn are still broken, and also ugly. __dead2 is the > gcc-2 compatible version of the gcc-1 compatible macro __dead. It is > syntactically different from __dead and _Noreturn. It must be placed > after the function parameter list instead of in the function type > declarator because old versions of gcc only accept attributes there. > __dead and presumably _Noreturn must be placed in the function type > declarator. This is incompatible, and also uglier. > I was thinking that _Noreturn can be fixed for older compilers less disruptively. I haven't tested the attached patch the idea is to resurrect __dead and use it for _Noreturn. > Correct version with ugly declarations: > > __dead void > foo(void) __dead2; > With the patch we would use: __Noreturn void foo(void) _dead2; Which is still ugly but C11-ish. Pedro. --------------010609030301090209060008 Content-Type: text/x-patch; name="dead.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dead.diff" Index: sys/sys/cdefs.h =================================================================== --- sys/sys/cdefs.h (revision 284643) +++ sys/sys/cdefs.h (working copy) @@ -207,6 +207,7 @@ * a feature that we cannot live without. */ #ifdef lint +#define __dead #define __dead2 #define __pure2 #define __unused @@ -217,11 +218,13 @@ #else #define __weak __attribute__((__weak__)) #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) +#define __dead __volatile #define __dead2 #define __pure2 #define __unused #endif #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) +#define __dead __attribute__((__noreturn__)) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused @@ -284,7 +287,7 @@ #if defined(__cplusplus) && __cplusplus >= 201103L #define _Noreturn [[noreturn]] #else -#define _Noreturn __dead2 +#define _Noreturn __dead #endif #if !__has_extension(c_static_assert) --------------010609030301090209060008--