From 26e9e10b39fdf343dcb7e11b6cb4eecf11a45970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 15 Mar 2016 19:27:28 -0400 Subject: [PATCH] basic/macros: clang 3.5 doesn't support alloc_size The attribute was removed in commit c047507 in the clang repository as it was never properly implemented anyway. Avoid using the attribute with clang because it generates a ton of annoying warnings. --- src/basic/macro.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/basic/macro.h b/src/basic/macro.h index c34441d75dc..279d3f3f083 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -26,7 +26,11 @@ #include #define _printf_(a,b) __attribute__ ((format (printf, a, b))) -#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) +#ifdef __clang__ +# define _alloc_(...) +#else +# define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) +#endif #define _sentinel_ __attribute__ ((sentinel)) #define _unused_ __attribute__ ((unused)) #define _destructor_ __attribute__ ((destructor))