diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-02-03 13:20:09 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-02-04 11:40:44 -0800 |
commit | 4e9bc44061b93871d9b0166e2c93ef4225fa1bac (patch) | |
tree | 507c5494941bc23a8d4214efb987bb9cf85cb558 /m4/gnulib-common.m4 | |
parent | 203dda3b86d5c9ac5a661d61038c284370448ca8 (diff) | |
download | gnulib-4e9bc44061b93871d9b0166e2c93ef4225fa1bac.tar.gz |
Port _Noreturn to older Clang
Problem reported by Jeffery Walton in:
https://lists.gnu.org/r/bug-gnulib/2020-02/msg00013.html
* lib/_Noreturn.h (_Noreturn):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Assume _Noreturn works in Clang 3.5 and later.
It is documented to work in Clang 3.5:
http://releases.llvm.org/3.5.0/tools/clang/docs/AttributeReference.html
and is not documented in Clang 3.4:
https://releases.llvm.org/3.4/tools/clang/docs/LanguageExtensions.html
Apple sets __clang_version__ to a different value, so use
__apple_build_version__ there. See:
https://lists.gnu.org/r/bug-gnulib/2020-02/msg00017.html
Diffstat (limited to 'm4/gnulib-common.m4')
-rw-r--r-- | m4/gnulib-common.m4 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 276ed1affa..b4795c18ae 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 47 +# gnulib-common.m4 serial 48 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,7 +31,10 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _Noreturn [[noreturn]] # elif ((!defined __cplusplus || defined __clang__) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))) + || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ + || (defined __apple_build_version__ \ + ? 6000000 <= __apple_build_version__ \ + : 3 < __clang_major__ + (5 <= __clang_minor__)))) /* _Noreturn works as-is. */ # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) |