Tag GC malloc routines with alloc_size attribute for Clang 3.2+
authorIvan Maidanski <ivmai@mail.ru>
Mon, 10 Jun 2013 17:03:33 +0000 (21:03 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 10 Jun 2013 17:03:33 +0000 (21:03 +0400)
* include/gc_config_macros.h (GC_ATTR_ALLOC_SIZE): Define as alloc_size
attribute for Clang 3.2+ as well.

include/gc_config_macros.h

index 9d58900..42743d5 100644 (file)
   /* '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)