From owner-svn-src-head@FreeBSD.ORG Fri Jun 19 16:48:00 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FE49FF for ; Fri, 19 Jun 2015 16:48:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm39-vm1.bullet.mail.bf1.yahoo.com (nm39-vm1.bullet.mail.bf1.yahoo.com [72.30.239.145]) (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 5B3F5286 for ; Fri, 19 Jun 2015 16:48:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1434732128; bh=v4NfqvvS9kOukn5vx5NtPG1n8RY8VD4I/LQzGOILXsE=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=EbyqBTxijZ/cus1iuSSUpWj/XxxfCsUgCyrc8ngrYlla9saQdw7vhy+wTX0LVsQ13ddEnsV5QUbYajNlADwP/V7247986A1wCM7EZFwMw81r7+0To6HC6yqXcnltzJKsApGGNuvmciZ3SD0/PMMrYEwEhuKIxrDaZUqXAgjr81fL6gKhFEizwhNzBC+44H9s1e2hrJwRsKLNBG51YRl/CiAgZfXFG7YAuzbyVFw1fGbyGgs5hzNVvXmoV4ojgzeSVTdI9ehrvr4huWJ1PyqmIClrGHshjMX6MG3cTy9atELB+afIhRXoDgUn22tnzPQESoFFmKrqbMQk1zwgHVInDA== Received: from [98.139.170.179] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jun 2015 16:42:08 -0000 Received: from [98.139.211.207] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jun 2015 16:42:08 -0000 Received: from [127.0.0.1] by smtp216.mail.bf1.yahoo.com with NNFMP; 19 Jun 2015 16:42:08 -0000 X-Yahoo-Newman-Id: 423021.7687.bm@smtp216.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zx_u4GAVM1lSjhyej1xBLa8S0Ltm0lGe2RUkUqazcyW0b6i RAEAB733pXty765RGlfKgZxU3pj18N6332or3gUidOEadYOWRW.uep8vQRZu jkYmrDrXGxmveAn9LxkTSZzX5RHTA38qMMApK.wn_xvt4BWd0b8CBU09._Mv jGcYl17un8wG75cfnGt983MqePUeiVPHZt2aC7Bam3zoMdM8OG7gaBJGTyju vG5iLiWLoClgWAkLe0MOON5aYk8gm9vWKSdLnidSTVm_YJf2uEBL.jBzqCpe nprgCMyO5lW13OQaEalF68HjH2GwKVY33BbYKr5Zi9GkH3nLIcmffx1VPDen 8gM3txJF1CTMRtoR7446.B4u6aC5iD150zVkkidAuOxX9WY4gfeuGxOOo4Z1 jmweIXlk.x8Jwmu9eD703JC1CYgcoiJDw_gjGkQtARFKLA7OY8ktnZkWH21d buv3z2K62N_kto9_Gp8VL2T0UVgJ_rIEQwdJf1KvQjCX1kg_wYUOwC78e1Yq hiWwB7DrDkZ3AhK.diUM7sPePXJ3bKQgl X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55844668.60204@FreeBSD.org> Date: Fri, 19 Jun 2015 11:42:16 -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: 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> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090003010508000202020705" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 16:48:00 -0000 This is a multi-part message in MIME format. --------------090003010508000202020705 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 06/19/15 11:24, 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. Oh yes, I had missed line 258 (and 320), sorry for the false alarm. FWIW, there is still a minor issue: older compilers aren't supposed to take __dead2 at the beginning. When i was discussing the attached patch, bde suggested we should resurrect __dead. Pedro. > E.g.: > > $ cpp -std=c99 > #include > _Noreturn void foo(void); > ^D > # 1 "" > # 1 "" 1 > # 1 "" 3 > # 306 "" 3 > # 1 "" 1 > # 1 "" 2 > # 1 "" 2 > # 1 "/usr/include/sys/cdefs.h" 1 3 4 > # 2 "" 2 > __attribute__((__noreturn__)) void foo(void); > > $ cpp -std=c11 > #include > _Noreturn void foo(void); > ^D > # 1 "" > # 1 "" 1 > # 1 "" 3 > # 306 "" 3 > # 1 "" 1 > # 1 "" 2 > # 1 "" 2 > # 1 "/usr/include/sys/cdefs.h" 1 3 4 > # 2 "" 2 > _Noreturn void foo(void); > > -Dimitry > --------------090003010508000202020705 Content-Type: text/x-patch; name="include_Noreturn.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="include_Noreturn.diff" Index: include/assert.h =================================================================== --- include/assert.h (revision 284138) +++ include/assert.h (working copy) @@ -72,7 +72,7 @@ #endif __BEGIN_DECLS -void __assert(const char *, const char *, int, const char *) __dead2; +_Noreturn void __assert(const char *, const char *, int, const char *); __END_DECLS #endif /* !_ASSERT_H_ */ Index: include/err.h =================================================================== --- include/err.h (revision 284138) +++ include/err.h (working copy) @@ -44,21 +44,20 @@ #include __BEGIN_DECLS -void err(int, const char *, ...) __dead2 __printf0like(2, 3); -void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0); -void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4); -void verrc(int, int, const char *, __va_list) __dead2 - __printf0like(3, 0); -void errx(int, const char *, ...) __dead2 __printf0like(2, 3); -void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0); -void warn(const char *, ...) __printf0like(1, 2); -void vwarn(const char *, __va_list) __printf0like(1, 0); -void warnc(int, const char *, ...) __printf0like(2, 3); -void vwarnc(int, const char *, __va_list) __printf0like(2, 0); -void warnx(const char *, ...) __printflike(1, 2); -void vwarnx(const char *, __va_list) __printflike(1, 0); -void err_set_file(void *); -void err_set_exit(void (*)(int)); +_Noreturn void err(int, const char *, ...) __printf0like(2, 3); +_Noreturn void verr(int, const char *, __va_list) __printf0like(2, 0); +_Noreturn void errc(int, int, const char *, ...) __printf0like(3, 4); +_Noreturn void verrc(int, int, const char *, __va_list) __printf0like(3, 0); +_Noreturn void errx(int, const char *, ...) __printf0like(2, 3); +_Noreturn void verrx(int, const char *, __va_list) __printf0like(2, 0); +void warn(const char *, ...) __printf0like(1, 2); +void vwarn(const char *, __va_list) __printf0like(1, 0); +void warnc(int, const char *, ...) __printf0like(2, 3); +void vwarnc(int, const char *, __va_list) __printf0like(2, 0); +void warnx(const char *, ...) __printflike(1, 2); +void vwarnx(const char *, __va_list) __printflike(1, 0); +void err_set_file(void *); +void err_set_exit(void (*)(int)); __END_DECLS #endif /* !_ERR_H_ */ Index: include/pthread.h =================================================================== --- include/pthread.h (revision 284138) +++ include/pthread.h (working copy) @@ -199,7 +199,7 @@ void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); -void pthread_exit(void *) __dead2; +_Noreturn void pthread_exit(void *); void *pthread_getspecific(pthread_key_t); int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); Index: include/setjmp.h =================================================================== --- include/setjmp.h (revision 284138) +++ include/setjmp.h (working copy) @@ -45,17 +45,17 @@ __BEGIN_DECLS #if __BSD_VISIBLE || __XSI_VISIBLE >= 600 -void _longjmp(jmp_buf, int) __dead2; -int _setjmp(jmp_buf) __returns_twice; +_Noreturn void _longjmp(jmp_buf, int); +int _setjmp(jmp_buf) __returns_twice; #endif -void longjmp(jmp_buf, int) __dead2; +_Noreturn void longjmp(jmp_buf, int); #if __BSD_VISIBLE -void longjmperror(void); +void longjmperror(void); #endif -int setjmp(jmp_buf) __returns_twice; +int setjmp(jmp_buf) __returns_twice; #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -void siglongjmp(sigjmp_buf, int) __dead2; -int sigsetjmp(sigjmp_buf, int) __returns_twice; +_Noreturn void siglongjmp(sigjmp_buf, int); +int sigsetjmp(sigjmp_buf, int) __returns_twice; #endif __END_DECLS Index: include/stdlib.h =================================================================== --- include/stdlib.h (revision 284138) +++ include/stdlib.h (working copy) @@ -249,7 +249,7 @@ void *alloca(size_t); #endif -void abort2(const char *, int, void **) __dead2; +_Noreturn void abort2(const char *, int, void **); __uint32_t arc4random(void); void arc4random_addrandom(unsigned char *, int); Index: include/unistd.h =================================================================== --- include/unistd.h (revision 284138) +++ include/unistd.h (working copy) @@ -318,7 +318,7 @@ __BEGIN_DECLS /* 1003.1-1990 */ -void _exit(int) __dead2; +_Noreturn void _exit(int); int access(const char *, int); unsigned int alarm(unsigned int); int chdir(const char *); --------------090003010508000202020705--