Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 10:29:41 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        Tijl Coosemans <tijl@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:  <55E07E65.9020802@FreeBSD.org>
In-Reply-To: <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org>
References:  <201508281406.t7SE6TYQ002370@repo.freebsd.org> <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 08/28/15 10:22, Tijl Coosemans wrote:
> 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.
>

Hmm .. yes, it certainly won't hurt.

Thanks!

Pedro.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55E07E65.9020802>