From 2b092a1664ce6b9014f01e5378434995cd105336 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Fri, 27 Mar 2015 02:01:22 +0000 Subject: [PATCH] Fix __size_alloc() Use underscore for the attributes name: this should fix the use of the attributes in macros for lint(1). Suggested by: bde X-MFC with: r280700 --- sys/sys/cdefs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index b9633457f8d6..95f3699bebf1 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -212,7 +212,6 @@ #define __unused #define __packed #define __aligned(x) -#define __alloc_size(...) #define __section(x) #define __weak #else @@ -237,11 +236,6 @@ #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(...) __attribute__((alloc_size(__VA_ARGS__))) -#else -#define __alloc_size(...) -#endif #if defined(__INTEL_COMPILER) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) @@ -384,6 +378,12 @@ #define __returns_twice #endif +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#define __alloc_size(...) __attribute__((__alloc_size__(__VA_ARGS__))) +#else +#define __alloc_size(...) +#endif + /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) #define __func__ NULL