Date: Fri, 19 Jun 2015 18:24:28 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: Pedro Giffuni <pfg@freebsd.org> Cc: David Chisnall <theraven@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268137 - head/sys/sys Message-ID: <D58BE060-870A-4D5E-AE46-D915D9CD6A0C@FreeBSD.org> In-Reply-To: <55842F16.5040608@FreeBSD.org> References: <201407020845.s628jRG5031824@svn.freebsd.org> <5BE3492F-86A0-4CE3-A27C-8DB5EB662C64@FreeBSD.org> <55842F16.5040608@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 19 Jun 2015, at 17:02, Pedro Giffuni <pfg@freebsd.org> 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. E.g.: $ cpp -std=c99 #include <sys/cdefs.h> _Noreturn void foo(void); ^D # 1 "<stdin>" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 306 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "<stdin>" 2 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 2 "<stdin>" 2 __attribute__((__noreturn__)) void foo(void); $ cpp -std=c11 #include <sys/cdefs.h> _Noreturn void foo(void); ^D # 1 "<stdin>" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 306 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "<stdin>" 2 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 2 "<stdin>" 2 _Noreturn void foo(void); -Dimitry [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.27 iEYEARECAAYFAlWEQkcACgkQsF6jCi4glqOLEwCgm0iYzbR1RXTBj9C1aKoAwc7v /mQAn05toJtilS594omNeeYlgl+tfHH1 =Lgl0 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D58BE060-870A-4D5E-AE46-D915D9CD6A0C>
