[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master ce5c361: * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master ce5c361: * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0. |
Date: |
Thu, 08 Jan 2015 07:12:08 +0000 |
branch: master
commit ce5c361c14c3fd5c06d48aa1c4bfa05c47c249f0
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
* conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.
Apparently clang removed support for the alloc_size attribute.
---
src/ChangeLog | 3 +++
src/conf_post.h | 4 +++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 817483b..7a98555 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2015-01-08 Paul Eggert <address@hidden>
+ * 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:
diff --git a/src/conf_post.h b/src/conf_post.h
index 479d044..1a080fa 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master ce5c361: * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.,
Paul Eggert <=