summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-01-21 13:40:16 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-01-21 17:09:58 -0800
commit605e20a698d3f7296cda18ac7dd84b1a8f388b50 (patch)
tree1e175acc33337e6fb6f29e8e0e7c2eb310c340a7 /m4
parent65f62234c816cae5a0f42fc02c9edb94b5a2f72a (diff)
downloadgnulib-605e20a698d3f7296cda18ac7dd84b1a8f388b50.tar.gz
Port FALLTHROUGH to clang 3.4 and earlier
Problem reported by Akim Demaille in: https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html * lib/cdefs.h (__glibc_has_attribute): * m4/gnulib-common.m4 (gl_COMMON_BODY): Do not trust __has_attribute in clang 3.4 and earlier, as <https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html> says that __has_attribute is unreliable in these old versions.
Diffstat (limited to 'm4')
-rw-r--r--m4/gnulib-common.m44
1 files changed, 3 insertions, 1 deletions
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 3d87fd840a..f2eff10de6 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -67,7 +67,9 @@ AC_DEFUN([gl_COMMON_BODY], [
#endif])
AH_VERBATIM([attribute],
[/* Attributes. */
-#ifdef __has_attribute
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || 3 < __clang_major__ + (5 <= __clang_minor__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr