From owner-svn-src-all@freebsd.org Fri Aug 28 14:06:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749589C476B; Fri, 28 Aug 2015 14:06:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB431B79; Fri, 28 Aug 2015 14:06:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SE6T3T002371; Fri, 28 Aug 2015 14:06:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SE6TYQ002370; Fri, 28 Aug 2015 14:06:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508281406.t7SE6TYQ002370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 28 Aug 2015 14:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287254 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2015 14:06:29 -0000 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) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #else #define __alloc_size(x) #endif -#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) +#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) @@ -382,7 +382,7 @@ #define __returns_twice #endif -#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) +#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) @@ -535,7 +535,7 @@ * well enough to use them in limited cases. */ #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial) #define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) #else #define __gnu_inline __attribute__((__gnu_inline__))