Date: Fri, 10 Oct 2014 00:35:14 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272881 - in head/sys: conf sys Message-ID: <201410100035.s9A0ZE5n011135@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Fri Oct 10 00:35:13 2014 New Revision: 272881 URL: https://svnweb.freebsd.org/changeset/base/272881 Log: For gcc 4.6 and newer, _Static_assert is a keyword, so don't try to redefine it. It does what we want, and is always available unlike other alternatives. Modified: head/sys/conf/kern.mk head/sys/sys/cdefs.h Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Oct 10 00:35:08 2014 (r272880) +++ head/sys/conf/kern.mk Fri Oct 10 00:35:13 2014 (r272881) @@ -38,7 +38,7 @@ CWARNEXTRA?= -Wno-error-tautological-com # building with gcc 4.8 and newer. Nothing older has been tested. CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \ -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \ - -Wno-error=unused-local-typedefs -Wno-error=array-bounds -Wno-error=address \ + -Wno-error=array-bounds -Wno-error=address \ -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes .endif Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Oct 10 00:35:08 2014 (r272880) +++ head/sys/sys/cdefs.h Fri Oct 10 00:35:13 2014 (r272881) @@ -288,6 +288,8 @@ #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) +#elif __GNUC_PREREQ__(4,6) +/* Nothing, gcc 4.6 and higher has _Static_assert built-in */ #elif defined(__COUNTER__) #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) #define __Static_assert(x, y) ___Static_assert(x, y)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410100035.s9A0ZE5n011135>