From: Ivan Maidanski Date: Mon, 10 Jun 2013 17:03:33 +0000 (+0400) Subject: Tag GC malloc routines with alloc_size attribute for Clang 3.2+ X-Git-Tag: gc7_4_0~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2a2e4d5274777fcecaf0a912e65520a34e10fd4;p=gc 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. --- diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 9d589007..42743d59 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)