]> Savannah Git Hosting - gnulib.git/commitdiff
Use 'throw ()' for optimization in C++ mode also on clang.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2020 16:57:22 +0000 (18:57 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2020 16:57:22 +0000 (18:57 +0200)
* lib/cdefs.h (__THROW): Define to 'throw ()' also on clang.
* lib/getopt-cdefs.in.h (__THROW): Likewise.
* lib/md5.h (__THROW): Likewise.

ChangeLog
lib/cdefs.h
lib/getopt-cdefs.in.h
lib/md5.h

index c5f7fc5421a1820f2d3788c632a0cb543428f9ec..3182814f43554bbc5e545c9aa918c0262c6165a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-16  Bruno Haible  <bruno@clisp.org>
+
+       Use 'throw ()' for optimization in C++ mode also on clang.
+       * lib/cdefs.h (__THROW): Define to 'throw ()' also on clang.
+       * lib/getopt-cdefs.in.h (__THROW): Likewise.
+       * lib/md5.h (__THROW): Likewise.
+
 2020-08-16  Bruno Haible  <bruno@clisp.org>
 
        absolute-header: Add support for clang.
index dfa935fc8d4671547c18eea940393024aabe99f2..b7f60c18427582ff7fe5443425c0e5da2f53ddbe 100644 (file)
@@ -85,7 +85,7 @@
 #  define __NTH(fct)   __attribute__ ((__nothrow__ __LEAF)) fct
 #  define __NTHNL(fct)  __attribute__ ((__nothrow__)) fct
 # else
-#  if defined __cplusplus && __GNUC_PREREQ (2,8)
+#  if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
 #   define __THROW     throw ()
 #   define __THROWNL   throw ()
 #   define __NTH(fct)  __LEAF_ATTR fct throw ()
index 89a7b85edbe7246c16c973c8705a823d4b01fdfb..641e5e9a0ccfd58daff6a0963d16f84cce1421fc 100644 (file)
@@ -57,7 +57,7 @@
 #endif
 
 #ifndef __THROW
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
 #  define __THROW       throw ()
 # else
 #  define __THROW
index 0c8b9297455d663dd7e0033535f8006dcd0e4b9b..46310351c85d90ee16d6408f1178ec06247dcb81 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -40,7 +40,7 @@
 #endif
 
 #ifndef __THROW
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
 #  define __THROW       throw ()
 # else
 #  define __THROW