Re: svn commit: r228330 - in head: include sys/sys
On 11 Dec 2011, at 21:12, Andreas Tobler wrote: As far as I understand, GCC does not support this attribute [[noreturn]] yet. But it defines both, __cplusplus and __cplusplus=201103L. On gcc-4.7 __cplusplus=201103L is the default when we build libstdc++. Advertising C++11 compatibility and then not supporting fairly simple C++11 features seems like a pretty major GCC bug. So I think we have to extend the check as below or we can reorder the defines that GNUC is before the __cplusplus __cplusplus= 201103L. I'd rather prefer the standard version to the non-standard version, but maybe we can add an extra check to see if your compiler incompetent. David___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r228330 - in head: include sys/sys
On Sun, Dec 11, 2011, David Chisnall wrote: On 11 Dec 2011, at 21:12, Andreas Tobler wrote: As far as I understand, GCC does not support this attribute [[noreturn]] yet. But it defines both, __cplusplus and __cplusplus=201103L. On gcc-4.7 __cplusplus=201103L is the default when we build libstdc++. Advertising C++11 compatibility and then not supporting fairly simple C++11 features seems like a pretty major GCC bug. So I think we have to extend the check as below or we can reorder the defines that GNUC is before the __cplusplus __cplusplus= 201103L. I'd rather prefer the standard version to the non-standard version, but maybe we can add an extra check to see if your compiler incompetent. The reality is that none of the open source compilers even fully support C99. We try to make sure the FreeBSD headers don't blow up with other compilers, although some of the support for the Intel compiler and ancient versions of gcc has rotted. It is ugly at times, but many of the compiler-specific details are abstracted away in macros in sys/cdefs.h. Note that for the POSIX/XSI/C standards, we actually define our own visibility macros, because the standard ones are such a mess. We will presumably need one for C1X soon. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r228330 - in head: include sys/sys
* David Chisnall thera...@freebsd.org, 20111207 22:17: As per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is an identifier reserved for the implementation in C99 and earlier so there is no sensible reason for introducing yet another reserved identifier when we could just use the one C1x uses. So this is the same as __dead2, right? Maybe we should do a sweep of the tree and replace all __dead2's by _Noreturn? -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ pgp4aakqdFdqD.pgp Description: PGP signature
svn commit: r228330 - in head: include sys/sys
Author: theraven Date: Wed Dec 7 21:17:50 2011 New Revision: 228330 URL: http://svn.freebsd.org/changeset/base/228330 Log: As per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is an identifier reserved for the implementation in C99 and earlier so there is no sensible reason for introducing yet another reserved identifier when we could just use the one C1x uses. Approved by: brooks (mentor) Modified: head/include/stdlib.h head/sys/sys/cdefs.h Modified: head/include/stdlib.h == --- head/include/stdlib.h Wed Dec 7 21:02:35 2011(r228329) +++ head/include/stdlib.h Wed Dec 7 21:17:50 2011(r228330) @@ -76,7 +76,7 @@ extern int __mb_cur_max; extern int ___mb_cur_max(void); #defineMB_CUR_MAX (___mb_cur_max()) -__noreturn void abort(void); +_Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); double atof(const char *); @@ -86,7 +86,7 @@ void *bsearch(const void *, const void * size_t, int (*)(const void *, const void *)); void *calloc(size_t, size_t) __malloc_like; div_t div(int, int) __pure2; -__noreturn void exit(int); +_Noreturn void exit(int); voidfree(void *); char *getenv(const char *); longlabs(long) __pure2; @@ -145,14 +145,14 @@ unsigned long long strtoull(const char * __restrict, char ** __restrict, int); #endif /* __LONG_LONG_SUPPORTED */ -__noreturn void _Exit(int); +_Noreturn void _Exit(int); #endif /* __ISO_C_VISIBLE = 1999 */ /* * If we're in a mode greater than C99, expose C1x functions. */ #if __ISO_C_VISIBLE 1999 -__noreturn void quick_exit(int) +_Noreturn void quick_exit(int) int at_quick_exit(void (*func)(void)); #endif /* __ISO_C_VISIBLE 1999 */ Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hWed Dec 7 21:02:35 2011(r228329) +++ head/sys/sys/cdefs.hWed Dec 7 21:17:50 2011(r228330) @@ -220,13 +220,13 @@ #if defined(__cplusplus) __cplusplus = 201103L -#define__noreturn [[noreturn]] +#define_Noreturn [[noreturn]] #elif defined(__STDC_VERSION__) __STDC_VERSION__ 201000L -#define__noreturn _Noreturn +/* Do nothing - _Noreturn is a keyword */ #elif defined(__GNUC__) -#define__noreturn __attribute__((__noreturn__)) +#define_Noreturn __attribute__((__noreturn__)) #else -#define__noreturn +#define_Noreturn #endif #if __GNUC_PREREQ__(2, 96) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org