]> code.delx.au - gnu-emacs/commitdiff
* conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jan 2015 07:11:36 +0000 (23:11 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jan 2015 07:12:04 +0000 (23:12 -0800)
Apparently clang removed support for the alloc_size attribute.

src/ChangeLog
src/conf_post.h

index 817483be1fb3c532f427d2a3adb755a6b97919ab..7a98555cc9cdcdebb0b3a873da863f24b578212c 100644 (file)
@@ -1,5 +1,8 @@
 2015-01-08  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.
+       Apparently clang removed support for the alloc_size attribute.
+
        Port Qnil==0 XUNTAG to clang
        clang has undefined behavior if the program subtracts an integer
        from (char *) 0.  Problem reported by YAMAMOTO Mitsuharu in:
index 479d0448775c610c35c15d73148b77b88a7c8e6d..1a080fad635ae762ac92436bfd1a5757ac3d5370 100644 (file)
@@ -245,7 +245,9 @@ extern void _DebPrint (const char *fmt, ...);
 # define ATTRIBUTE_MALLOC
 #endif
 
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if (__clang__                                 \
+     ? __has_attribute (alloc_size)            \
+     : 4 < __GNUC__ + (3 <= __GNUC_MINOR__))
 # define ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
 #else
 # define ATTRIBUTE_ALLOC_SIZE(args)