diff options
Diffstat (limited to 'gl/stdlib.in.h')
| -rw-r--r-- | gl/stdlib.in.h | 567 |
1 files changed, 336 insertions, 231 deletions
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index e74e7c18..95237f2a 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* A GNU-like <stdlib.h>. | 1 | /* A GNU-like <stdlib.h>. |
| 2 | 2 | ||
| 3 | Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc. | 3 | Copyright (C) 1995, 2001-2004, 2006-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is free software: you can redistribute it and/or modify | 5 | This file is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU Lesser General Public License as | 6 | it under the terms of the GNU Lesser General Public License as |
| @@ -20,12 +20,27 @@ | |||
| 20 | #endif | 20 | #endif |
| 21 | @PRAGMA_COLUMNS@ | 21 | @PRAGMA_COLUMNS@ |
| 22 | 22 | ||
| 23 | #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc | 23 | #if ((defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) \ |
| 24 | || defined __need_malloc_and_calloc) \ | ||
| 25 | && !defined __SUNPRO_CC | ||
| 24 | /* Special invocation conventions inside some gnulib header files, | 26 | /* Special invocation conventions inside some gnulib header files, |
| 25 | and inside some glibc header files, respectively. */ | 27 | and inside some glibc header files, respectively. |
| 28 | Do not recognize this special invocation convention when GCC's | ||
| 29 | c++/11/stdlib.h is being included or has been included. This is needed | ||
| 30 | to support the use of clang+llvm binaries on Ubuntu 22.04 with | ||
| 31 | CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \ | ||
| 32 | -I/usr/include/x86_64-linux-gnu/c++/11 | ||
| 33 | -L/usr/lib/gcc/x86_64-linux-gnu/11 | ||
| 34 | -Wl,-rpath,$clangdir/lib" | ||
| 35 | because in this case /usr/include/c++/11/stdlib.h (which does not support | ||
| 36 | the convention) is seen before the gnulib-generated stdlib.h. */ | ||
| 26 | 37 | ||
| 27 | #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ | 38 | #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
| 28 | 39 | ||
| 40 | /* Make sure that the macros that indicate the special invocation convention | ||
| 41 | get undefined. This is needed at least on CentOS 7. */ | ||
| 42 | #undef __need_malloc_and_calloc | ||
| 43 | |||
| 29 | #else | 44 | #else |
| 30 | /* Normal invocation convention. */ | 45 | /* Normal invocation convention. */ |
| 31 | 46 | ||
| @@ -38,8 +53,8 @@ | |||
| 38 | #define _@GUARD_PREFIX@_STDLIB_H | 53 | #define _@GUARD_PREFIX@_STDLIB_H |
| 39 | 54 | ||
| 40 | /* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, | 55 | /* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, |
| 41 | _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, | 56 | _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, |
| 42 | HAVE_RAW_DECL_*. */ | 57 | _GL_INLINE_HEADER_BEGIN, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ |
| 43 | #if !_GL_CONFIG_H_INCLUDED | 58 | #if !_GL_CONFIG_H_INCLUDED |
| 44 | #error "Please include config.h first." | 59 | #error "Please include config.h first." |
| 45 | #endif | 60 | #endif |
| @@ -47,11 +62,6 @@ | |||
| 47 | /* NetBSD 5.0 mis-defines NULL. */ | 62 | /* NetBSD 5.0 mis-defines NULL. */ |
| 48 | #include <stddef.h> | 63 | #include <stddef.h> |
| 49 | 64 | ||
| 50 | /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */ | ||
| 51 | #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS | ||
| 52 | # include <sys/wait.h> | ||
| 53 | #endif | ||
| 54 | |||
| 55 | /* Solaris declares getloadavg() in <sys/loadavg.h>. */ | 65 | /* Solaris declares getloadavg() in <sys/loadavg.h>. */ |
| 56 | #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ | 66 | #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ |
| 57 | /* OpenIndiana has a bug: <sys/time.h> must be included before | 67 | /* OpenIndiana has a bug: <sys/time.h> must be included before |
| @@ -60,6 +70,11 @@ | |||
| 60 | # include <sys/loadavg.h> | 70 | # include <sys/loadavg.h> |
| 61 | #endif | 71 | #endif |
| 62 | 72 | ||
| 73 | /* QNX declares getprogname() in <sys/process.h>. */ | ||
| 74 | #if (@GNULIB_GETPROGNAME@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_PROCESS_H@ | ||
| 75 | # include <sys/process.h> | ||
| 76 | #endif | ||
| 77 | |||
| 63 | /* Native Windows platforms declare _mktemp() in <io.h>. */ | 78 | /* Native Windows platforms declare _mktemp() in <io.h>. */ |
| 64 | #if defined _WIN32 && !defined __CYGWIN__ | 79 | #if defined _WIN32 && !defined __CYGWIN__ |
| 65 | # include <io.h> | 80 | # include <io.h> |
| @@ -67,13 +82,6 @@ | |||
| 67 | 82 | ||
| 68 | #if @GNULIB_RANDOM_R@ | 83 | #if @GNULIB_RANDOM_R@ |
| 69 | 84 | ||
| 70 | /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included | ||
| 71 | from <stdlib.h> if _REENTRANT is defined. Include it whenever we need | ||
| 72 | 'struct random_data'. */ | ||
| 73 | # if @HAVE_RANDOM_H@ | ||
| 74 | # include <random.h> | ||
| 75 | # endif | ||
| 76 | |||
| 77 | # include <stdint.h> | 85 | # include <stdint.h> |
| 78 | 86 | ||
| 79 | # if !@HAVE_STRUCT_RANDOM_DATA@ | 87 | # if !@HAVE_STRUCT_RANDOM_DATA@ |
| @@ -104,11 +112,30 @@ struct random_data | |||
| 104 | # include <unistd.h> | 112 | # include <unistd.h> |
| 105 | #endif | 113 | #endif |
| 106 | 114 | ||
| 115 | #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 || defined _AIX) | ||
| 116 | /* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro | ||
| 117 | below, this may cause compilation errors later in the libstdc++ header files | ||
| 118 | (that are part of GCC), such as: | ||
| 119 | error: 'rpl_strtol' is not a member of 'std' | ||
| 120 | To avoid this, include the relevant header files here, before these symbols | ||
| 121 | get defined as macros. But do so only on Solaris 11 and AIX (where it is | ||
| 122 | needed), not on mingw (where it would cause other compilation errors). */ | ||
| 123 | # include <string> | ||
| 124 | #endif | ||
| 125 | |||
| 126 | _GL_INLINE_HEADER_BEGIN | ||
| 127 | #ifndef _GL_STDLIB_INLINE | ||
| 128 | # define _GL_STDLIB_INLINE _GL_INLINE | ||
| 129 | #endif | ||
| 130 | #ifndef _GL_REALLOC_INLINE | ||
| 131 | # define _GL_REALLOC_INLINE _GL_INLINE | ||
| 132 | #endif | ||
| 133 | |||
| 107 | /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers | 134 | /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers |
| 108 | that can be freed by passing them as the Ith argument to the | 135 | that can be freed by passing them as the Ith argument to the |
| 109 | function F. */ | 136 | function F. */ |
| 110 | #ifndef _GL_ATTRIBUTE_DEALLOC | 137 | #ifndef _GL_ATTRIBUTE_DEALLOC |
| 111 | # if __GNUC__ >= 11 | 138 | # if __GNUC__ >= 11 && !defined __clang__ |
| 112 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) | 139 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) |
| 113 | # else | 140 | # else |
| 114 | # define _GL_ATTRIBUTE_DEALLOC(f, i) | 141 | # define _GL_ATTRIBUTE_DEALLOC(f, i) |
| @@ -133,11 +160,23 @@ struct random_data | |||
| 133 | # endif | 160 | # endif |
| 134 | #endif | 161 | #endif |
| 135 | 162 | ||
| 163 | /* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP | ||
| 164 | (a pointer) must not be NULL if the argument NI (an integer) is != 0. */ | ||
| 165 | /* Applies to: functions. */ | ||
| 166 | #ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO | ||
| 167 | # if __GNUC__ >= 15 && !defined __clang__ | ||
| 168 | # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \ | ||
| 169 | __attribute__ ((__nonnull_if_nonzero__ (np, ni))) | ||
| 170 | # else | ||
| 171 | # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) | ||
| 172 | # endif | ||
| 173 | #endif | ||
| 174 | |||
| 136 | /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. | 175 | /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. |
| 137 | */ | 176 | */ |
| 138 | #ifndef _GL_ATTRIBUTE_NOTHROW | 177 | #ifndef _GL_ATTRIBUTE_NOTHROW |
| 139 | # if defined __cplusplus | 178 | # if defined __cplusplus |
| 140 | # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 | 179 | # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4 |
| 141 | # if __cplusplus >= 201103L | 180 | # if __cplusplus >= 201103L |
| 142 | # define _GL_ATTRIBUTE_NOTHROW noexcept (true) | 181 | # define _GL_ATTRIBUTE_NOTHROW noexcept (true) |
| 143 | # else | 182 | # else |
| @@ -188,6 +227,18 @@ struct random_data | |||
| 188 | #endif | 227 | #endif |
| 189 | 228 | ||
| 190 | 229 | ||
| 230 | /* Declarations for ISO C N3322. */ | ||
| 231 | #if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ | ||
| 232 | _GL_EXTERN_C void *_GL_FUNCDECL_SYS_NAME (bsearch) | ||
| 233 | (const void *__key, const void *__base, size_t __nmemb, size_t __size, | ||
| 234 | int (*__compare) (const void *, const void *)) | ||
| 235 | _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5)); | ||
| 236 | _GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size, | ||
| 237 | int (*__compare) (const void *, const void *)) | ||
| 238 | _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ARG_NONNULL ((4)); | ||
| 239 | #endif | ||
| 240 | |||
| 241 | |||
| 191 | #if @GNULIB__EXIT@ | 242 | #if @GNULIB__EXIT@ |
| 192 | /* Terminate the current process with the given return code, without running | 243 | /* Terminate the current process with the given return code, without running |
| 193 | the 'atexit' handlers. */ | 244 | the 'atexit' handlers. */ |
| @@ -196,11 +247,11 @@ struct random_data | |||
| 196 | # undef _Exit | 247 | # undef _Exit |
| 197 | # define _Exit rpl__Exit | 248 | # define _Exit rpl__Exit |
| 198 | # endif | 249 | # endif |
| 199 | _GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status)); | 250 | _GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), ); |
| 200 | _GL_CXXALIAS_RPL (_Exit, void, (int status)); | 251 | _GL_CXXALIAS_RPL (_Exit, void, (int status)); |
| 201 | # else | 252 | # else |
| 202 | # if !@HAVE__EXIT@ | 253 | # if !@HAVE__EXIT@ |
| 203 | _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); | 254 | _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), ); |
| 204 | # endif | 255 | # endif |
| 205 | _GL_CXXALIAS_SYS (_Exit, void, (int status)); | 256 | _GL_CXXALIAS_SYS (_Exit, void, (int status)); |
| 206 | # endif | 257 | # endif |
| @@ -208,7 +259,6 @@ _GL_CXXALIAS_SYS (_Exit, void, (int status)); | |||
| 208 | _GL_CXXALIASWARN (_Exit); | 259 | _GL_CXXALIASWARN (_Exit); |
| 209 | # endif | 260 | # endif |
| 210 | #elif defined GNULIB_POSIXCHECK | 261 | #elif defined GNULIB_POSIXCHECK |
| 211 | # undef _Exit | ||
| 212 | # if HAVE_RAW_DECL__EXIT | 262 | # if HAVE_RAW_DECL__EXIT |
| 213 | _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " | 263 | _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " |
| 214 | "use gnulib module _Exit for portability"); | 264 | "use gnulib module _Exit for portability"); |
| @@ -216,6 +266,26 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " | |||
| 216 | #endif | 266 | #endif |
| 217 | 267 | ||
| 218 | 268 | ||
| 269 | #if @GNULIB_ABORT_DEBUG@ | ||
| 270 | /* Terminates the current process with signal SIGABRT. | ||
| 271 | Note: While the original abort() function is safe to call in signal handlers, | ||
| 272 | the overridden abort() function is not. */ | ||
| 273 | # if @REPLACE_ABORT@ | ||
| 274 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 275 | # undef abort | ||
| 276 | # define abort rpl_abort | ||
| 277 | # endif | ||
| 278 | _GL_FUNCDECL_RPL (abort, _Noreturn void, (void), ); | ||
| 279 | _GL_CXXALIAS_RPL (abort, void, (void)); | ||
| 280 | # else | ||
| 281 | _GL_CXXALIAS_SYS (abort, void, (void)); | ||
| 282 | # endif | ||
| 283 | # if __GLIBC__ >= 2 | ||
| 284 | _GL_CXXALIASWARN (abort); | ||
| 285 | # endif | ||
| 286 | #endif | ||
| 287 | |||
| 288 | |||
| 219 | #if @GNULIB_FREE_POSIX@ | 289 | #if @GNULIB_FREE_POSIX@ |
| 220 | # if @REPLACE_FREE@ | 290 | # if @REPLACE_FREE@ |
| 221 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 291 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| @@ -223,9 +293,9 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " | |||
| 223 | # define free rpl_free | 293 | # define free rpl_free |
| 224 | # endif | 294 | # endif |
| 225 | # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) | 295 | # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) |
| 226 | _GL_FUNCDECL_RPL (free, void, (void *ptr) _GL_ATTRIBUTE_NOTHROW); | 296 | _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; |
| 227 | # else | 297 | # else |
| 228 | _GL_FUNCDECL_RPL (free, void, (void *ptr)); | 298 | _GL_FUNCDECL_RPL (free, void, (void *ptr), ); |
| 229 | # endif | 299 | # endif |
| 230 | _GL_CXXALIAS_RPL (free, void, (void *ptr)); | 300 | _GL_CXXALIAS_RPL (free, void, (void *ptr)); |
| 231 | # else | 301 | # else |
| @@ -235,10 +305,9 @@ _GL_CXXALIAS_SYS (free, void, (void *ptr)); | |||
| 235 | _GL_CXXALIASWARN (free); | 305 | _GL_CXXALIASWARN (free); |
| 236 | # endif | 306 | # endif |
| 237 | #elif defined GNULIB_POSIXCHECK | 307 | #elif defined GNULIB_POSIXCHECK |
| 238 | # undef free | ||
| 239 | /* Assume free is always declared. */ | 308 | /* Assume free is always declared. */ |
| 240 | _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - " | 309 | _GL_WARN_ON_USE (free, "free is not POSIX:2024 compliant everywhere - " |
| 241 | "use gnulib module free for portability"); | 310 | "use gnulib module free-posix for portability"); |
| 242 | #endif | 311 | #endif |
| 243 | 312 | ||
| 244 | 313 | ||
| @@ -250,22 +319,25 @@ _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - " | |||
| 250 | # define aligned_alloc rpl_aligned_alloc | 319 | # define aligned_alloc rpl_aligned_alloc |
| 251 | # endif | 320 | # endif |
| 252 | _GL_FUNCDECL_RPL (aligned_alloc, void *, | 321 | _GL_FUNCDECL_RPL (aligned_alloc, void *, |
| 253 | (size_t alignment, size_t size) | 322 | (size_t alignment, size_t size), |
| 254 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 323 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 324 | _GL_ATTRIBUTE_NODISCARD); | ||
| 255 | _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); | 325 | _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); |
| 256 | # else | 326 | # else |
| 257 | # if @HAVE_ALIGNED_ALLOC@ | 327 | # if @HAVE_ALIGNED_ALLOC@ |
| 258 | # if __GNUC__ >= 11 | 328 | # if __GNUC__ >= 11 && !defined __clang__ |
| 259 | /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ | 329 | /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ |
| 260 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 | 330 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 |
| 261 | _GL_FUNCDECL_SYS (aligned_alloc, void *, | 331 | _GL_FUNCDECL_SYS (aligned_alloc, void *, |
| 262 | (size_t alignment, size_t size) | 332 | (size_t alignment, size_t size), |
| 263 | _GL_ATTRIBUTE_NOTHROW | 333 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 264 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 334 | _GL_ATTRIBUTE_NODISCARD) |
| 335 | _GL_ATTRIBUTE_NOTHROW; | ||
| 265 | # else | 336 | # else |
| 266 | _GL_FUNCDECL_SYS (aligned_alloc, void *, | 337 | _GL_FUNCDECL_SYS (aligned_alloc, void *, |
| 267 | (size_t alignment, size_t size) | 338 | (size_t alignment, size_t size), |
| 268 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 339 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 340 | _GL_ATTRIBUTE_NODISCARD); | ||
| 269 | # endif | 341 | # endif |
| 270 | # endif | 342 | # endif |
| 271 | _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); | 343 | _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); |
| @@ -275,21 +347,21 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); | |||
| 275 | _GL_CXXALIASWARN (aligned_alloc); | 347 | _GL_CXXALIASWARN (aligned_alloc); |
| 276 | # endif | 348 | # endif |
| 277 | #else | 349 | #else |
| 278 | # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc | 350 | # if @GNULIB_FREE_POSIX@ \ |
| 351 | && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc | ||
| 279 | /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ | 352 | /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ |
| 280 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 | 353 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 |
| 281 | _GL_FUNCDECL_SYS (aligned_alloc, void *, | 354 | _GL_FUNCDECL_SYS (aligned_alloc, void *, |
| 282 | (size_t alignment, size_t size) | 355 | (size_t alignment, size_t size), |
| 283 | _GL_ATTRIBUTE_NOTHROW | 356 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 284 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 357 | _GL_ATTRIBUTE_NOTHROW; |
| 285 | # else | 358 | # else |
| 286 | _GL_FUNCDECL_SYS (aligned_alloc, void *, | 359 | _GL_FUNCDECL_SYS (aligned_alloc, void *, |
| 287 | (size_t alignment, size_t size) | 360 | (size_t alignment, size_t size), |
| 288 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 361 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 289 | # endif | 362 | # endif |
| 290 | # endif | 363 | # endif |
| 291 | # if defined GNULIB_POSIXCHECK | 364 | # if defined GNULIB_POSIXCHECK |
| 292 | # undef aligned_alloc | ||
| 293 | # if HAVE_RAW_DECL_ALIGNED_ALLOC | 365 | # if HAVE_RAW_DECL_ALIGNED_ALLOC |
| 294 | _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " | 366 | _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " |
| 295 | "use gnulib module aligned_alloc for portability"); | 367 | "use gnulib module aligned_alloc for portability"); |
| @@ -301,14 +373,14 @@ _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " | |||
| 301 | /* Parse a signed decimal integer. | 373 | /* Parse a signed decimal integer. |
| 302 | Returns the value of the integer. Errors are not detected. */ | 374 | Returns the value of the integer. Errors are not detected. */ |
| 303 | # if !@HAVE_ATOLL@ | 375 | # if !@HAVE_ATOLL@ |
| 304 | _GL_FUNCDECL_SYS (atoll, long long, (const char *string) | 376 | _GL_FUNCDECL_SYS (atoll, long long, |
| 305 | _GL_ATTRIBUTE_PURE | 377 | (const char *string), |
| 306 | _GL_ARG_NONNULL ((1))); | 378 | _GL_ATTRIBUTE_PURE |
| 379 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 307 | # endif | 380 | # endif |
| 308 | _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); | 381 | _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); |
| 309 | _GL_CXXALIASWARN (atoll); | 382 | _GL_CXXALIASWARN (atoll); |
| 310 | #elif defined GNULIB_POSIXCHECK | 383 | #elif defined GNULIB_POSIXCHECK |
| 311 | # undef atoll | ||
| 312 | # if HAVE_RAW_DECL_ATOLL | 384 | # if HAVE_RAW_DECL_ATOLL |
| 313 | _GL_WARN_ON_USE (atoll, "atoll is unportable - " | 385 | _GL_WARN_ON_USE (atoll, "atoll is unportable - " |
| 314 | "use gnulib module atoll for portability"); | 386 | "use gnulib module atoll for portability"); |
| @@ -316,28 +388,32 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - " | |||
| 316 | #endif | 388 | #endif |
| 317 | 389 | ||
| 318 | #if @GNULIB_CALLOC_POSIX@ | 390 | #if @GNULIB_CALLOC_POSIX@ |
| 319 | # if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \ | 391 | # if @REPLACE_CALLOC_FOR_CALLOC_POSIX@ \ |
| 320 | || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@) | 392 | || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@) |
| 321 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 393 | # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
| 394 | || _GL_USE_STDLIB_ALLOC) | ||
| 322 | # undef calloc | 395 | # undef calloc |
| 323 | # define calloc rpl_calloc | 396 | # define calloc rpl_calloc |
| 324 | # endif | 397 | # endif |
| 325 | _GL_FUNCDECL_RPL (calloc, void *, | 398 | _GL_FUNCDECL_RPL (calloc, void *, |
| 326 | (size_t nmemb, size_t size) | 399 | (size_t nmemb, size_t size), |
| 327 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 400 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 401 | _GL_ATTRIBUTE_NODISCARD); | ||
| 328 | _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); | 402 | _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); |
| 329 | # else | 403 | # else |
| 330 | # if __GNUC__ >= 11 | 404 | # if __GNUC__ >= 11 && !defined __clang__ |
| 331 | /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ | 405 | /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ |
| 332 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 406 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 333 | _GL_FUNCDECL_SYS (calloc, void *, | 407 | _GL_FUNCDECL_SYS (calloc, void *, |
| 334 | (size_t nmemb, size_t size) | 408 | (size_t nmemb, size_t size), |
| 335 | _GL_ATTRIBUTE_NOTHROW | 409 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 336 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 410 | _GL_ATTRIBUTE_NODISCARD) |
| 411 | _GL_ATTRIBUTE_NOTHROW; | ||
| 337 | # else | 412 | # else |
| 338 | _GL_FUNCDECL_SYS (calloc, void *, | 413 | _GL_FUNCDECL_SYS (calloc, void *, |
| 339 | (size_t nmemb, size_t size) | 414 | (size_t nmemb, size_t size), |
| 340 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 415 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 416 | _GL_ATTRIBUTE_NODISCARD); | ||
| 341 | # endif | 417 | # endif |
| 342 | # endif | 418 | # endif |
| 343 | _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); | 419 | _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); |
| @@ -346,21 +422,21 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); | |||
| 346 | _GL_CXXALIASWARN (calloc); | 422 | _GL_CXXALIASWARN (calloc); |
| 347 | # endif | 423 | # endif |
| 348 | #else | 424 | #else |
| 349 | # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc | 425 | # if @GNULIB_FREE_POSIX@ \ |
| 426 | && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc | ||
| 350 | /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ | 427 | /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ |
| 351 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 428 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 352 | _GL_FUNCDECL_SYS (calloc, void *, | 429 | _GL_FUNCDECL_SYS (calloc, void *, |
| 353 | (size_t nmemb, size_t size) | 430 | (size_t nmemb, size_t size), |
| 354 | _GL_ATTRIBUTE_NOTHROW | 431 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 355 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 432 | _GL_ATTRIBUTE_NOTHROW; |
| 356 | # else | 433 | # else |
| 357 | _GL_FUNCDECL_SYS (calloc, void *, | 434 | _GL_FUNCDECL_SYS (calloc, void *, |
| 358 | (size_t nmemb, size_t size) | 435 | (size_t nmemb, size_t size), |
| 359 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 436 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 360 | # endif | 437 | # endif |
| 361 | # endif | 438 | # endif |
| 362 | # if defined GNULIB_POSIXCHECK | 439 | # if defined GNULIB_POSIXCHECK |
| 363 | # undef calloc | ||
| 364 | /* Assume calloc is always declared. */ | 440 | /* Assume calloc is always declared. */ |
| 365 | _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " | 441 | _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " |
| 366 | "use gnulib module calloc-posix for portability"); | 442 | "use gnulib module calloc-posix for portability"); |
| @@ -373,23 +449,26 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " | |||
| 373 | # define canonicalize_file_name rpl_canonicalize_file_name | 449 | # define canonicalize_file_name rpl_canonicalize_file_name |
| 374 | # endif | 450 | # endif |
| 375 | _GL_FUNCDECL_RPL (canonicalize_file_name, char *, | 451 | _GL_FUNCDECL_RPL (canonicalize_file_name, char *, |
| 376 | (const char *name) | 452 | (const char *name), |
| 377 | _GL_ARG_NONNULL ((1)) | 453 | _GL_ARG_NONNULL ((1)) |
| 378 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 454 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 455 | _GL_ATTRIBUTE_NODISCARD); | ||
| 379 | _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); | 456 | _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); |
| 380 | # else | 457 | # else |
| 381 | # if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11 | 458 | # if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__) |
| 382 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 459 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 383 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, | 460 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, |
| 384 | (const char *name) | 461 | (const char *name), |
| 385 | _GL_ATTRIBUTE_NOTHROW | ||
| 386 | _GL_ARG_NONNULL ((1)) | 462 | _GL_ARG_NONNULL ((1)) |
| 387 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 463 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 464 | _GL_ATTRIBUTE_NODISCARD) | ||
| 465 | _GL_ATTRIBUTE_NOTHROW; | ||
| 388 | # else | 466 | # else |
| 389 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, | 467 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, |
| 390 | (const char *name) | 468 | (const char *name), |
| 391 | _GL_ARG_NONNULL ((1)) | 469 | _GL_ARG_NONNULL ((1)) |
| 392 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 470 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 471 | _GL_ATTRIBUTE_NODISCARD); | ||
| 393 | # endif | 472 | # endif |
| 394 | # endif | 473 | # endif |
| 395 | _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); | 474 | _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); |
| @@ -400,24 +479,24 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); | |||
| 400 | # endif | 479 | # endif |
| 401 | _GL_CXXALIASWARN (canonicalize_file_name); | 480 | _GL_CXXALIASWARN (canonicalize_file_name); |
| 402 | #else | 481 | #else |
| 403 | # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name | 482 | # if @GNULIB_FREE_POSIX@ \ |
| 483 | && (__GNUC__ >= 11 && !defined __clang__) && !defined canonicalize_file_name | ||
| 404 | /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or | 484 | /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or |
| 405 | rpl_free. */ | 485 | rpl_free. */ |
| 406 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 486 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 407 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, | 487 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, |
| 408 | (const char *name) | 488 | (const char *name), |
| 409 | _GL_ATTRIBUTE_NOTHROW | ||
| 410 | _GL_ARG_NONNULL ((1)) | 489 | _GL_ARG_NONNULL ((1)) |
| 411 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 490 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 491 | _GL_ATTRIBUTE_NOTHROW; | ||
| 412 | # else | 492 | # else |
| 413 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, | 493 | _GL_FUNCDECL_SYS (canonicalize_file_name, char *, |
| 414 | (const char *name) | 494 | (const char *name), |
| 415 | _GL_ARG_NONNULL ((1)) | 495 | _GL_ARG_NONNULL ((1)) |
| 416 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 496 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 417 | # endif | 497 | # endif |
| 418 | # endif | 498 | # endif |
| 419 | # if defined GNULIB_POSIXCHECK | 499 | # if defined GNULIB_POSIXCHECK |
| 420 | # undef canonicalize_file_name | ||
| 421 | # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME | 500 | # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME |
| 422 | _GL_WARN_ON_USE (canonicalize_file_name, | 501 | _GL_WARN_ON_USE (canonicalize_file_name, |
| 423 | "canonicalize_file_name is unportable - " | 502 | "canonicalize_file_name is unportable - " |
| @@ -503,12 +582,12 @@ _GL_CXXALIASWARN (gcvt); | |||
| 503 | # undef getloadavg | 582 | # undef getloadavg |
| 504 | # define getloadavg rpl_getloadavg | 583 | # define getloadavg rpl_getloadavg |
| 505 | # endif | 584 | # endif |
| 506 | _GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem) | 585 | _GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem), |
| 507 | _GL_ARG_NONNULL ((1))); | 586 | _GL_ARG_NONNULL ((1))); |
| 508 | _GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem)); | 587 | _GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem)); |
| 509 | # else | 588 | # else |
| 510 | # if !@HAVE_DECL_GETLOADAVG@ | 589 | # if !@HAVE_DECL_GETLOADAVG@ |
| 511 | _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) | 590 | _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem), |
| 512 | _GL_ARG_NONNULL ((1))); | 591 | _GL_ARG_NONNULL ((1))); |
| 513 | # endif | 592 | # endif |
| 514 | _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); | 593 | _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); |
| @@ -517,7 +596,6 @@ _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); | |||
| 517 | _GL_CXXALIASWARN (getloadavg); | 596 | _GL_CXXALIASWARN (getloadavg); |
| 518 | # endif | 597 | # endif |
| 519 | #elif defined GNULIB_POSIXCHECK | 598 | #elif defined GNULIB_POSIXCHECK |
| 520 | # undef getloadavg | ||
| 521 | # if HAVE_RAW_DECL_GETLOADAVG | 599 | # if HAVE_RAW_DECL_GETLOADAVG |
| 522 | _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " | 600 | _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " |
| 523 | "use gnulib module getloadavg for portability"); | 601 | "use gnulib module getloadavg for portability"); |
| @@ -533,17 +611,17 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " | |||
| 533 | # define getprogname rpl_getprogname | 611 | # define getprogname rpl_getprogname |
| 534 | # endif | 612 | # endif |
| 535 | # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ | 613 | # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ |
| 536 | _GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE); | 614 | _GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); |
| 537 | # else | 615 | # else |
| 538 | _GL_FUNCDECL_RPL (getprogname, const char *, (void)); | 616 | _GL_FUNCDECL_RPL (getprogname, const char *, (void), ); |
| 539 | # endif | 617 | # endif |
| 540 | _GL_CXXALIAS_RPL (getprogname, const char *, (void)); | 618 | _GL_CXXALIAS_RPL (getprogname, const char *, (void)); |
| 541 | # else | 619 | # else |
| 542 | # if !@HAVE_GETPROGNAME@ | 620 | # if !@HAVE_GETPROGNAME@ |
| 543 | # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ | 621 | # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ |
| 544 | _GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE); | 622 | _GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); |
| 545 | # else | 623 | # else |
| 546 | _GL_FUNCDECL_SYS (getprogname, const char *, (void)); | 624 | _GL_FUNCDECL_SYS (getprogname, const char *, (void), ); |
| 547 | # endif | 625 | # endif |
| 548 | # endif | 626 | # endif |
| 549 | _GL_CXXALIAS_SYS (getprogname, const char *, (void)); | 627 | _GL_CXXALIAS_SYS (getprogname, const char *, (void)); |
| @@ -552,7 +630,6 @@ _GL_CXXALIAS_SYS (getprogname, const char *, (void)); | |||
| 552 | _GL_CXXALIASWARN (getprogname); | 630 | _GL_CXXALIASWARN (getprogname); |
| 553 | # endif | 631 | # endif |
| 554 | #elif defined GNULIB_POSIXCHECK | 632 | #elif defined GNULIB_POSIXCHECK |
| 555 | # undef getprogname | ||
| 556 | # if HAVE_RAW_DECL_GETPROGNAME | 633 | # if HAVE_RAW_DECL_GETPROGNAME |
| 557 | _GL_WARN_ON_USE (getprogname, "getprogname is unportable - " | 634 | _GL_WARN_ON_USE (getprogname, "getprogname is unportable - " |
| 558 | "use gnulib module getprogname for portability"); | 635 | "use gnulib module getprogname for portability"); |
| @@ -577,15 +654,15 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable - " | |||
| 577 | # define getsubopt rpl_getsubopt | 654 | # define getsubopt rpl_getsubopt |
| 578 | # endif | 655 | # endif |
| 579 | _GL_FUNCDECL_RPL (getsubopt, int, | 656 | _GL_FUNCDECL_RPL (getsubopt, int, |
| 580 | (char **optionp, char *const *tokens, char **valuep) | 657 | (char **optionp, char *const *tokens, char **valuep), |
| 581 | _GL_ARG_NONNULL ((1, 2, 3))); | 658 | _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD); |
| 582 | _GL_CXXALIAS_RPL (getsubopt, int, | 659 | _GL_CXXALIAS_RPL (getsubopt, int, |
| 583 | (char **optionp, char *const *tokens, char **valuep)); | 660 | (char **optionp, char *const *tokens, char **valuep)); |
| 584 | # else | 661 | # else |
| 585 | # if !@HAVE_GETSUBOPT@ | 662 | # if !@HAVE_GETSUBOPT@ |
| 586 | _GL_FUNCDECL_SYS (getsubopt, int, | 663 | _GL_FUNCDECL_SYS (getsubopt, int, |
| 587 | (char **optionp, char *const *tokens, char **valuep) | 664 | (char **optionp, char *const *tokens, char **valuep), |
| 588 | _GL_ARG_NONNULL ((1, 2, 3))); | 665 | _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD); |
| 589 | # endif | 666 | # endif |
| 590 | _GL_CXXALIAS_SYS (getsubopt, int, | 667 | _GL_CXXALIAS_SYS (getsubopt, int, |
| 591 | (char **optionp, char *const *tokens, char **valuep)); | 668 | (char **optionp, char *const *tokens, char **valuep)); |
| @@ -594,7 +671,6 @@ _GL_CXXALIAS_SYS (getsubopt, int, | |||
| 594 | _GL_CXXALIASWARN (getsubopt); | 671 | _GL_CXXALIASWARN (getsubopt); |
| 595 | # endif | 672 | # endif |
| 596 | #elif defined GNULIB_POSIXCHECK | 673 | #elif defined GNULIB_POSIXCHECK |
| 597 | # undef getsubopt | ||
| 598 | # if HAVE_RAW_DECL_GETSUBOPT | 674 | # if HAVE_RAW_DECL_GETSUBOPT |
| 599 | _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " | 675 | _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " |
| 600 | "use gnulib module getsubopt for portability"); | 676 | "use gnulib module getsubopt for portability"); |
| @@ -605,12 +681,11 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " | |||
| 605 | /* Change the ownership and access permission of the slave side of the | 681 | /* Change the ownership and access permission of the slave side of the |
| 606 | pseudo-terminal whose master side is specified by FD. */ | 682 | pseudo-terminal whose master side is specified by FD. */ |
| 607 | # if !@HAVE_GRANTPT@ | 683 | # if !@HAVE_GRANTPT@ |
| 608 | _GL_FUNCDECL_SYS (grantpt, int, (int fd)); | 684 | _GL_FUNCDECL_SYS (grantpt, int, (int fd), ); |
| 609 | # endif | 685 | # endif |
| 610 | _GL_CXXALIAS_SYS (grantpt, int, (int fd)); | 686 | _GL_CXXALIAS_SYS (grantpt, int, (int fd)); |
| 611 | _GL_CXXALIASWARN (grantpt); | 687 | _GL_CXXALIASWARN (grantpt); |
| 612 | #elif defined GNULIB_POSIXCHECK | 688 | #elif defined GNULIB_POSIXCHECK |
| 613 | # undef grantpt | ||
| 614 | # if HAVE_RAW_DECL_GRANTPT | 689 | # if HAVE_RAW_DECL_GRANTPT |
| 615 | _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " | 690 | _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " |
| 616 | "use gnulib module grantpt for portability"); | 691 | "use gnulib module grantpt for portability"); |
| @@ -622,7 +697,7 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " | |||
| 622 | by never specifying a zero size), so it does not need malloc or | 697 | by never specifying a zero size), so it does not need malloc or |
| 623 | realloc to be redefined. */ | 698 | realloc to be redefined. */ |
| 624 | #if @GNULIB_MALLOC_POSIX@ | 699 | #if @GNULIB_MALLOC_POSIX@ |
| 625 | # if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \ | 700 | # if @REPLACE_MALLOC_FOR_MALLOC_POSIX@ \ |
| 626 | || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@) | 701 | || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@) |
| 627 | # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ | 702 | # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
| 628 | || _GL_USE_STDLIB_ALLOC) | 703 | || _GL_USE_STDLIB_ALLOC) |
| @@ -630,21 +705,24 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " | |||
| 630 | # define malloc rpl_malloc | 705 | # define malloc rpl_malloc |
| 631 | # endif | 706 | # endif |
| 632 | _GL_FUNCDECL_RPL (malloc, void *, | 707 | _GL_FUNCDECL_RPL (malloc, void *, |
| 633 | (size_t size) | 708 | (size_t size), |
| 634 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 709 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 710 | _GL_ATTRIBUTE_NODISCARD); | ||
| 635 | _GL_CXXALIAS_RPL (malloc, void *, (size_t size)); | 711 | _GL_CXXALIAS_RPL (malloc, void *, (size_t size)); |
| 636 | # else | 712 | # else |
| 637 | # if __GNUC__ >= 11 | 713 | # if __GNUC__ >= 11 && !defined __clang__ |
| 638 | /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ | 714 | /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ |
| 639 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 715 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 640 | _GL_FUNCDECL_SYS (malloc, void *, | 716 | _GL_FUNCDECL_SYS (malloc, void *, |
| 641 | (size_t size) | 717 | (size_t size), |
| 642 | _GL_ATTRIBUTE_NOTHROW | 718 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 643 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 719 | _GL_ATTRIBUTE_NODISCARD) |
| 720 | _GL_ATTRIBUTE_NOTHROW; | ||
| 644 | # else | 721 | # else |
| 645 | _GL_FUNCDECL_SYS (malloc, void *, | 722 | _GL_FUNCDECL_SYS (malloc, void *, |
| 646 | (size_t size) | 723 | (size_t size), |
| 647 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 724 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE |
| 725 | _GL_ATTRIBUTE_NODISCARD); | ||
| 648 | # endif | 726 | # endif |
| 649 | # endif | 727 | # endif |
| 650 | _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); | 728 | _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); |
| @@ -653,35 +731,41 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); | |||
| 653 | _GL_CXXALIASWARN (malloc); | 731 | _GL_CXXALIASWARN (malloc); |
| 654 | # endif | 732 | # endif |
| 655 | #else | 733 | #else |
| 656 | # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc | 734 | # if @GNULIB_FREE_POSIX@ \ |
| 735 | && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc | ||
| 657 | /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ | 736 | /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ |
| 658 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 737 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 659 | _GL_FUNCDECL_SYS (malloc, void *, | 738 | _GL_FUNCDECL_SYS (malloc, void *, |
| 660 | (size_t size) | 739 | (size_t size), |
| 661 | _GL_ATTRIBUTE_NOTHROW | 740 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 662 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 741 | _GL_ATTRIBUTE_NOTHROW; |
| 663 | # else | 742 | # else |
| 664 | _GL_FUNCDECL_SYS (malloc, void *, | 743 | _GL_FUNCDECL_SYS (malloc, void *, |
| 665 | (size_t size) | 744 | (size_t size), |
| 666 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 745 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 667 | # endif | 746 | # endif |
| 668 | # endif | 747 | # endif |
| 669 | # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC | 748 | # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
| 670 | # undef malloc | ||
| 671 | /* Assume malloc is always declared. */ | 749 | /* Assume malloc is always declared. */ |
| 672 | _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " | 750 | _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " |
| 673 | "use gnulib module malloc-posix for portability"); | 751 | "use gnulib module malloc-posix for portability"); |
| 674 | # endif | 752 | # endif |
| 675 | #endif | 753 | #endif |
| 676 | 754 | ||
| 677 | /* Return maximum number of bytes of a multibyte character. */ | 755 | /* Return maximum number of bytes in a multibyte character in the |
| 756 | current locale. */ | ||
| 678 | #if @REPLACE_MB_CUR_MAX@ | 757 | #if @REPLACE_MB_CUR_MAX@ |
| 679 | # if !GNULIB_defined_MB_CUR_MAX | 758 | # if !GNULIB_defined_MB_CUR_MAX |
| 680 | static inline | 759 | _GL_STDLIB_INLINE size_t |
| 681 | int gl_MB_CUR_MAX (void) | 760 | gl_MB_CUR_MAX (void) |
| 682 | { | 761 | { |
| 762 | # if 0 < @REPLACE_MB_CUR_MAX@ | ||
| 763 | return @REPLACE_MB_CUR_MAX@; | ||
| 764 | # else | ||
| 683 | /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */ | 765 | /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */ |
| 684 | return MB_CUR_MAX + (MB_CUR_MAX == 3); | 766 | int gl_mb_cur_max = MB_CUR_MAX; |
| 767 | return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max; | ||
| 768 | # endif | ||
| 685 | } | 769 | } |
| 686 | # undef MB_CUR_MAX | 770 | # undef MB_CUR_MAX |
| 687 | # define MB_CUR_MAX gl_MB_CUR_MAX () | 771 | # define MB_CUR_MAX gl_MB_CUR_MAX () |
| @@ -698,7 +782,7 @@ int gl_MB_CUR_MAX (void) | |||
| 698 | # endif | 782 | # endif |
| 699 | _GL_FUNCDECL_RPL (mbstowcs, size_t, | 783 | _GL_FUNCDECL_RPL (mbstowcs, size_t, |
| 700 | (wchar_t *restrict dest, const char *restrict src, | 784 | (wchar_t *restrict dest, const char *restrict src, |
| 701 | size_t len) | 785 | size_t len), |
| 702 | _GL_ARG_NONNULL ((2))); | 786 | _GL_ARG_NONNULL ((2))); |
| 703 | _GL_CXXALIAS_RPL (mbstowcs, size_t, | 787 | _GL_CXXALIAS_RPL (mbstowcs, size_t, |
| 704 | (wchar_t *restrict dest, const char *restrict src, | 788 | (wchar_t *restrict dest, const char *restrict src, |
| @@ -712,7 +796,6 @@ _GL_CXXALIAS_SYS (mbstowcs, size_t, | |||
| 712 | _GL_CXXALIASWARN (mbstowcs); | 796 | _GL_CXXALIASWARN (mbstowcs); |
| 713 | # endif | 797 | # endif |
| 714 | #elif defined GNULIB_POSIXCHECK | 798 | #elif defined GNULIB_POSIXCHECK |
| 715 | # undef mbstowcs | ||
| 716 | # if HAVE_RAW_DECL_MBSTOWCS | 799 | # if HAVE_RAW_DECL_MBSTOWCS |
| 717 | _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - " | 800 | _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - " |
| 718 | "use gnulib module mbstowcs for portability"); | 801 | "use gnulib module mbstowcs for portability"); |
| @@ -727,13 +810,13 @@ _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - " | |||
| 727 | # define mbtowc rpl_mbtowc | 810 | # define mbtowc rpl_mbtowc |
| 728 | # endif | 811 | # endif |
| 729 | _GL_FUNCDECL_RPL (mbtowc, int, | 812 | _GL_FUNCDECL_RPL (mbtowc, int, |
| 730 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); | 813 | (wchar_t *restrict pwc, const char *restrict s, size_t n), ); |
| 731 | _GL_CXXALIAS_RPL (mbtowc, int, | 814 | _GL_CXXALIAS_RPL (mbtowc, int, |
| 732 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); | 815 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); |
| 733 | # else | 816 | # else |
| 734 | # if !@HAVE_MBTOWC@ | 817 | # if !@HAVE_MBTOWC@ |
| 735 | _GL_FUNCDECL_SYS (mbtowc, int, | 818 | _GL_FUNCDECL_SYS (mbtowc, int, |
| 736 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); | 819 | (wchar_t *restrict pwc, const char *restrict s, size_t n), ); |
| 737 | # endif | 820 | # endif |
| 738 | _GL_CXXALIAS_SYS (mbtowc, int, | 821 | _GL_CXXALIAS_SYS (mbtowc, int, |
| 739 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); | 822 | (wchar_t *restrict pwc, const char *restrict s, size_t n)); |
| @@ -742,7 +825,6 @@ _GL_CXXALIAS_SYS (mbtowc, int, | |||
| 742 | _GL_CXXALIASWARN (mbtowc); | 825 | _GL_CXXALIASWARN (mbtowc); |
| 743 | # endif | 826 | # endif |
| 744 | #elif defined GNULIB_POSIXCHECK | 827 | #elif defined GNULIB_POSIXCHECK |
| 745 | # undef mbtowc | ||
| 746 | # if HAVE_RAW_DECL_MBTOWC | 828 | # if HAVE_RAW_DECL_MBTOWC |
| 747 | _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " | 829 | _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " |
| 748 | "use gnulib module mbtowc for portability"); | 830 | "use gnulib module mbtowc for portability"); |
| @@ -756,12 +838,13 @@ _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " | |||
| 756 | Returns TEMPLATE, or a null pointer if it cannot get a unique name. | 838 | Returns TEMPLATE, or a null pointer if it cannot get a unique name. |
| 757 | The directory is created mode 700. */ | 839 | The directory is created mode 700. */ |
| 758 | # if !@HAVE_MKDTEMP@ | 840 | # if !@HAVE_MKDTEMP@ |
| 759 | _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); | 841 | _GL_FUNCDECL_SYS (mkdtemp, char *, |
| 842 | (char * /*template*/), | ||
| 843 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 760 | # endif | 844 | # endif |
| 761 | _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); | 845 | _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); |
| 762 | _GL_CXXALIASWARN (mkdtemp); | 846 | _GL_CXXALIASWARN (mkdtemp); |
| 763 | #elif defined GNULIB_POSIXCHECK | 847 | #elif defined GNULIB_POSIXCHECK |
| 764 | # undef mkdtemp | ||
| 765 | # if HAVE_RAW_DECL_MKDTEMP | 848 | # if HAVE_RAW_DECL_MKDTEMP |
| 766 | _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " | 849 | _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " |
| 767 | "use gnulib module mkdtemp for portability"); | 850 | "use gnulib module mkdtemp for portability"); |
| @@ -786,13 +869,13 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " | |||
| 786 | # undef mkostemp | 869 | # undef mkostemp |
| 787 | # define mkostemp rpl_mkostemp | 870 | # define mkostemp rpl_mkostemp |
| 788 | # endif | 871 | # endif |
| 789 | _GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/) | 872 | _GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/), |
| 790 | _GL_ARG_NONNULL ((1))); | 873 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 791 | _GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)); | 874 | _GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)); |
| 792 | # else | 875 | # else |
| 793 | # if !@HAVE_MKOSTEMP@ | 876 | # if !@HAVE_MKOSTEMP@ |
| 794 | _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) | 877 | _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/), |
| 795 | _GL_ARG_NONNULL ((1))); | 878 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 796 | # endif | 879 | # endif |
| 797 | _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); | 880 | _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); |
| 798 | # endif | 881 | # endif |
| @@ -800,7 +883,6 @@ _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); | |||
| 800 | _GL_CXXALIASWARN (mkostemp); | 883 | _GL_CXXALIASWARN (mkostemp); |
| 801 | # endif | 884 | # endif |
| 802 | #elif defined GNULIB_POSIXCHECK | 885 | #elif defined GNULIB_POSIXCHECK |
| 803 | # undef mkostemp | ||
| 804 | # if HAVE_RAW_DECL_MKOSTEMP | 886 | # if HAVE_RAW_DECL_MKOSTEMP |
| 805 | _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " | 887 | _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " |
| 806 | "use gnulib module mkostemp for portability"); | 888 | "use gnulib module mkostemp for portability"); |
| @@ -827,15 +909,15 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " | |||
| 827 | # define mkostemps rpl_mkostemps | 909 | # define mkostemps rpl_mkostemps |
| 828 | # endif | 910 | # endif |
| 829 | _GL_FUNCDECL_RPL (mkostemps, int, | 911 | _GL_FUNCDECL_RPL (mkostemps, int, |
| 830 | (char * /*template*/, int /*suffixlen*/, int /*flags*/) | 912 | (char * /*template*/, int /*suffixlen*/, int /*flags*/), |
| 831 | _GL_ARG_NONNULL ((1))); | 913 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 832 | _GL_CXXALIAS_RPL (mkostemps, int, | 914 | _GL_CXXALIAS_RPL (mkostemps, int, |
| 833 | (char * /*template*/, int /*suffixlen*/, int /*flags*/)); | 915 | (char * /*template*/, int /*suffixlen*/, int /*flags*/)); |
| 834 | # else | 916 | # else |
| 835 | # if !@HAVE_MKOSTEMPS@ | 917 | # if !@HAVE_MKOSTEMPS@ |
| 836 | _GL_FUNCDECL_SYS (mkostemps, int, | 918 | _GL_FUNCDECL_SYS (mkostemps, int, |
| 837 | (char * /*template*/, int /*suffixlen*/, int /*flags*/) | 919 | (char * /*template*/, int /*suffixlen*/, int /*flags*/), |
| 838 | _GL_ARG_NONNULL ((1))); | 920 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 839 | # endif | 921 | # endif |
| 840 | _GL_CXXALIAS_SYS (mkostemps, int, | 922 | _GL_CXXALIAS_SYS (mkostemps, int, |
| 841 | (char * /*template*/, int /*suffixlen*/, int /*flags*/)); | 923 | (char * /*template*/, int /*suffixlen*/, int /*flags*/)); |
| @@ -844,7 +926,6 @@ _GL_CXXALIAS_SYS (mkostemps, int, | |||
| 844 | _GL_CXXALIASWARN (mkostemps); | 926 | _GL_CXXALIASWARN (mkostemps); |
| 845 | # endif | 927 | # endif |
| 846 | #elif defined GNULIB_POSIXCHECK | 928 | #elif defined GNULIB_POSIXCHECK |
| 847 | # undef mkostemps | ||
| 848 | # if HAVE_RAW_DECL_MKOSTEMPS | 929 | # if HAVE_RAW_DECL_MKOSTEMPS |
| 849 | _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " | 930 | _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " |
| 850 | "use gnulib module mkostemps for portability"); | 931 | "use gnulib module mkostemps for portability"); |
| @@ -865,17 +946,18 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " | |||
| 865 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 946 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 866 | # define mkstemp rpl_mkstemp | 947 | # define mkstemp rpl_mkstemp |
| 867 | # endif | 948 | # endif |
| 868 | _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); | 949 | _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/), |
| 950 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 869 | _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); | 951 | _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); |
| 870 | # else | 952 | # else |
| 871 | # if ! @HAVE_MKSTEMP@ | 953 | # if ! @HAVE_MKSTEMP@ |
| 872 | _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); | 954 | _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/), |
| 955 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 873 | # endif | 956 | # endif |
| 874 | _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); | 957 | _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); |
| 875 | # endif | 958 | # endif |
| 876 | _GL_CXXALIASWARN (mkstemp); | 959 | _GL_CXXALIASWARN (mkstemp); |
| 877 | #elif defined GNULIB_POSIXCHECK | 960 | #elif defined GNULIB_POSIXCHECK |
| 878 | # undef mkstemp | ||
| 879 | # if HAVE_RAW_DECL_MKSTEMP | 961 | # if HAVE_RAW_DECL_MKSTEMP |
| 880 | _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " | 962 | _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " |
| 881 | "use gnulib module mkstemp for portability"); | 963 | "use gnulib module mkstemp for portability"); |
| @@ -894,13 +976,12 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " | |||
| 894 | Returns the open file descriptor if successful, otherwise -1 and errno | 976 | Returns the open file descriptor if successful, otherwise -1 and errno |
| 895 | set. */ | 977 | set. */ |
| 896 | # if !@HAVE_MKSTEMPS@ | 978 | # if !@HAVE_MKSTEMPS@ |
| 897 | _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) | 979 | _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/), |
| 898 | _GL_ARG_NONNULL ((1))); | 980 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 899 | # endif | 981 | # endif |
| 900 | _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); | 982 | _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); |
| 901 | _GL_CXXALIASWARN (mkstemps); | 983 | _GL_CXXALIASWARN (mkstemps); |
| 902 | #elif defined GNULIB_POSIXCHECK | 984 | #elif defined GNULIB_POSIXCHECK |
| 903 | # undef mkstemps | ||
| 904 | # if HAVE_RAW_DECL_MKSTEMPS | 985 | # if HAVE_RAW_DECL_MKSTEMPS |
| 905 | _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " | 986 | _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " |
| 906 | "use gnulib module mkstemps for portability"); | 987 | "use gnulib module mkstemps for portability"); |
| @@ -931,8 +1012,8 @@ _GL_CXXALIASWARN (mktemp); | |||
| 931 | # define posix_memalign rpl_posix_memalign | 1012 | # define posix_memalign rpl_posix_memalign |
| 932 | # endif | 1013 | # endif |
| 933 | _GL_FUNCDECL_RPL (posix_memalign, int, | 1014 | _GL_FUNCDECL_RPL (posix_memalign, int, |
| 934 | (void **memptr, size_t alignment, size_t size) | 1015 | (void **memptr, size_t alignment, size_t size), |
| 935 | _GL_ARG_NONNULL ((1))); | 1016 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 936 | _GL_CXXALIAS_RPL (posix_memalign, int, | 1017 | _GL_CXXALIAS_RPL (posix_memalign, int, |
| 937 | (void **memptr, size_t alignment, size_t size)); | 1018 | (void **memptr, size_t alignment, size_t size)); |
| 938 | # else | 1019 | # else |
| @@ -945,7 +1026,6 @@ _GL_CXXALIAS_SYS (posix_memalign, int, | |||
| 945 | _GL_CXXALIASWARN (posix_memalign); | 1026 | _GL_CXXALIASWARN (posix_memalign); |
| 946 | # endif | 1027 | # endif |
| 947 | #elif defined GNULIB_POSIXCHECK | 1028 | #elif defined GNULIB_POSIXCHECK |
| 948 | # undef posix_memalign | ||
| 949 | # if HAVE_RAW_DECL_POSIX_MEMALIGN | 1029 | # if HAVE_RAW_DECL_POSIX_MEMALIGN |
| 950 | _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " | 1030 | _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " |
| 951 | "use gnulib module posix_memalign for portability"); | 1031 | "use gnulib module posix_memalign for portability"); |
| @@ -960,11 +1040,11 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " | |||
| 960 | # undef posix_openpt | 1040 | # undef posix_openpt |
| 961 | # define posix_openpt rpl_posix_openpt | 1041 | # define posix_openpt rpl_posix_openpt |
| 962 | # endif | 1042 | # endif |
| 963 | _GL_FUNCDECL_RPL (posix_openpt, int, (int flags)); | 1043 | _GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); |
| 964 | _GL_CXXALIAS_RPL (posix_openpt, int, (int flags)); | 1044 | _GL_CXXALIAS_RPL (posix_openpt, int, (int flags)); |
| 965 | # else | 1045 | # else |
| 966 | # if !@HAVE_POSIX_OPENPT@ | 1046 | # if !@HAVE_POSIX_OPENPT@ |
| 967 | _GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); | 1047 | _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); |
| 968 | # endif | 1048 | # endif |
| 969 | _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); | 1049 | _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); |
| 970 | # endif | 1050 | # endif |
| @@ -972,7 +1052,6 @@ _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); | |||
| 972 | _GL_CXXALIASWARN (posix_openpt); | 1052 | _GL_CXXALIASWARN (posix_openpt); |
| 973 | # endif | 1053 | # endif |
| 974 | #elif defined GNULIB_POSIXCHECK | 1054 | #elif defined GNULIB_POSIXCHECK |
| 975 | # undef posix_openpt | ||
| 976 | # if HAVE_RAW_DECL_POSIX_OPENPT | 1055 | # if HAVE_RAW_DECL_POSIX_OPENPT |
| 977 | _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " | 1056 | _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " |
| 978 | "use gnulib module posix_openpt for portability"); | 1057 | "use gnulib module posix_openpt for portability"); |
| @@ -987,17 +1066,16 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " | |||
| 987 | # undef ptsname | 1066 | # undef ptsname |
| 988 | # define ptsname rpl_ptsname | 1067 | # define ptsname rpl_ptsname |
| 989 | # endif | 1068 | # endif |
| 990 | _GL_FUNCDECL_RPL (ptsname, char *, (int fd)); | 1069 | _GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD); |
| 991 | _GL_CXXALIAS_RPL (ptsname, char *, (int fd)); | 1070 | _GL_CXXALIAS_RPL (ptsname, char *, (int fd)); |
| 992 | # else | 1071 | # else |
| 993 | # if !@HAVE_PTSNAME@ | 1072 | # if !@HAVE_PTSNAME@ |
| 994 | _GL_FUNCDECL_SYS (ptsname, char *, (int fd)); | 1073 | _GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD); |
| 995 | # endif | 1074 | # endif |
| 996 | _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); | 1075 | _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); |
| 997 | # endif | 1076 | # endif |
| 998 | _GL_CXXALIASWARN (ptsname); | 1077 | _GL_CXXALIASWARN (ptsname); |
| 999 | #elif defined GNULIB_POSIXCHECK | 1078 | #elif defined GNULIB_POSIXCHECK |
| 1000 | # undef ptsname | ||
| 1001 | # if HAVE_RAW_DECL_PTSNAME | 1079 | # if HAVE_RAW_DECL_PTSNAME |
| 1002 | _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " | 1080 | _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " |
| 1003 | "use gnulib module ptsname for portability"); | 1081 | "use gnulib module ptsname for portability"); |
| @@ -1013,11 +1091,11 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " | |||
| 1013 | # undef ptsname_r | 1091 | # undef ptsname_r |
| 1014 | # define ptsname_r rpl_ptsname_r | 1092 | # define ptsname_r rpl_ptsname_r |
| 1015 | # endif | 1093 | # endif |
| 1016 | _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); | 1094 | _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), ); |
| 1017 | _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); | 1095 | _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 1018 | # else | 1096 | # else |
| 1019 | # if !@HAVE_PTSNAME_R@ | 1097 | # if !@HAVE_PTSNAME_R@ |
| 1020 | _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); | 1098 | _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), ); |
| 1021 | # endif | 1099 | # endif |
| 1022 | _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); | 1100 | _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 1023 | # endif | 1101 | # endif |
| @@ -1026,7 +1104,6 @@ _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); | |||
| 1026 | # endif | 1104 | # endif |
| 1027 | _GL_CXXALIASWARN (ptsname_r); | 1105 | _GL_CXXALIASWARN (ptsname_r); |
| 1028 | #elif defined GNULIB_POSIXCHECK | 1106 | #elif defined GNULIB_POSIXCHECK |
| 1029 | # undef ptsname_r | ||
| 1030 | # if HAVE_RAW_DECL_PTSNAME_R | 1107 | # if HAVE_RAW_DECL_PTSNAME_R |
| 1031 | _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " | 1108 | _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " |
| 1032 | "use gnulib module ptsname_r for portability"); | 1109 | "use gnulib module ptsname_r for portability"); |
| @@ -1039,7 +1116,7 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " | |||
| 1039 | # undef putenv | 1116 | # undef putenv |
| 1040 | # define putenv rpl_putenv | 1117 | # define putenv rpl_putenv |
| 1041 | # endif | 1118 | # endif |
| 1042 | _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); | 1119 | _GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1))); |
| 1043 | _GL_CXXALIAS_RPL (putenv, int, (char *string)); | 1120 | _GL_CXXALIAS_RPL (putenv, int, (char *string)); |
| 1044 | # elif defined _WIN32 && !defined __CYGWIN__ | 1121 | # elif defined _WIN32 && !defined __CYGWIN__ |
| 1045 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1122 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| @@ -1098,7 +1175,9 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *); | |||
| 1098 | # endif | 1175 | # endif |
| 1099 | _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, | 1176 | _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| 1100 | _gl_qsort_r_compar_fn compare, | 1177 | _gl_qsort_r_compar_fn compare, |
| 1101 | void *arg) _GL_ARG_NONNULL ((1, 4))); | 1178 | void *arg), |
| 1179 | _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) | ||
| 1180 | _GL_ARG_NONNULL ((4))); | ||
| 1102 | _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, | 1181 | _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| 1103 | _gl_qsort_r_compar_fn compare, | 1182 | _gl_qsort_r_compar_fn compare, |
| 1104 | void *arg)); | 1183 | void *arg)); |
| @@ -1106,7 +1185,9 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, | |||
| 1106 | # if !@HAVE_QSORT_R@ | 1185 | # if !@HAVE_QSORT_R@ |
| 1107 | _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, | 1186 | _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| 1108 | _gl_qsort_r_compar_fn compare, | 1187 | _gl_qsort_r_compar_fn compare, |
| 1109 | void *arg) _GL_ARG_NONNULL ((1, 4))); | 1188 | void *arg), |
| 1189 | _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) | ||
| 1190 | _GL_ARG_NONNULL ((4))); | ||
| 1110 | # endif | 1191 | # endif |
| 1111 | _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, | 1192 | _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| 1112 | _gl_qsort_r_compar_fn compare, | 1193 | _gl_qsort_r_compar_fn compare, |
| @@ -1116,7 +1197,6 @@ _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, | |||
| 1116 | _GL_CXXALIASWARN (qsort_r); | 1197 | _GL_CXXALIASWARN (qsort_r); |
| 1117 | # endif | 1198 | # endif |
| 1118 | #elif defined GNULIB_POSIXCHECK | 1199 | #elif defined GNULIB_POSIXCHECK |
| 1119 | # undef qsort_r | ||
| 1120 | # if HAVE_RAW_DECL_QSORT_R | 1200 | # if HAVE_RAW_DECL_QSORT_R |
| 1121 | _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " | 1201 | _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " |
| 1122 | "use gnulib module qsort_r for portability"); | 1202 | "use gnulib module qsort_r for portability"); |
| @@ -1137,7 +1217,7 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " | |||
| 1137 | # undef rand | 1217 | # undef rand |
| 1138 | # define rand rpl_rand | 1218 | # define rand rpl_rand |
| 1139 | # endif | 1219 | # endif |
| 1140 | _GL_FUNCDECL_RPL (rand, int, (void)); | 1220 | _GL_FUNCDECL_RPL (rand, int, (void), ); |
| 1141 | _GL_CXXALIAS_RPL (rand, int, (void)); | 1221 | _GL_CXXALIAS_RPL (rand, int, (void)); |
| 1142 | # else | 1222 | # else |
| 1143 | _GL_CXXALIAS_SYS (rand, int, (void)); | 1223 | _GL_CXXALIAS_SYS (rand, int, (void)); |
| @@ -1154,11 +1234,11 @@ _GL_CXXALIASWARN (rand); | |||
| 1154 | # undef random | 1234 | # undef random |
| 1155 | # define random rpl_random | 1235 | # define random rpl_random |
| 1156 | # endif | 1236 | # endif |
| 1157 | _GL_FUNCDECL_RPL (random, long, (void)); | 1237 | _GL_FUNCDECL_RPL (random, long, (void), ); |
| 1158 | _GL_CXXALIAS_RPL (random, long, (void)); | 1238 | _GL_CXXALIAS_RPL (random, long, (void)); |
| 1159 | # else | 1239 | # else |
| 1160 | # if !@HAVE_RANDOM@ | 1240 | # if !@HAVE_RANDOM@ |
| 1161 | _GL_FUNCDECL_SYS (random, long, (void)); | 1241 | _GL_FUNCDECL_SYS (random, long, (void), ); |
| 1162 | # endif | 1242 | # endif |
| 1163 | /* Need to cast, because on Haiku, the return type is | 1243 | /* Need to cast, because on Haiku, the return type is |
| 1164 | int. */ | 1244 | int. */ |
| @@ -1168,7 +1248,6 @@ _GL_CXXALIAS_SYS_CAST (random, long, (void)); | |||
| 1168 | _GL_CXXALIASWARN (random); | 1248 | _GL_CXXALIASWARN (random); |
| 1169 | # endif | 1249 | # endif |
| 1170 | #elif defined GNULIB_POSIXCHECK | 1250 | #elif defined GNULIB_POSIXCHECK |
| 1171 | # undef random | ||
| 1172 | # if HAVE_RAW_DECL_RANDOM | 1251 | # if HAVE_RAW_DECL_RANDOM |
| 1173 | _GL_WARN_ON_USE (random, "random is unportable - " | 1252 | _GL_WARN_ON_USE (random, "random is unportable - " |
| 1174 | "use gnulib module random for portability"); | 1253 | "use gnulib module random for portability"); |
| @@ -1181,11 +1260,11 @@ _GL_WARN_ON_USE (random, "random is unportable - " | |||
| 1181 | # undef srandom | 1260 | # undef srandom |
| 1182 | # define srandom rpl_srandom | 1261 | # define srandom rpl_srandom |
| 1183 | # endif | 1262 | # endif |
| 1184 | _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); | 1263 | _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), ); |
| 1185 | _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); | 1264 | _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); |
| 1186 | # else | 1265 | # else |
| 1187 | # if !@HAVE_RANDOM@ | 1266 | # if !@HAVE_RANDOM@ |
| 1188 | _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); | 1267 | _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), ); |
| 1189 | # endif | 1268 | # endif |
| 1190 | /* Need to cast, because on FreeBSD, the first parameter is | 1269 | /* Need to cast, because on FreeBSD, the first parameter is |
| 1191 | unsigned long seed. */ | 1270 | unsigned long seed. */ |
| @@ -1195,7 +1274,6 @@ _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed)); | |||
| 1195 | _GL_CXXALIASWARN (srandom); | 1274 | _GL_CXXALIASWARN (srandom); |
| 1196 | # endif | 1275 | # endif |
| 1197 | #elif defined GNULIB_POSIXCHECK | 1276 | #elif defined GNULIB_POSIXCHECK |
| 1198 | # undef srandom | ||
| 1199 | # if HAVE_RAW_DECL_SRANDOM | 1277 | # if HAVE_RAW_DECL_SRANDOM |
| 1200 | _GL_WARN_ON_USE (srandom, "srandom is unportable - " | 1278 | _GL_WARN_ON_USE (srandom, "srandom is unportable - " |
| 1201 | "use gnulib module random for portability"); | 1279 | "use gnulib module random for portability"); |
| @@ -1209,14 +1287,14 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - " | |||
| 1209 | # define initstate rpl_initstate | 1287 | # define initstate rpl_initstate |
| 1210 | # endif | 1288 | # endif |
| 1211 | _GL_FUNCDECL_RPL (initstate, char *, | 1289 | _GL_FUNCDECL_RPL (initstate, char *, |
| 1212 | (unsigned int seed, char *buf, size_t buf_size) | 1290 | (unsigned int seed, char *buf, size_t buf_size), |
| 1213 | _GL_ARG_NONNULL ((2))); | 1291 | _GL_ARG_NONNULL ((2))); |
| 1214 | _GL_CXXALIAS_RPL (initstate, char *, | 1292 | _GL_CXXALIAS_RPL (initstate, char *, |
| 1215 | (unsigned int seed, char *buf, size_t buf_size)); | 1293 | (unsigned int seed, char *buf, size_t buf_size)); |
| 1216 | # else | 1294 | # else |
| 1217 | # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ | 1295 | # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ |
| 1218 | _GL_FUNCDECL_SYS (initstate, char *, | 1296 | _GL_FUNCDECL_SYS (initstate, char *, |
| 1219 | (unsigned int seed, char *buf, size_t buf_size) | 1297 | (unsigned int seed, char *buf, size_t buf_size), |
| 1220 | _GL_ARG_NONNULL ((2))); | 1298 | _GL_ARG_NONNULL ((2))); |
| 1221 | # endif | 1299 | # endif |
| 1222 | /* Need to cast, because on FreeBSD, the first parameter is | 1300 | /* Need to cast, because on FreeBSD, the first parameter is |
| @@ -1228,7 +1306,6 @@ _GL_CXXALIAS_SYS_CAST (initstate, char *, | |||
| 1228 | _GL_CXXALIASWARN (initstate); | 1306 | _GL_CXXALIASWARN (initstate); |
| 1229 | # endif | 1307 | # endif |
| 1230 | #elif defined GNULIB_POSIXCHECK | 1308 | #elif defined GNULIB_POSIXCHECK |
| 1231 | # undef initstate | ||
| 1232 | # if HAVE_RAW_DECL_INITSTATE | 1309 | # if HAVE_RAW_DECL_INITSTATE |
| 1233 | _GL_WARN_ON_USE (initstate, "initstate is unportable - " | 1310 | _GL_WARN_ON_USE (initstate, "initstate is unportable - " |
| 1234 | "use gnulib module random for portability"); | 1311 | "use gnulib module random for portability"); |
| @@ -1241,11 +1318,11 @@ _GL_WARN_ON_USE (initstate, "initstate is unportable - " | |||
| 1241 | # undef setstate | 1318 | # undef setstate |
| 1242 | # define setstate rpl_setstate | 1319 | # define setstate rpl_setstate |
| 1243 | # endif | 1320 | # endif |
| 1244 | _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); | 1321 | _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1))); |
| 1245 | _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); | 1322 | _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); |
| 1246 | # else | 1323 | # else |
| 1247 | # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ | 1324 | # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ |
| 1248 | _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); | 1325 | _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1))); |
| 1249 | # endif | 1326 | # endif |
| 1250 | /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter | 1327 | /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter |
| 1251 | is const char *arg_state. */ | 1328 | is const char *arg_state. */ |
| @@ -1255,7 +1332,6 @@ _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state)); | |||
| 1255 | _GL_CXXALIASWARN (setstate); | 1332 | _GL_CXXALIASWARN (setstate); |
| 1256 | # endif | 1333 | # endif |
| 1257 | #elif defined GNULIB_POSIXCHECK | 1334 | #elif defined GNULIB_POSIXCHECK |
| 1258 | # undef setstate | ||
| 1259 | # if HAVE_RAW_DECL_SETSTATE | 1335 | # if HAVE_RAW_DECL_SETSTATE |
| 1260 | _GL_WARN_ON_USE (setstate, "setstate is unportable - " | 1336 | _GL_WARN_ON_USE (setstate, "setstate is unportable - " |
| 1261 | "use gnulib module random for portability"); | 1337 | "use gnulib module random for portability"); |
| @@ -1269,19 +1345,18 @@ _GL_WARN_ON_USE (setstate, "setstate is unportable - " | |||
| 1269 | # undef random_r | 1345 | # undef random_r |
| 1270 | # define random_r rpl_random_r | 1346 | # define random_r rpl_random_r |
| 1271 | # endif | 1347 | # endif |
| 1272 | _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) | 1348 | _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result), |
| 1273 | _GL_ARG_NONNULL ((1, 2))); | 1349 | _GL_ARG_NONNULL ((1, 2))); |
| 1274 | _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); | 1350 | _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); |
| 1275 | # else | 1351 | # else |
| 1276 | # if !@HAVE_RANDOM_R@ | 1352 | # if !@HAVE_RANDOM_R@ |
| 1277 | _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) | 1353 | _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result), |
| 1278 | _GL_ARG_NONNULL ((1, 2))); | 1354 | _GL_ARG_NONNULL ((1, 2))); |
| 1279 | # endif | 1355 | # endif |
| 1280 | _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); | 1356 | _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); |
| 1281 | # endif | 1357 | # endif |
| 1282 | _GL_CXXALIASWARN (random_r); | 1358 | _GL_CXXALIASWARN (random_r); |
| 1283 | #elif defined GNULIB_POSIXCHECK | 1359 | #elif defined GNULIB_POSIXCHECK |
| 1284 | # undef random_r | ||
| 1285 | # if HAVE_RAW_DECL_RANDOM_R | 1360 | # if HAVE_RAW_DECL_RANDOM_R |
| 1286 | _GL_WARN_ON_USE (random_r, "random_r is unportable - " | 1361 | _GL_WARN_ON_USE (random_r, "random_r is unportable - " |
| 1287 | "use gnulib module random_r for portability"); | 1362 | "use gnulib module random_r for portability"); |
| @@ -1295,14 +1370,14 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - " | |||
| 1295 | # define srandom_r rpl_srandom_r | 1370 | # define srandom_r rpl_srandom_r |
| 1296 | # endif | 1371 | # endif |
| 1297 | _GL_FUNCDECL_RPL (srandom_r, int, | 1372 | _GL_FUNCDECL_RPL (srandom_r, int, |
| 1298 | (unsigned int seed, struct random_data *rand_state) | 1373 | (unsigned int seed, struct random_data *rand_state), |
| 1299 | _GL_ARG_NONNULL ((2))); | 1374 | _GL_ARG_NONNULL ((2))); |
| 1300 | _GL_CXXALIAS_RPL (srandom_r, int, | 1375 | _GL_CXXALIAS_RPL (srandom_r, int, |
| 1301 | (unsigned int seed, struct random_data *rand_state)); | 1376 | (unsigned int seed, struct random_data *rand_state)); |
| 1302 | # else | 1377 | # else |
| 1303 | # if !@HAVE_RANDOM_R@ | 1378 | # if !@HAVE_RANDOM_R@ |
| 1304 | _GL_FUNCDECL_SYS (srandom_r, int, | 1379 | _GL_FUNCDECL_SYS (srandom_r, int, |
| 1305 | (unsigned int seed, struct random_data *rand_state) | 1380 | (unsigned int seed, struct random_data *rand_state), |
| 1306 | _GL_ARG_NONNULL ((2))); | 1381 | _GL_ARG_NONNULL ((2))); |
| 1307 | # endif | 1382 | # endif |
| 1308 | _GL_CXXALIAS_SYS (srandom_r, int, | 1383 | _GL_CXXALIAS_SYS (srandom_r, int, |
| @@ -1310,7 +1385,6 @@ _GL_CXXALIAS_SYS (srandom_r, int, | |||
| 1310 | # endif | 1385 | # endif |
| 1311 | _GL_CXXALIASWARN (srandom_r); | 1386 | _GL_CXXALIASWARN (srandom_r); |
| 1312 | #elif defined GNULIB_POSIXCHECK | 1387 | #elif defined GNULIB_POSIXCHECK |
| 1313 | # undef srandom_r | ||
| 1314 | # if HAVE_RAW_DECL_SRANDOM_R | 1388 | # if HAVE_RAW_DECL_SRANDOM_R |
| 1315 | _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " | 1389 | _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " |
| 1316 | "use gnulib module random_r for portability"); | 1390 | "use gnulib module random_r for portability"); |
| @@ -1325,7 +1399,7 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " | |||
| 1325 | # endif | 1399 | # endif |
| 1326 | _GL_FUNCDECL_RPL (initstate_r, int, | 1400 | _GL_FUNCDECL_RPL (initstate_r, int, |
| 1327 | (unsigned int seed, char *buf, size_t buf_size, | 1401 | (unsigned int seed, char *buf, size_t buf_size, |
| 1328 | struct random_data *rand_state) | 1402 | struct random_data *rand_state), |
| 1329 | _GL_ARG_NONNULL ((2, 4))); | 1403 | _GL_ARG_NONNULL ((2, 4))); |
| 1330 | _GL_CXXALIAS_RPL (initstate_r, int, | 1404 | _GL_CXXALIAS_RPL (initstate_r, int, |
| 1331 | (unsigned int seed, char *buf, size_t buf_size, | 1405 | (unsigned int seed, char *buf, size_t buf_size, |
| @@ -1334,7 +1408,7 @@ _GL_CXXALIAS_RPL (initstate_r, int, | |||
| 1334 | # if !@HAVE_RANDOM_R@ | 1408 | # if !@HAVE_RANDOM_R@ |
| 1335 | _GL_FUNCDECL_SYS (initstate_r, int, | 1409 | _GL_FUNCDECL_SYS (initstate_r, int, |
| 1336 | (unsigned int seed, char *buf, size_t buf_size, | 1410 | (unsigned int seed, char *buf, size_t buf_size, |
| 1337 | struct random_data *rand_state) | 1411 | struct random_data *rand_state), |
| 1338 | _GL_ARG_NONNULL ((2, 4))); | 1412 | _GL_ARG_NONNULL ((2, 4))); |
| 1339 | # endif | 1413 | # endif |
| 1340 | /* Need to cast, because on Haiku, the third parameter is | 1414 | /* Need to cast, because on Haiku, the third parameter is |
| @@ -1345,7 +1419,6 @@ _GL_CXXALIAS_SYS_CAST (initstate_r, int, | |||
| 1345 | # endif | 1419 | # endif |
| 1346 | _GL_CXXALIASWARN (initstate_r); | 1420 | _GL_CXXALIASWARN (initstate_r); |
| 1347 | #elif defined GNULIB_POSIXCHECK | 1421 | #elif defined GNULIB_POSIXCHECK |
| 1348 | # undef initstate_r | ||
| 1349 | # if HAVE_RAW_DECL_INITSTATE_R | 1422 | # if HAVE_RAW_DECL_INITSTATE_R |
| 1350 | _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " | 1423 | _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " |
| 1351 | "use gnulib module random_r for portability"); | 1424 | "use gnulib module random_r for portability"); |
| @@ -1359,14 +1432,14 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " | |||
| 1359 | # define setstate_r rpl_setstate_r | 1432 | # define setstate_r rpl_setstate_r |
| 1360 | # endif | 1433 | # endif |
| 1361 | _GL_FUNCDECL_RPL (setstate_r, int, | 1434 | _GL_FUNCDECL_RPL (setstate_r, int, |
| 1362 | (char *arg_state, struct random_data *rand_state) | 1435 | (char *arg_state, struct random_data *rand_state), |
| 1363 | _GL_ARG_NONNULL ((1, 2))); | 1436 | _GL_ARG_NONNULL ((1, 2))); |
| 1364 | _GL_CXXALIAS_RPL (setstate_r, int, | 1437 | _GL_CXXALIAS_RPL (setstate_r, int, |
| 1365 | (char *arg_state, struct random_data *rand_state)); | 1438 | (char *arg_state, struct random_data *rand_state)); |
| 1366 | # else | 1439 | # else |
| 1367 | # if !@HAVE_RANDOM_R@ | 1440 | # if !@HAVE_RANDOM_R@ |
| 1368 | _GL_FUNCDECL_SYS (setstate_r, int, | 1441 | _GL_FUNCDECL_SYS (setstate_r, int, |
| 1369 | (char *arg_state, struct random_data *rand_state) | 1442 | (char *arg_state, struct random_data *rand_state), |
| 1370 | _GL_ARG_NONNULL ((1, 2))); | 1443 | _GL_ARG_NONNULL ((1, 2))); |
| 1371 | # endif | 1444 | # endif |
| 1372 | /* Need to cast, because on Haiku, the first parameter is | 1445 | /* Need to cast, because on Haiku, the first parameter is |
| @@ -1376,7 +1449,6 @@ _GL_CXXALIAS_SYS_CAST (setstate_r, int, | |||
| 1376 | # endif | 1449 | # endif |
| 1377 | _GL_CXXALIASWARN (setstate_r); | 1450 | _GL_CXXALIASWARN (setstate_r); |
| 1378 | #elif defined GNULIB_POSIXCHECK | 1451 | #elif defined GNULIB_POSIXCHECK |
| 1379 | # undef setstate_r | ||
| 1380 | # if HAVE_RAW_DECL_SETSTATE_R | 1452 | # if HAVE_RAW_DECL_SETSTATE_R |
| 1381 | _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " | 1453 | _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " |
| 1382 | "use gnulib module random_r for portability"); | 1454 | "use gnulib module random_r for portability"); |
| @@ -1385,28 +1457,44 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " | |||
| 1385 | 1457 | ||
| 1386 | 1458 | ||
| 1387 | #if @GNULIB_REALLOC_POSIX@ | 1459 | #if @GNULIB_REALLOC_POSIX@ |
| 1388 | # if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \ | 1460 | # if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ |
| 1389 | || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@) | 1461 | # if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2 |
| 1462 | # define _GL_INLINE_RPL_REALLOC 1 | ||
| 1463 | # ifdef __cplusplus | ||
| 1464 | extern "C" { | ||
| 1465 | # endif | ||
| 1466 | _GL_REALLOC_INLINE void * | ||
| 1467 | rpl_realloc (void *ptr, size_t size) | ||
| 1468 | { | ||
| 1469 | return realloc (ptr, size ? size : 1); | ||
| 1470 | } | ||
| 1471 | # ifdef __cplusplus | ||
| 1472 | } | ||
| 1473 | # endif | ||
| 1474 | # endif | ||
| 1390 | # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ | 1475 | # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
| 1391 | || _GL_USE_STDLIB_ALLOC) | 1476 | || _GL_USE_STDLIB_ALLOC) |
| 1392 | # undef realloc | 1477 | # undef realloc |
| 1393 | # define realloc rpl_realloc | 1478 | # define realloc rpl_realloc |
| 1394 | # endif | 1479 | # endif |
| 1395 | _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size) | 1480 | # if !defined _GL_INLINE_RPL_REALLOC |
| 1396 | _GL_ATTRIBUTE_DEALLOC_FREE); | 1481 | _GL_FUNCDECL_RPL (realloc, void *, |
| 1482 | (void *ptr, size_t size), | ||
| 1483 | _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD); | ||
| 1484 | # endif | ||
| 1397 | _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); | 1485 | _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); |
| 1398 | # else | 1486 | # else |
| 1399 | # if __GNUC__ >= 11 | 1487 | # if __GNUC__ >= 11 && !defined __clang__ |
| 1400 | /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ | 1488 | /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ |
| 1401 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 1489 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 1402 | _GL_FUNCDECL_SYS (realloc, void *, | 1490 | _GL_FUNCDECL_SYS (realloc, void *, |
| 1403 | (void *ptr, size_t size) | 1491 | (void *ptr, size_t size), |
| 1404 | _GL_ATTRIBUTE_NOTHROW | 1492 | _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD) |
| 1405 | _GL_ATTRIBUTE_DEALLOC_FREE); | 1493 | _GL_ATTRIBUTE_NOTHROW; |
| 1406 | # else | 1494 | # else |
| 1407 | _GL_FUNCDECL_SYS (realloc, void *, | 1495 | _GL_FUNCDECL_SYS (realloc, void *, |
| 1408 | (void *ptr, size_t size) | 1496 | (void *ptr, size_t size), |
| 1409 | _GL_ATTRIBUTE_DEALLOC_FREE); | 1497 | _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD); |
| 1410 | # endif | 1498 | # endif |
| 1411 | # endif | 1499 | # endif |
| 1412 | _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); | 1500 | _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); |
| @@ -1415,21 +1503,21 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); | |||
| 1415 | _GL_CXXALIASWARN (realloc); | 1503 | _GL_CXXALIASWARN (realloc); |
| 1416 | # endif | 1504 | # endif |
| 1417 | #else | 1505 | #else |
| 1418 | # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc | 1506 | # if @GNULIB_FREE_POSIX@ \ |
| 1507 | && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc | ||
| 1419 | /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ | 1508 | /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ |
| 1420 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 | 1509 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 |
| 1421 | _GL_FUNCDECL_SYS (realloc, void *, | 1510 | _GL_FUNCDECL_SYS (realloc, void *, |
| 1422 | (void *ptr, size_t size) | 1511 | (void *ptr, size_t size), |
| 1423 | _GL_ATTRIBUTE_NOTHROW | 1512 | _GL_ATTRIBUTE_DEALLOC_FREE) |
| 1424 | _GL_ATTRIBUTE_DEALLOC_FREE); | 1513 | _GL_ATTRIBUTE_NOTHROW; |
| 1425 | # else | 1514 | # else |
| 1426 | _GL_FUNCDECL_SYS (realloc, void *, | 1515 | _GL_FUNCDECL_SYS (realloc, void *, |
| 1427 | (void *ptr, size_t size) | 1516 | (void *ptr, size_t size), |
| 1428 | _GL_ATTRIBUTE_DEALLOC_FREE); | 1517 | _GL_ATTRIBUTE_DEALLOC_FREE); |
| 1429 | # endif | 1518 | # endif |
| 1430 | # endif | 1519 | # endif |
| 1431 | # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC | 1520 | # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
| 1432 | # undef realloc | ||
| 1433 | /* Assume realloc is always declared. */ | 1521 | /* Assume realloc is always declared. */ |
| 1434 | _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " | 1522 | _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " |
| 1435 | "use gnulib module realloc-posix for portability"); | 1523 | "use gnulib module realloc-posix for portability"); |
| @@ -1444,13 +1532,15 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " | |||
| 1444 | # define reallocarray rpl_reallocarray | 1532 | # define reallocarray rpl_reallocarray |
| 1445 | # endif | 1533 | # endif |
| 1446 | _GL_FUNCDECL_RPL (reallocarray, void *, | 1534 | _GL_FUNCDECL_RPL (reallocarray, void *, |
| 1447 | (void *ptr, size_t nmemb, size_t size)); | 1535 | (void *ptr, size_t nmemb, size_t size), |
| 1536 | _GL_ATTRIBUTE_NODISCARD); | ||
| 1448 | _GL_CXXALIAS_RPL (reallocarray, void *, | 1537 | _GL_CXXALIAS_RPL (reallocarray, void *, |
| 1449 | (void *ptr, size_t nmemb, size_t size)); | 1538 | (void *ptr, size_t nmemb, size_t size)); |
| 1450 | # else | 1539 | # else |
| 1451 | # if ! @HAVE_REALLOCARRAY@ | 1540 | # if ! @HAVE_REALLOCARRAY@ |
| 1452 | _GL_FUNCDECL_SYS (reallocarray, void *, | 1541 | _GL_FUNCDECL_SYS (reallocarray, void *, |
| 1453 | (void *ptr, size_t nmemb, size_t size)); | 1542 | (void *ptr, size_t nmemb, size_t size), |
| 1543 | _GL_ATTRIBUTE_NODISCARD); | ||
| 1454 | # endif | 1544 | # endif |
| 1455 | _GL_CXXALIAS_SYS (reallocarray, void *, | 1545 | _GL_CXXALIAS_SYS (reallocarray, void *, |
| 1456 | (void *ptr, size_t nmemb, size_t size)); | 1546 | (void *ptr, size_t nmemb, size_t size)); |
| @@ -1459,7 +1549,6 @@ _GL_CXXALIAS_SYS (reallocarray, void *, | |||
| 1459 | _GL_CXXALIASWARN (reallocarray); | 1549 | _GL_CXXALIASWARN (reallocarray); |
| 1460 | # endif | 1550 | # endif |
| 1461 | #elif defined GNULIB_POSIXCHECK | 1551 | #elif defined GNULIB_POSIXCHECK |
| 1462 | # undef reallocarray | ||
| 1463 | # if HAVE_RAW_DECL_REALLOCARRAY | 1552 | # if HAVE_RAW_DECL_REALLOCARRAY |
| 1464 | _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " | 1553 | _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " |
| 1465 | "use gnulib module reallocarray for portability"); | 1554 | "use gnulib module reallocarray for portability"); |
| @@ -1472,22 +1561,21 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " | |||
| 1472 | # define realpath rpl_realpath | 1561 | # define realpath rpl_realpath |
| 1473 | # endif | 1562 | # endif |
| 1474 | _GL_FUNCDECL_RPL (realpath, char *, | 1563 | _GL_FUNCDECL_RPL (realpath, char *, |
| 1475 | (const char *restrict name, char *restrict resolved) | 1564 | (const char *restrict name, char *restrict resolved), |
| 1476 | _GL_ARG_NONNULL ((1))); | 1565 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 1477 | _GL_CXXALIAS_RPL (realpath, char *, | 1566 | _GL_CXXALIAS_RPL (realpath, char *, |
| 1478 | (const char *restrict name, char *restrict resolved)); | 1567 | (const char *restrict name, char *restrict resolved)); |
| 1479 | # else | 1568 | # else |
| 1480 | # if !@HAVE_REALPATH@ | 1569 | # if !@HAVE_REALPATH@ |
| 1481 | _GL_FUNCDECL_SYS (realpath, char *, | 1570 | _GL_FUNCDECL_SYS (realpath, char *, |
| 1482 | (const char *restrict name, char *restrict resolved) | 1571 | (const char *restrict name, char *restrict resolved), |
| 1483 | _GL_ARG_NONNULL ((1))); | 1572 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); |
| 1484 | # endif | 1573 | # endif |
| 1485 | _GL_CXXALIAS_SYS (realpath, char *, | 1574 | _GL_CXXALIAS_SYS (realpath, char *, |
| 1486 | (const char *restrict name, char *restrict resolved)); | 1575 | (const char *restrict name, char *restrict resolved)); |
| 1487 | # endif | 1576 | # endif |
| 1488 | _GL_CXXALIASWARN (realpath); | 1577 | _GL_CXXALIASWARN (realpath); |
| 1489 | #elif defined GNULIB_POSIXCHECK | 1578 | #elif defined GNULIB_POSIXCHECK |
| 1490 | # undef realpath | ||
| 1491 | # if HAVE_RAW_DECL_REALPATH | 1579 | # if HAVE_RAW_DECL_REALPATH |
| 1492 | _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " | 1580 | _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " |
| 1493 | "canonicalize or canonicalize-lgpl for portability"); | 1581 | "canonicalize or canonicalize-lgpl for portability"); |
| @@ -1498,12 +1586,12 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " | |||
| 1498 | /* Test a user response to a question. | 1586 | /* Test a user response to a question. |
| 1499 | Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ | 1587 | Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ |
| 1500 | # if !@HAVE_RPMATCH@ | 1588 | # if !@HAVE_RPMATCH@ |
| 1501 | _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); | 1589 | _GL_FUNCDECL_SYS (rpmatch, int, (const char *response), |
| 1590 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 1502 | # endif | 1591 | # endif |
| 1503 | _GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); | 1592 | _GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); |
| 1504 | _GL_CXXALIASWARN (rpmatch); | 1593 | _GL_CXXALIASWARN (rpmatch); |
| 1505 | #elif defined GNULIB_POSIXCHECK | 1594 | #elif defined GNULIB_POSIXCHECK |
| 1506 | # undef rpmatch | ||
| 1507 | # if HAVE_RAW_DECL_RPMATCH | 1595 | # if HAVE_RAW_DECL_RPMATCH |
| 1508 | _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " | 1596 | _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " |
| 1509 | "use gnulib module rpmatch for portability"); | 1597 | "use gnulib module rpmatch for portability"); |
| @@ -1514,12 +1602,12 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " | |||
| 1514 | /* Look up NAME in the environment, returning 0 in insecure situations. */ | 1602 | /* Look up NAME in the environment, returning 0 in insecure situations. */ |
| 1515 | # if !@HAVE_SECURE_GETENV@ | 1603 | # if !@HAVE_SECURE_GETENV@ |
| 1516 | _GL_FUNCDECL_SYS (secure_getenv, char *, | 1604 | _GL_FUNCDECL_SYS (secure_getenv, char *, |
| 1517 | (char const *name) _GL_ARG_NONNULL ((1))); | 1605 | (char const *name), |
| 1606 | _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); | ||
| 1518 | # endif | 1607 | # endif |
| 1519 | _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); | 1608 | _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); |
| 1520 | _GL_CXXALIASWARN (secure_getenv); | 1609 | _GL_CXXALIASWARN (secure_getenv); |
| 1521 | #elif defined GNULIB_POSIXCHECK | 1610 | #elif defined GNULIB_POSIXCHECK |
| 1522 | # undef secure_getenv | ||
| 1523 | # if HAVE_RAW_DECL_SECURE_GETENV | 1611 | # if HAVE_RAW_DECL_SECURE_GETENV |
| 1524 | _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " | 1612 | _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " |
| 1525 | "use gnulib module secure_getenv for portability"); | 1613 | "use gnulib module secure_getenv for portability"); |
| @@ -1535,14 +1623,14 @@ _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " | |||
| 1535 | # define setenv rpl_setenv | 1623 | # define setenv rpl_setenv |
| 1536 | # endif | 1624 | # endif |
| 1537 | _GL_FUNCDECL_RPL (setenv, int, | 1625 | _GL_FUNCDECL_RPL (setenv, int, |
| 1538 | (const char *name, const char *value, int replace) | 1626 | (const char *name, const char *value, int replace), |
| 1539 | _GL_ARG_NONNULL ((1))); | 1627 | _GL_ARG_NONNULL ((1))); |
| 1540 | _GL_CXXALIAS_RPL (setenv, int, | 1628 | _GL_CXXALIAS_RPL (setenv, int, |
| 1541 | (const char *name, const char *value, int replace)); | 1629 | (const char *name, const char *value, int replace)); |
| 1542 | # else | 1630 | # else |
| 1543 | # if !@HAVE_DECL_SETENV@ | 1631 | # if !@HAVE_DECL_SETENV@ |
| 1544 | _GL_FUNCDECL_SYS (setenv, int, | 1632 | _GL_FUNCDECL_SYS (setenv, int, |
| 1545 | (const char *name, const char *value, int replace) | 1633 | (const char *name, const char *value, int replace), |
| 1546 | _GL_ARG_NONNULL ((1))); | 1634 | _GL_ARG_NONNULL ((1))); |
| 1547 | # endif | 1635 | # endif |
| 1548 | _GL_CXXALIAS_SYS (setenv, int, | 1636 | _GL_CXXALIAS_SYS (setenv, int, |
| @@ -1552,13 +1640,25 @@ _GL_CXXALIAS_SYS (setenv, int, | |||
| 1552 | _GL_CXXALIASWARN (setenv); | 1640 | _GL_CXXALIASWARN (setenv); |
| 1553 | # endif | 1641 | # endif |
| 1554 | #elif defined GNULIB_POSIXCHECK | 1642 | #elif defined GNULIB_POSIXCHECK |
| 1555 | # undef setenv | ||
| 1556 | # if HAVE_RAW_DECL_SETENV | 1643 | # if HAVE_RAW_DECL_SETENV |
| 1557 | _GL_WARN_ON_USE (setenv, "setenv is unportable - " | 1644 | _GL_WARN_ON_USE (setenv, "setenv is unportable - " |
| 1558 | "use gnulib module setenv for portability"); | 1645 | "use gnulib module setenv for portability"); |
| 1559 | # endif | 1646 | # endif |
| 1560 | #endif | 1647 | #endif |
| 1561 | 1648 | ||
| 1649 | #if @GNULIB_STACK_TRACE@ | ||
| 1650 | /* Prints a stack trace of the current thread to standard error, | ||
| 1651 | if possible. */ | ||
| 1652 | # if @CAN_PRINT_STACK_TRACE@ | ||
| 1653 | _GL_EXTERN_C void print_stack_trace (void); | ||
| 1654 | # else | ||
| 1655 | # if !GNULIB_defined_print_stack_trace | ||
| 1656 | # define print_stack_trace() /* nothing */ | ||
| 1657 | # define GNULIB_defined_print_stack_trace 1 | ||
| 1658 | # endif | ||
| 1659 | # endif | ||
| 1660 | #endif | ||
| 1661 | |||
| 1562 | #if @GNULIB_STRTOD@ | 1662 | #if @GNULIB_STRTOD@ |
| 1563 | /* Parse a double from STRING, updating ENDP if appropriate. */ | 1663 | /* Parse a double from STRING, updating ENDP if appropriate. */ |
| 1564 | # if @REPLACE_STRTOD@ | 1664 | # if @REPLACE_STRTOD@ |
| @@ -1567,14 +1667,14 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - " | |||
| 1567 | # endif | 1667 | # endif |
| 1568 | # define GNULIB_defined_strtod_function 1 | 1668 | # define GNULIB_defined_strtod_function 1 |
| 1569 | _GL_FUNCDECL_RPL (strtod, double, | 1669 | _GL_FUNCDECL_RPL (strtod, double, |
| 1570 | (const char *restrict str, char **restrict endp) | 1670 | (const char *restrict str, char **restrict endp), |
| 1571 | _GL_ARG_NONNULL ((1))); | 1671 | _GL_ARG_NONNULL ((1))); |
| 1572 | _GL_CXXALIAS_RPL (strtod, double, | 1672 | _GL_CXXALIAS_RPL (strtod, double, |
| 1573 | (const char *restrict str, char **restrict endp)); | 1673 | (const char *restrict str, char **restrict endp)); |
| 1574 | # else | 1674 | # else |
| 1575 | # if !@HAVE_STRTOD@ | 1675 | # if !@HAVE_STRTOD@ |
| 1576 | _GL_FUNCDECL_SYS (strtod, double, | 1676 | _GL_FUNCDECL_SYS (strtod, double, |
| 1577 | (const char *restrict str, char **restrict endp) | 1677 | (const char *restrict str, char **restrict endp), |
| 1578 | _GL_ARG_NONNULL ((1))); | 1678 | _GL_ARG_NONNULL ((1))); |
| 1579 | # endif | 1679 | # endif |
| 1580 | _GL_CXXALIAS_SYS (strtod, double, | 1680 | _GL_CXXALIAS_SYS (strtod, double, |
| @@ -1584,7 +1684,6 @@ _GL_CXXALIAS_SYS (strtod, double, | |||
| 1584 | _GL_CXXALIASWARN (strtod); | 1684 | _GL_CXXALIASWARN (strtod); |
| 1585 | # endif | 1685 | # endif |
| 1586 | #elif defined GNULIB_POSIXCHECK | 1686 | #elif defined GNULIB_POSIXCHECK |
| 1587 | # undef strtod | ||
| 1588 | # if HAVE_RAW_DECL_STRTOD | 1687 | # if HAVE_RAW_DECL_STRTOD |
| 1589 | _GL_WARN_ON_USE (strtod, "strtod is unportable - " | 1688 | _GL_WARN_ON_USE (strtod, "strtod is unportable - " |
| 1590 | "use gnulib module strtod for portability"); | 1689 | "use gnulib module strtod for portability"); |
| @@ -1599,14 +1698,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - " | |||
| 1599 | # endif | 1698 | # endif |
| 1600 | # define GNULIB_defined_strtof_function 1 | 1699 | # define GNULIB_defined_strtof_function 1 |
| 1601 | _GL_FUNCDECL_RPL (strtof, float, | 1700 | _GL_FUNCDECL_RPL (strtof, float, |
| 1602 | (const char *restrict str, char **restrict endp) | 1701 | (const char *restrict str, char **restrict endp), |
| 1603 | _GL_ARG_NONNULL ((1))); | 1702 | _GL_ARG_NONNULL ((1))); |
| 1604 | _GL_CXXALIAS_RPL (strtof, float, | 1703 | _GL_CXXALIAS_RPL (strtof, float, |
| 1605 | (const char *restrict str, char **restrict endp)); | 1704 | (const char *restrict str, char **restrict endp)); |
| 1606 | # else | 1705 | # else |
| 1607 | # if !@HAVE_STRTOF@ | 1706 | # if !@HAVE_STRTOF@ |
| 1608 | _GL_FUNCDECL_SYS (strtof, float, | 1707 | _GL_FUNCDECL_SYS (strtof, float, |
| 1609 | (const char *restrict str, char **restrict endp) | 1708 | (const char *restrict str, char **restrict endp), |
| 1610 | _GL_ARG_NONNULL ((1))); | 1709 | _GL_ARG_NONNULL ((1))); |
| 1611 | # endif | 1710 | # endif |
| 1612 | _GL_CXXALIAS_SYS (strtof, float, | 1711 | _GL_CXXALIAS_SYS (strtof, float, |
| @@ -1616,7 +1715,6 @@ _GL_CXXALIAS_SYS (strtof, float, | |||
| 1616 | _GL_CXXALIASWARN (strtof); | 1715 | _GL_CXXALIASWARN (strtof); |
| 1617 | # endif | 1716 | # endif |
| 1618 | #elif defined GNULIB_POSIXCHECK | 1717 | #elif defined GNULIB_POSIXCHECK |
| 1619 | # undef strtof | ||
| 1620 | # if HAVE_RAW_DECL_STRTOF | 1718 | # if HAVE_RAW_DECL_STRTOF |
| 1621 | _GL_WARN_ON_USE (strtof, "strtof is unportable - " | 1719 | _GL_WARN_ON_USE (strtof, "strtof is unportable - " |
| 1622 | "use gnulib module strtof for portability"); | 1720 | "use gnulib module strtof for portability"); |
| @@ -1631,14 +1729,14 @@ _GL_WARN_ON_USE (strtof, "strtof is unportable - " | |||
| 1631 | # endif | 1729 | # endif |
| 1632 | # define GNULIB_defined_strtold_function 1 | 1730 | # define GNULIB_defined_strtold_function 1 |
| 1633 | _GL_FUNCDECL_RPL (strtold, long double, | 1731 | _GL_FUNCDECL_RPL (strtold, long double, |
| 1634 | (const char *restrict str, char **restrict endp) | 1732 | (const char *restrict str, char **restrict endp), |
| 1635 | _GL_ARG_NONNULL ((1))); | 1733 | _GL_ARG_NONNULL ((1))); |
| 1636 | _GL_CXXALIAS_RPL (strtold, long double, | 1734 | _GL_CXXALIAS_RPL (strtold, long double, |
| 1637 | (const char *restrict str, char **restrict endp)); | 1735 | (const char *restrict str, char **restrict endp)); |
| 1638 | # else | 1736 | # else |
| 1639 | # if !@HAVE_STRTOLD@ | 1737 | # if !@HAVE_STRTOLD@ |
| 1640 | _GL_FUNCDECL_SYS (strtold, long double, | 1738 | _GL_FUNCDECL_SYS (strtold, long double, |
| 1641 | (const char *restrict str, char **restrict endp) | 1739 | (const char *restrict str, char **restrict endp), |
| 1642 | _GL_ARG_NONNULL ((1))); | 1740 | _GL_ARG_NONNULL ((1))); |
| 1643 | # endif | 1741 | # endif |
| 1644 | _GL_CXXALIAS_SYS (strtold, long double, | 1742 | _GL_CXXALIAS_SYS (strtold, long double, |
| @@ -1646,7 +1744,6 @@ _GL_CXXALIAS_SYS (strtold, long double, | |||
| 1646 | # endif | 1744 | # endif |
| 1647 | _GL_CXXALIASWARN (strtold); | 1745 | _GL_CXXALIASWARN (strtold); |
| 1648 | #elif defined GNULIB_POSIXCHECK | 1746 | #elif defined GNULIB_POSIXCHECK |
| 1649 | # undef strtold | ||
| 1650 | # if HAVE_RAW_DECL_STRTOLD | 1747 | # if HAVE_RAW_DECL_STRTOLD |
| 1651 | _GL_WARN_ON_USE (strtold, "strtold is unportable - " | 1748 | _GL_WARN_ON_USE (strtold, "strtold is unportable - " |
| 1652 | "use gnulib module strtold for portability"); | 1749 | "use gnulib module strtold for portability"); |
| @@ -1669,7 +1766,7 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - " | |||
| 1669 | # define GNULIB_defined_strtol_function 1 | 1766 | # define GNULIB_defined_strtol_function 1 |
| 1670 | _GL_FUNCDECL_RPL (strtol, long, | 1767 | _GL_FUNCDECL_RPL (strtol, long, |
| 1671 | (const char *restrict string, char **restrict endptr, | 1768 | (const char *restrict string, char **restrict endptr, |
| 1672 | int base) | 1769 | int base), |
| 1673 | _GL_ARG_NONNULL ((1))); | 1770 | _GL_ARG_NONNULL ((1))); |
| 1674 | _GL_CXXALIAS_RPL (strtol, long, | 1771 | _GL_CXXALIAS_RPL (strtol, long, |
| 1675 | (const char *restrict string, char **restrict endptr, | 1772 | (const char *restrict string, char **restrict endptr, |
| @@ -1678,7 +1775,7 @@ _GL_CXXALIAS_RPL (strtol, long, | |||
| 1678 | # if !@HAVE_STRTOL@ | 1775 | # if !@HAVE_STRTOL@ |
| 1679 | _GL_FUNCDECL_SYS (strtol, long, | 1776 | _GL_FUNCDECL_SYS (strtol, long, |
| 1680 | (const char *restrict string, char **restrict endptr, | 1777 | (const char *restrict string, char **restrict endptr, |
| 1681 | int base) | 1778 | int base), |
| 1682 | _GL_ARG_NONNULL ((1))); | 1779 | _GL_ARG_NONNULL ((1))); |
| 1683 | # endif | 1780 | # endif |
| 1684 | _GL_CXXALIAS_SYS (strtol, long, | 1781 | _GL_CXXALIAS_SYS (strtol, long, |
| @@ -1689,7 +1786,6 @@ _GL_CXXALIAS_SYS (strtol, long, | |||
| 1689 | _GL_CXXALIASWARN (strtol); | 1786 | _GL_CXXALIASWARN (strtol); |
| 1690 | # endif | 1787 | # endif |
| 1691 | #elif defined GNULIB_POSIXCHECK | 1788 | #elif defined GNULIB_POSIXCHECK |
| 1692 | # undef strtol | ||
| 1693 | # if HAVE_RAW_DECL_STRTOL | 1789 | # if HAVE_RAW_DECL_STRTOL |
| 1694 | _GL_WARN_ON_USE (strtol, "strtol is unportable - " | 1790 | _GL_WARN_ON_USE (strtol, "strtol is unportable - " |
| 1695 | "use gnulib module strtol for portability"); | 1791 | "use gnulib module strtol for portability"); |
| @@ -1712,7 +1808,7 @@ _GL_WARN_ON_USE (strtol, "strtol is unportable - " | |||
| 1712 | # define GNULIB_defined_strtoll_function 1 | 1808 | # define GNULIB_defined_strtoll_function 1 |
| 1713 | _GL_FUNCDECL_RPL (strtoll, long long, | 1809 | _GL_FUNCDECL_RPL (strtoll, long long, |
| 1714 | (const char *restrict string, char **restrict endptr, | 1810 | (const char *restrict string, char **restrict endptr, |
| 1715 | int base) | 1811 | int base), |
| 1716 | _GL_ARG_NONNULL ((1))); | 1812 | _GL_ARG_NONNULL ((1))); |
| 1717 | _GL_CXXALIAS_RPL (strtoll, long long, | 1813 | _GL_CXXALIAS_RPL (strtoll, long long, |
| 1718 | (const char *restrict string, char **restrict endptr, | 1814 | (const char *restrict string, char **restrict endptr, |
| @@ -1721,7 +1817,7 @@ _GL_CXXALIAS_RPL (strtoll, long long, | |||
| 1721 | # if !@HAVE_STRTOLL@ | 1817 | # if !@HAVE_STRTOLL@ |
| 1722 | _GL_FUNCDECL_SYS (strtoll, long long, | 1818 | _GL_FUNCDECL_SYS (strtoll, long long, |
| 1723 | (const char *restrict string, char **restrict endptr, | 1819 | (const char *restrict string, char **restrict endptr, |
| 1724 | int base) | 1820 | int base), |
| 1725 | _GL_ARG_NONNULL ((1))); | 1821 | _GL_ARG_NONNULL ((1))); |
| 1726 | # endif | 1822 | # endif |
| 1727 | _GL_CXXALIAS_SYS (strtoll, long long, | 1823 | _GL_CXXALIAS_SYS (strtoll, long long, |
| @@ -1730,7 +1826,6 @@ _GL_CXXALIAS_SYS (strtoll, long long, | |||
| 1730 | # endif | 1826 | # endif |
| 1731 | _GL_CXXALIASWARN (strtoll); | 1827 | _GL_CXXALIASWARN (strtoll); |
| 1732 | #elif defined GNULIB_POSIXCHECK | 1828 | #elif defined GNULIB_POSIXCHECK |
| 1733 | # undef strtoll | ||
| 1734 | # if HAVE_RAW_DECL_STRTOLL | 1829 | # if HAVE_RAW_DECL_STRTOLL |
| 1735 | _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " | 1830 | _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " |
| 1736 | "use gnulib module strtoll for portability"); | 1831 | "use gnulib module strtoll for portability"); |
| @@ -1752,7 +1847,7 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " | |||
| 1752 | # define GNULIB_defined_strtoul_function 1 | 1847 | # define GNULIB_defined_strtoul_function 1 |
| 1753 | _GL_FUNCDECL_RPL (strtoul, unsigned long, | 1848 | _GL_FUNCDECL_RPL (strtoul, unsigned long, |
| 1754 | (const char *restrict string, char **restrict endptr, | 1849 | (const char *restrict string, char **restrict endptr, |
| 1755 | int base) | 1850 | int base), |
| 1756 | _GL_ARG_NONNULL ((1))); | 1851 | _GL_ARG_NONNULL ((1))); |
| 1757 | _GL_CXXALIAS_RPL (strtoul, unsigned long, | 1852 | _GL_CXXALIAS_RPL (strtoul, unsigned long, |
| 1758 | (const char *restrict string, char **restrict endptr, | 1853 | (const char *restrict string, char **restrict endptr, |
| @@ -1761,7 +1856,7 @@ _GL_CXXALIAS_RPL (strtoul, unsigned long, | |||
| 1761 | # if !@HAVE_STRTOUL@ | 1856 | # if !@HAVE_STRTOUL@ |
| 1762 | _GL_FUNCDECL_SYS (strtoul, unsigned long, | 1857 | _GL_FUNCDECL_SYS (strtoul, unsigned long, |
| 1763 | (const char *restrict string, char **restrict endptr, | 1858 | (const char *restrict string, char **restrict endptr, |
| 1764 | int base) | 1859 | int base), |
| 1765 | _GL_ARG_NONNULL ((1))); | 1860 | _GL_ARG_NONNULL ((1))); |
| 1766 | # endif | 1861 | # endif |
| 1767 | _GL_CXXALIAS_SYS (strtoul, unsigned long, | 1862 | _GL_CXXALIAS_SYS (strtoul, unsigned long, |
| @@ -1772,7 +1867,6 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long, | |||
| 1772 | _GL_CXXALIASWARN (strtoul); | 1867 | _GL_CXXALIASWARN (strtoul); |
| 1773 | # endif | 1868 | # endif |
| 1774 | #elif defined GNULIB_POSIXCHECK | 1869 | #elif defined GNULIB_POSIXCHECK |
| 1775 | # undef strtoul | ||
| 1776 | # if HAVE_RAW_DECL_STRTOUL | 1870 | # if HAVE_RAW_DECL_STRTOUL |
| 1777 | _GL_WARN_ON_USE (strtoul, "strtoul is unportable - " | 1871 | _GL_WARN_ON_USE (strtoul, "strtoul is unportable - " |
| 1778 | "use gnulib module strtoul for portability"); | 1872 | "use gnulib module strtoul for portability"); |
| @@ -1795,7 +1889,7 @@ _GL_WARN_ON_USE (strtoul, "strtoul is unportable - " | |||
| 1795 | # define GNULIB_defined_strtoull_function 1 | 1889 | # define GNULIB_defined_strtoull_function 1 |
| 1796 | _GL_FUNCDECL_RPL (strtoull, unsigned long long, | 1890 | _GL_FUNCDECL_RPL (strtoull, unsigned long long, |
| 1797 | (const char *restrict string, char **restrict endptr, | 1891 | (const char *restrict string, char **restrict endptr, |
| 1798 | int base) | 1892 | int base), |
| 1799 | _GL_ARG_NONNULL ((1))); | 1893 | _GL_ARG_NONNULL ((1))); |
| 1800 | _GL_CXXALIAS_RPL (strtoull, unsigned long long, | 1894 | _GL_CXXALIAS_RPL (strtoull, unsigned long long, |
| 1801 | (const char *restrict string, char **restrict endptr, | 1895 | (const char *restrict string, char **restrict endptr, |
| @@ -1804,7 +1898,7 @@ _GL_CXXALIAS_RPL (strtoull, unsigned long long, | |||
| 1804 | # if !@HAVE_STRTOULL@ | 1898 | # if !@HAVE_STRTOULL@ |
| 1805 | _GL_FUNCDECL_SYS (strtoull, unsigned long long, | 1899 | _GL_FUNCDECL_SYS (strtoull, unsigned long long, |
| 1806 | (const char *restrict string, char **restrict endptr, | 1900 | (const char *restrict string, char **restrict endptr, |
| 1807 | int base) | 1901 | int base), |
| 1808 | _GL_ARG_NONNULL ((1))); | 1902 | _GL_ARG_NONNULL ((1))); |
| 1809 | # endif | 1903 | # endif |
| 1810 | _GL_CXXALIAS_SYS (strtoull, unsigned long long, | 1904 | _GL_CXXALIAS_SYS (strtoull, unsigned long long, |
| @@ -1813,7 +1907,6 @@ _GL_CXXALIAS_SYS (strtoull, unsigned long long, | |||
| 1813 | # endif | 1907 | # endif |
| 1814 | _GL_CXXALIASWARN (strtoull); | 1908 | _GL_CXXALIASWARN (strtoull); |
| 1815 | #elif defined GNULIB_POSIXCHECK | 1909 | #elif defined GNULIB_POSIXCHECK |
| 1816 | # undef strtoull | ||
| 1817 | # if HAVE_RAW_DECL_STRTOULL | 1910 | # if HAVE_RAW_DECL_STRTOULL |
| 1818 | _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " | 1911 | _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " |
| 1819 | "use gnulib module strtoull for portability"); | 1912 | "use gnulib module strtoull for portability"); |
| @@ -1824,12 +1917,11 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " | |||
| 1824 | /* Unlock the slave side of the pseudo-terminal whose master side is specified | 1917 | /* Unlock the slave side of the pseudo-terminal whose master side is specified |
| 1825 | by FD, so that it can be opened. */ | 1918 | by FD, so that it can be opened. */ |
| 1826 | # if !@HAVE_UNLOCKPT@ | 1919 | # if !@HAVE_UNLOCKPT@ |
| 1827 | _GL_FUNCDECL_SYS (unlockpt, int, (int fd)); | 1920 | _GL_FUNCDECL_SYS (unlockpt, int, (int fd), ); |
| 1828 | # endif | 1921 | # endif |
| 1829 | _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); | 1922 | _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); |
| 1830 | _GL_CXXALIASWARN (unlockpt); | 1923 | _GL_CXXALIASWARN (unlockpt); |
| 1831 | #elif defined GNULIB_POSIXCHECK | 1924 | #elif defined GNULIB_POSIXCHECK |
| 1832 | # undef unlockpt | ||
| 1833 | # if HAVE_RAW_DECL_UNLOCKPT | 1925 | # if HAVE_RAW_DECL_UNLOCKPT |
| 1834 | _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " | 1926 | _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " |
| 1835 | "use gnulib module unlockpt for portability"); | 1927 | "use gnulib module unlockpt for portability"); |
| @@ -1843,11 +1935,11 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " | |||
| 1843 | # undef unsetenv | 1935 | # undef unsetenv |
| 1844 | # define unsetenv rpl_unsetenv | 1936 | # define unsetenv rpl_unsetenv |
| 1845 | # endif | 1937 | # endif |
| 1846 | _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); | 1938 | _GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1))); |
| 1847 | _GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); | 1939 | _GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); |
| 1848 | # else | 1940 | # else |
| 1849 | # if !@HAVE_DECL_UNSETENV@ | 1941 | # if !@HAVE_DECL_UNSETENV@ |
| 1850 | _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); | 1942 | _GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1))); |
| 1851 | # endif | 1943 | # endif |
| 1852 | _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); | 1944 | _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); |
| 1853 | # endif | 1945 | # endif |
| @@ -1855,7 +1947,6 @@ _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); | |||
| 1855 | _GL_CXXALIASWARN (unsetenv); | 1947 | _GL_CXXALIASWARN (unsetenv); |
| 1856 | # endif | 1948 | # endif |
| 1857 | #elif defined GNULIB_POSIXCHECK | 1949 | #elif defined GNULIB_POSIXCHECK |
| 1858 | # undef unsetenv | ||
| 1859 | # if HAVE_RAW_DECL_UNSETENV | 1950 | # if HAVE_RAW_DECL_UNSETENV |
| 1860 | _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " | 1951 | _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " |
| 1861 | "use gnulib module unsetenv for portability"); | 1952 | "use gnulib module unsetenv for portability"); |
| @@ -1869,7 +1960,7 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " | |||
| 1869 | # undef wctomb | 1960 | # undef wctomb |
| 1870 | # define wctomb rpl_wctomb | 1961 | # define wctomb rpl_wctomb |
| 1871 | # endif | 1962 | # endif |
| 1872 | _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); | 1963 | _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), ); |
| 1873 | _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); | 1964 | _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); |
| 1874 | # else | 1965 | # else |
| 1875 | _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); | 1966 | _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); |
| @@ -1880,6 +1971,20 @@ _GL_CXXALIASWARN (wctomb); | |||
| 1880 | #endif | 1971 | #endif |
| 1881 | 1972 | ||
| 1882 | 1973 | ||
| 1974 | _GL_INLINE_HEADER_END | ||
| 1975 | |||
| 1976 | |||
| 1977 | /* Includes that provide only macros that don't need to be overridden. | ||
| 1978 | (Includes that are needed for type definitions and function declarations | ||
| 1979 | have their place above, before the function overrides.) */ | ||
| 1980 | |||
| 1981 | /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. | ||
| 1982 | glibc 2.41 defines WCOREDUMP in <sys/wait.h>, not in <stdlib.h>. */ | ||
| 1983 | #if @GNULIB_SYSTEM_POSIX@ && !(defined WEXITSTATUS && defined WCOREDUMP) | ||
| 1984 | # include <sys/wait.h> | ||
| 1985 | #endif | ||
| 1986 | |||
| 1987 | |||
| 1883 | #endif /* _@GUARD_PREFIX@_STDLIB_H */ | 1988 | #endif /* _@GUARD_PREFIX@_STDLIB_H */ |
| 1884 | #endif /* _@GUARD_PREFIX@_STDLIB_H */ | 1989 | #endif /* _@GUARD_PREFIX@_STDLIB_H */ |
| 1885 | #endif | 1990 | #endif |
