summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-06-10 19:03:33 +0200
committerIvan Maidanski <ivmai@mail.ru>2013-06-10 19:03:33 +0200
commitd2a2e4d5274777fcecaf0a912e65520a34e10fd4 (patch)
treedcf1c7e16a2b77449fe0693e8bd54d70ba26285b
parentff8b8651529810f88f658a5d3a13c72e2f4f5f6a (diff)
Tag GC malloc routines with alloc_size attribute for Clang 3.2+
* include/gc_config_macros.h (GC_ATTR_ALLOC_SIZE): Define as alloc_size attribute for Clang 3.2+ as well.
-rw-r--r--include/gc_config_macros.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index 9d58900..42743d5 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -243,7 +243,9 @@
/* 'alloc_size' attribute improves __builtin_object_size correctness. */
/* Only single-argument form of 'alloc_size' attribute is used. */
# if defined(__GNUC__) && (__GNUC__ > 4 \
- || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 && !defined(__ICC)))
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 && !defined(__ICC)) \
+ || __clang_major__ > 3 \
+ || (__clang_major__ == 3 && __clang_minor__ >= 2))
# define GC_ATTR_ALLOC_SIZE(argnum) __attribute__((__alloc_size__(argnum)))
# else
# define GC_ATTR_ALLOC_SIZE(argnum)