From owner-svn-src-head@freebsd.org Thu Aug 27 14:00:24 2015 Return-Path: Delivered-To: svn-src-head@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 25F0C9C2C6B; Thu, 27 Aug 2015 14:00:24 +0000 (UTC) (envelope-from kan@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 F27A117DC; Thu, 27 Aug 2015 14:00:23 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RE0NXk071390; Thu, 27 Aug 2015 14:00:23 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RE0Nbc071389; Thu, 27 Aug 2015 14:00:23 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201508271400.t7RE0Nbc071389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 27 Aug 2015 14:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287206 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2015 14:00:24 -0000 Author: kan Date: Thu Aug 27 14:00:23 2015 New Revision: 287206 URL: https://svnweb.freebsd.org/changeset/base/287206 Log: Repair sys/cdefs.h enough to be usable with GCC 5.x The __alloc_size and __alloc_align need to be defined to nothingness for lint, but the existing check is deficient and allows attributes with working __has_attrubute() to slip through. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Aug 27 14:00:20 2015 (r287205) +++ head/sys/sys/cdefs.h Thu Aug 27 14:00:23 2015 (r287206) @@ -39,7 +39,6 @@ /* * Testing against Clang-specific extensions. */ - #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -212,6 +211,8 @@ #define __unused #define __packed #define __aligned(x) +#define __alloc_align(x) +#define __alloc_size(x) #define __section(x) #define __weak_symbol #else @@ -236,6 +237,16 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#define __alloc_size(x) __attribute__((__alloc_size__(x))) +#else +#define __alloc_size(x) +#endif +#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) +#define __alloc_align(x) __attribute__((__alloc_align__(x))) +#else +#define __alloc_align(x) +#endif #endif /* lint */ #if !__GNUC_PREREQ__(2, 95) @@ -371,24 +382,12 @@ #define __returns_twice #endif -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) -#define __alloc_size(x) __attribute__((__alloc_size__(x))) -#else -#define __alloc_size(x) -#endif - #if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) #endif -#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) -#define __alloc_align(x) __attribute__((__alloc_align__(x))) -#else -#define __alloc_align(x) -#endif - /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) #define __func__ NULL