summaryrefslogtreecommitdiff
path: root/lib/stdlib.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib.in.h')
-rw-r--r--lib/stdlib.in.h410
1 files changed, 249 insertions, 161 deletions
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index e74e7c18..6667f426 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -20,12 +20,27 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+#if ((defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) \
+ || defined __need_malloc_and_calloc) \
+ && !defined __SUNPRO_CC
/* Special invocation conventions inside some gnulib header files,
- and inside some glibc header files, respectively. */
+ and inside some glibc header files, respectively.
+ Do not recognize this special invocation convention when GCC's
+ c++/11/stdlib.h is being included or has been included. This is needed
+ to support the use of clang+llvm binaries on Ubuntu 22.04 with
+ CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
+ -I/usr/include/x86_64-linux-gnu/c++/11
+ -L/usr/lib/gcc/x86_64-linux-gnu/11
+ -Wl,-rpath,$clangdir/lib"
+ because in this case /usr/include/c++/11/stdlib.h (which does not support
+ the convention) is seen before the gnulib-generated stdlib.h. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+/* Make sure that the macros that indicate the special invocation convention
+ get undefined. This is needed at least on CentOS 7. */
+#undef __need_malloc_and_calloc
+
#else
/* Normal invocation convention. */
@@ -38,8 +53,8 @@
#define _@GUARD_PREFIX@_STDLIB_H
/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
- _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+ _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -104,11 +119,22 @@ struct random_data
# include <unistd.h>
#endif
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
+ below, this may cause compilation errors later in the libstdc++ header files
+ (that are part of GCC), such as:
+ error: 'rpl_strtol' is not a member of 'std'
+ To avoid this, include the relevant header files here, before these symbols
+ get defined as macros. But do so only on Solaris 11 (where it is needed),
+ not on mingw (where it would cause other compilation errors). */
+# include <string>
+#endif
+
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -137,7 +163,7 @@ struct random_data
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -196,11 +222,11 @@ struct random_data
# undef _Exit
# define _Exit rpl__Exit
# endif
-_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status));
+_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), );
_GL_CXXALIAS_RPL (_Exit, void, (int status));
# else
# if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), );
# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
# endif
@@ -216,6 +242,26 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
#endif
+#if @GNULIB_ABORT_DEBUG@
+/* Terminates the current process with signal SIGABRT.
+ Note: While the original abort() function is safe to call in signal handlers,
+ the overridden abort() function is not. */
+# if @REPLACE_ABORT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef abort
+# define abort rpl_abort
+# endif
+_GL_FUNCDECL_RPL (abort, _Noreturn void, (void), );
+_GL_CXXALIAS_RPL (abort, void, (void));
+# else
+_GL_CXXALIAS_SYS (abort, void, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (abort);
+# endif
+#endif
+
+
#if @GNULIB_FREE_POSIX@
# if @REPLACE_FREE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -223,9 +269,9 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# define free rpl_free
# endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
-_GL_FUNCDECL_RPL (free, void, (void *ptr) _GL_ATTRIBUTE_NOTHROW);
+_GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
# else
-_GL_FUNCDECL_RPL (free, void, (void *ptr));
+_GL_FUNCDECL_RPL (free, void, (void *ptr), );
# endif
_GL_CXXALIAS_RPL (free, void, (void *ptr));
# else
@@ -250,22 +296,25 @@ _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
# define aligned_alloc rpl_aligned_alloc
# endif
_GL_FUNCDECL_RPL (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
# else
# if @HAVE_ALIGNED_ALLOC@
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
@@ -275,16 +324,17 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
_GL_CXXALIASWARN (aligned_alloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
+ (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -301,9 +351,10 @@ _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
/* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */
# if !@HAVE_ATOLL@
-_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
- _GL_ATTRIBUTE_PURE
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (atoll, long long,
+ (const char *string),
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll);
@@ -323,21 +374,24 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
# define calloc rpl_calloc
# endif
_GL_FUNCDECL_RPL (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
@@ -346,16 +400,17 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
_GL_CXXALIASWARN (calloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
+ (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -373,23 +428,26 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
# define canonicalize_file_name rpl_canonicalize_file_name
# endif
_GL_FUNCDECL_RPL (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
# else
-# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+# if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
@@ -400,18 +458,19 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
# endif
_GL_CXXALIASWARN (canonicalize_file_name);
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined canonicalize_file_name
/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -503,12 +562,12 @@ _GL_CXXALIASWARN (gcvt);
# undef getloadavg
# define getloadavg rpl_getloadavg
# endif
-_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
# else
# if !@HAVE_DECL_GETLOADAVG@
-_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
@@ -533,17 +592,17 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# define getprogname rpl_getprogname
# endif
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
-_GL_FUNCDECL_RPL (getprogname, const char *, (void));
+_GL_FUNCDECL_RPL (getprogname, const char *, (void), );
# endif
_GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else
# if !@HAVE_GETPROGNAME@
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
-_GL_FUNCDECL_SYS (getprogname, const char *, (void));
+_GL_FUNCDECL_SYS (getprogname, const char *, (void), );
# endif
# endif
_GL_CXXALIAS_SYS (getprogname, const char *, (void));
@@ -577,15 +636,15 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
# define getsubopt rpl_getsubopt
# endif
_GL_FUNCDECL_RPL (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
# else
# if !@HAVE_GETSUBOPT@
_GL_FUNCDECL_SYS (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
@@ -605,7 +664,7 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
/* Change the ownership and access permission of the slave side of the
pseudo-terminal whose master side is specified by FD. */
# if !@HAVE_GRANTPT@
-_GL_FUNCDECL_SYS (grantpt, int, (int fd));
+_GL_FUNCDECL_SYS (grantpt, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (grantpt, int, (int fd));
_GL_CXXALIASWARN (grantpt);
@@ -630,21 +689,24 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
# define malloc rpl_malloc
# endif
_GL_FUNCDECL_RPL (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
@@ -653,16 +715,17 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
_GL_CXXALIASWARN (malloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
+ (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -698,7 +761,7 @@ int gl_MB_CUR_MAX (void)
# endif
_GL_FUNCDECL_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
- size_t len)
+ size_t len),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
@@ -727,13 +790,13 @@ _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
# define mbtowc rpl_mbtowc
# endif
_GL_FUNCDECL_RPL (mbtowc, int,
- (wchar_t *restrict pwc, const char *restrict s, size_t n));
+ (wchar_t *restrict pwc, const char *restrict s, size_t n), );
_GL_CXXALIAS_RPL (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n));
# else
# if !@HAVE_MBTOWC@
_GL_FUNCDECL_SYS (mbtowc, int,
- (wchar_t *restrict pwc, const char *restrict s, size_t n));
+ (wchar_t *restrict pwc, const char *restrict s, size_t n), );
# endif
_GL_CXXALIAS_SYS (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n));
@@ -756,7 +819,9 @@ _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */
# if !@HAVE_MKDTEMP@
-_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkdtemp, char *,
+ (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp);
@@ -786,13 +851,13 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
# undef mkostemp
# define mkostemp rpl_mkostemp
# endif
-_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMP@
-_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
# endif
@@ -827,15 +892,15 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
# define mkostemps rpl_mkostemps
# endif
_GL_FUNCDECL_RPL (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMPS@
_GL_FUNCDECL_SYS (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
@@ -865,11 +930,13 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkstemp rpl_mkstemp
# endif
-_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
# else
# if ! @HAVE_MKSTEMP@
-_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif
@@ -894,8 +961,8 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
# if !@HAVE_MKSTEMPS@
-_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps);
@@ -931,8 +998,8 @@ _GL_CXXALIASWARN (mktemp);
# define posix_memalign rpl_posix_memalign
# endif
_GL_FUNCDECL_RPL (posix_memalign, int,
- (void **memptr, size_t alignment, size_t size)
- _GL_ARG_NONNULL ((1)));
+ (void **memptr, size_t alignment, size_t size),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_memalign, int,
(void **memptr, size_t alignment, size_t size));
# else
@@ -960,11 +1027,11 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
# undef posix_openpt
# define posix_openpt rpl_posix_openpt
# endif
-_GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
+_GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
# else
# if !@HAVE_POSIX_OPENPT@
-_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
# endif
@@ -987,11 +1054,11 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
# undef ptsname
# define ptsname rpl_ptsname
# endif
-_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
# else
# if !@HAVE_PTSNAME@
-_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
# endif
@@ -1013,11 +1080,11 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
# undef ptsname_r
# define ptsname_r rpl_ptsname_r
# endif
-_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), );
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
# else
# if !@HAVE_PTSNAME_R@
-_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), );
# endif
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
# endif
@@ -1039,7 +1106,7 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
# undef putenv
# define putenv rpl_putenv
# endif
-_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (putenv, int, (char *string));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1098,7 +1165,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
# endif
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
@@ -1106,7 +1174,8 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
# if !@HAVE_QSORT_R@
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
# endif
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
@@ -1137,7 +1206,7 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
# undef rand
# define rand rpl_rand
# endif
-_GL_FUNCDECL_RPL (rand, int, (void));
+_GL_FUNCDECL_RPL (rand, int, (void), );
_GL_CXXALIAS_RPL (rand, int, (void));
# else
_GL_CXXALIAS_SYS (rand, int, (void));
@@ -1154,11 +1223,11 @@ _GL_CXXALIASWARN (rand);
# undef random
# define random rpl_random
# endif
-_GL_FUNCDECL_RPL (random, long, (void));
+_GL_FUNCDECL_RPL (random, long, (void), );
_GL_CXXALIAS_RPL (random, long, (void));
# else
# if !@HAVE_RANDOM@
-_GL_FUNCDECL_SYS (random, long, (void));
+_GL_FUNCDECL_SYS (random, long, (void), );
# endif
/* Need to cast, because on Haiku, the return type is
int. */
@@ -1181,11 +1250,11 @@ _GL_WARN_ON_USE (random, "random is unportable - "
# undef srandom
# define srandom rpl_srandom
# endif
-_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
+_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), );
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
# else
# if !@HAVE_RANDOM@
-_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), );
# endif
/* Need to cast, because on FreeBSD, the first parameter is
unsigned long seed. */
@@ -1209,14 +1278,14 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
# define initstate rpl_initstate
# endif
_GL_FUNCDECL_RPL (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# else
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on FreeBSD, the first parameter is
@@ -1241,11 +1310,11 @@ _GL_WARN_ON_USE (initstate, "initstate is unportable - "
# undef setstate
# define setstate rpl_setstate
# endif
-_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
# else
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
-_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
is const char *arg_state. */
@@ -1269,12 +1338,12 @@ _GL_WARN_ON_USE (setstate, "setstate is unportable - "
# undef random_r
# define random_r rpl_random_r
# endif
-_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
# else
# if !@HAVE_RANDOM_R@
-_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
@@ -1295,14 +1364,14 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
# define srandom_r rpl_srandom_r
# endif
_GL_FUNCDECL_RPL (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (srandom_r, int,
(unsigned int seed, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (srandom_r, int,
@@ -1325,7 +1394,7 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
# endif
_GL_FUNCDECL_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
@@ -1334,7 +1403,7 @@ _GL_CXXALIAS_RPL (initstate_r, int,
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
# endif
/* Need to cast, because on Haiku, the third parameter is
@@ -1359,14 +1428,14 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
# define setstate_r rpl_setstate_r
# endif
_GL_FUNCDECL_RPL (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (setstate_r, int,
(char *arg_state, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
# endif
/* Need to cast, because on Haiku, the first parameter is
@@ -1392,21 +1461,22 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
# undef realloc
# define realloc rpl_realloc
# endif
-_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_FUNCDECL_RPL (realloc, void *,
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
@@ -1415,16 +1485,17 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
_GL_CXXALIASWARN (realloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
+ (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1444,13 +1515,15 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
# define reallocarray rpl_reallocarray
# endif
_GL_FUNCDECL_RPL (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
# else
# if ! @HAVE_REALLOCARRAY@
_GL_FUNCDECL_SYS (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
@@ -1472,15 +1545,15 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
# define realpath rpl_realpath
# endif
_GL_FUNCDECL_RPL (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realpath, char *,
(const char *restrict name, char *restrict resolved));
# else
# if !@HAVE_REALPATH@
_GL_FUNCDECL_SYS (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (realpath, char *,
(const char *restrict name, char *restrict resolved));
@@ -1498,7 +1571,8 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
/* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
# if !@HAVE_RPMATCH@
-_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch);
@@ -1514,7 +1588,8 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
/* Look up NAME in the environment, returning 0 in insecure situations. */
# if !@HAVE_SECURE_GETENV@
_GL_FUNCDECL_SYS (secure_getenv, char *,
- (char const *name) _GL_ARG_NONNULL ((1)));
+ (char const *name),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
_GL_CXXALIASWARN (secure_getenv);
@@ -1535,14 +1610,14 @@ _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
# define setenv rpl_setenv
# endif
_GL_FUNCDECL_RPL (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
# if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (setenv, int,
@@ -1559,6 +1634,19 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
#endif
+#if @GNULIB_STACK_TRACE@
+/* Prints a stack trace of the current thread to standard error,
+ if possible. */
+# if @CAN_PRINT_STACK_TRACE@
+_GL_EXTERN_C void print_stack_trace (void);
+# else
+# if !GNULIB_defined_print_stack_trace
+# define print_stack_trace() /* nothing */
+# define GNULIB_defined_print_stack_trace 1
+# endif
+# endif
+#endif
+
#if @GNULIB_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOD@
@@ -1567,14 +1655,14 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
# define GNULIB_defined_strtod_function 1
_GL_FUNCDECL_RPL (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtod, double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOD@
_GL_FUNCDECL_SYS (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtod, double,
@@ -1599,14 +1687,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif
# define GNULIB_defined_strtof_function 1
_GL_FUNCDECL_RPL (strtof, float,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtof, float,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOF@
_GL_FUNCDECL_SYS (strtof, float,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtof, float,
@@ -1631,14 +1719,14 @@ _GL_WARN_ON_USE (strtof, "strtof is unportable - "
# endif
# define GNULIB_defined_strtold_function 1
_GL_FUNCDECL_RPL (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtold, long double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOLD@
_GL_FUNCDECL_SYS (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtold, long double,
@@ -1669,7 +1757,7 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - "
# define GNULIB_defined_strtol_function 1
_GL_FUNCDECL_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
@@ -1678,7 +1766,7 @@ _GL_CXXALIAS_RPL (strtol, long,
# if !@HAVE_STRTOL@
_GL_FUNCDECL_SYS (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtol, long,
@@ -1712,7 +1800,7 @@ _GL_WARN_ON_USE (strtol, "strtol is unportable - "
# define GNULIB_defined_strtoll_function 1
_GL_FUNCDECL_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
@@ -1721,7 +1809,7 @@ _GL_CXXALIAS_RPL (strtoll, long long,
# if !@HAVE_STRTOLL@
_GL_FUNCDECL_SYS (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoll, long long,
@@ -1752,7 +1840,7 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
# define GNULIB_defined_strtoul_function 1
_GL_FUNCDECL_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
@@ -1761,7 +1849,7 @@ _GL_CXXALIAS_RPL (strtoul, unsigned long,
# if !@HAVE_STRTOUL@
_GL_FUNCDECL_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoul, unsigned long,
@@ -1795,7 +1883,7 @@ _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
# define GNULIB_defined_strtoull_function 1
_GL_FUNCDECL_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
@@ -1804,7 +1892,7 @@ _GL_CXXALIAS_RPL (strtoull, unsigned long long,
# if !@HAVE_STRTOULL@
_GL_FUNCDECL_SYS (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
@@ -1824,7 +1912,7 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
/* Unlock the slave side of the pseudo-terminal whose master side is specified
by FD, so that it can be opened. */
# if !@HAVE_UNLOCKPT@
-_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
_GL_CXXALIASWARN (unlockpt);
@@ -1843,11 +1931,11 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
-_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
# if !@HAVE_DECL_UNSETENV@
-_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
@@ -1869,7 +1957,7 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
# undef wctomb
# define wctomb rpl_wctomb
# endif
-_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
+_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), );
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
# else
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));