stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 28 Apr 2022 23:47:55 +0000 (01:47 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 28 Apr 2022 23:47:55 +0000 (01:47 +0200)
* lib/stdlib.in.h (free): Add exception specification like glibc does.

ChangeLog
lib/stdlib.in.h

index f111e479bf0d68b09a7b69a2392321a4258a5bde..b5e1a0498639c54fe1ed1835ce98c8bc2e0fb02f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-04-28  Simon Marchi  <simon.marchi@efficios.com>  (tiny change)
+
+       stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).
+       * lib/stdlib.in.h (free): Add exception specification like glibc does.
+
 2022-04-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        glob: improve config and test cleanup
index d52c2f796382fdcc49962db6357471d7fc91fd0b..a86643c3ca35ab7bd98d463dc08bfedb1f0d9841 100644 (file)
@@ -184,7 +184,11 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
 #   undef free
 #   define free rpl_free
 #  endif
+#  if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
+#  else
 _GL_FUNCDECL_RPL (free, void, (void *ptr));
+#  endif
 _GL_CXXALIAS_RPL (free, void, (void *ptr));
 # else
 _GL_CXXALIAS_SYS (free, void, (void *ptr));