From: Zbigniew Jędrzejewski-Szmek Date: Tue, 15 Mar 2016 23:27:28 +0000 (-0400) Subject: basic/macros: clang 3.5 doesn't support alloc_size X-Git-Tag: v231.3~214 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0d8ff5209903cc50cb2f39c95286cd7a5d62ada1;p=elogind.git 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. --- diff --git a/src/basic/macro.h b/src/basic/macro.h index b36a95675..e41aa4260 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -27,7 +27,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))