Date: Fri, 28 Aug 2015 17:22:12 +0200 From: Tijl Coosemans <tijl@FreeBSD.org> To: "Pedro F. Giffuni" <pfg@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287254 - head/sys/sys Message-ID: <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org> In-Reply-To: <201508281406.t7SE6TYQ002370@repo.freebsd.org> References: <201508281406.t7SE6TYQ002370@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 28 Aug 2015 14:06:29 +0000 (UTC) "Pedro F. Giffuni" <pfg@FreeBSD.org> wrote: > Author: pfg > Date: Fri Aug 28 14:06:28 2015 > New Revision: 287254 > URL: https://svnweb.freebsd.org/changeset/base/287254 > > Log: > Be more GCC-friendly with attributes > > Being clang the default compiler, we were always giving precedence to > the __has_attribute check. Unfortunately clang generally doesn't support > the new attributes (alloc_size was briefly supported and then reverted) > so we were always doing both checks. Give the precedence to GCC as that is > the working case now. > > Do the same for __has_builtin() for consistency. > > Modified: > head/sys/sys/cdefs.h > > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015 (r287253) > +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) > @@ -237,12 +237,12 @@ > #define __aligned(x) __attribute__((__aligned__(x))) > #define __section(x) __attribute__((__section__(x))) > #endif > -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) I think you have to add underscores to the __has_attribute argument, like __alloc_size__ here, because user code is allowed to use alloc_size.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150828172212.1fcf0b53>