diff options
| author | Po Lu | 2024-09-05 08:41:11 +0800 |
|---|---|---|
| committer | Po Lu | 2024-09-05 08:45:18 +0800 |
| commit | 1a13c5e63e1eb8fcf15c53ae4ed0caca8b928a3b (patch) | |
| tree | a40610febdebe7a02acf3981b7f966b323c0d1c3 /lib/string.in.h | |
| parent | a13eef1fae00411bc03165933870de73d10551af (diff) | |
| download | emacs-1a13c5e63e1eb8fcf15c53ae4ed0caca8b928a3b.tar.gz emacs-1a13c5e63e1eb8fcf15c53ae4ed0caca8b928a3b.zip | |
; Update from Gnulib
* configure.ac:
* src/conf_post.h: Remove workarounds now rendered redundant by
Gnulib.
Diffstat (limited to 'lib/string.in.h')
| -rw-r--r-- | lib/string.in.h | 126 |
1 files changed, 64 insertions, 62 deletions
diff --git a/lib/string.in.h b/lib/string.in.h index 44ec2e7ecdb..a588e7e2c26 100644 --- a/lib/string.in.h +++ b/lib/string.in.h | |||
| @@ -79,7 +79,7 @@ | |||
| 79 | that can be freed by passing them as the Ith argument to the | 79 | that can be freed by passing them as the Ith argument to the |
| 80 | function F. */ | 80 | function F. */ |
| 81 | #ifndef _GL_ATTRIBUTE_DEALLOC | 81 | #ifndef _GL_ATTRIBUTE_DEALLOC |
| 82 | # if __GNUC__ >= 11 | 82 | # if __GNUC__ >= 11 && !defined __clang__ |
| 83 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) | 83 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) |
| 84 | # else | 84 | # else |
| 85 | # define _GL_ATTRIBUTE_DEALLOC(f, i) | 85 | # define _GL_ATTRIBUTE_DEALLOC(f, i) |
| @@ -115,7 +115,7 @@ | |||
| 115 | */ | 115 | */ |
| 116 | #ifndef _GL_ATTRIBUTE_NOTHROW | 116 | #ifndef _GL_ATTRIBUTE_NOTHROW |
| 117 | # if defined __cplusplus | 117 | # if defined __cplusplus |
| 118 | # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 | 118 | # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4 |
| 119 | # if __cplusplus >= 201103L | 119 | # if __cplusplus >= 201103L |
| 120 | # define _GL_ATTRIBUTE_NOTHROW noexcept (true) | 120 | # define _GL_ATTRIBUTE_NOTHROW noexcept (true) |
| 121 | # else | 121 | # else |
| @@ -198,7 +198,7 @@ _GL_EXTERN_C void free (void *); | |||
| 198 | #if @GNULIB_EXPLICIT_BZERO@ | 198 | #if @GNULIB_EXPLICIT_BZERO@ |
| 199 | # if ! @HAVE_EXPLICIT_BZERO@ | 199 | # if ! @HAVE_EXPLICIT_BZERO@ |
| 200 | _GL_FUNCDECL_SYS (explicit_bzero, void, | 200 | _GL_FUNCDECL_SYS (explicit_bzero, void, |
| 201 | (void *__dest, size_t __n) _GL_ARG_NONNULL ((1))); | 201 | (void *__dest, size_t __n), _GL_ARG_NONNULL ((1))); |
| 202 | # endif | 202 | # endif |
| 203 | _GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n)); | 203 | _GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n)); |
| 204 | _GL_CXXALIASWARN (explicit_bzero); | 204 | _GL_CXXALIASWARN (explicit_bzero); |
| @@ -274,7 +274,7 @@ _GL_CXXALIASWARN (memccpy); | |||
| 274 | # undef memchr | 274 | # undef memchr |
| 275 | # define memchr rpl_memchr | 275 | # define memchr rpl_memchr |
| 276 | # endif | 276 | # endif |
| 277 | _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) | 277 | _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n), |
| 278 | _GL_ATTRIBUTE_PURE | 278 | _GL_ATTRIBUTE_PURE |
| 279 | _GL_ARG_NONNULL ((1))); | 279 | _GL_ARG_NONNULL ((1))); |
| 280 | _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); | 280 | _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); |
| @@ -313,7 +313,7 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - " | |||
| 313 | # endif | 313 | # endif |
| 314 | _GL_FUNCDECL_RPL (memmem, void *, | 314 | _GL_FUNCDECL_RPL (memmem, void *, |
| 315 | (void const *__haystack, size_t __haystack_len, | 315 | (void const *__haystack, size_t __haystack_len, |
| 316 | void const *__needle, size_t __needle_len) | 316 | void const *__needle, size_t __needle_len), |
| 317 | _GL_ATTRIBUTE_PURE | 317 | _GL_ATTRIBUTE_PURE |
| 318 | _GL_ARG_NONNULL ((1, 3))); | 318 | _GL_ARG_NONNULL ((1, 3))); |
| 319 | _GL_CXXALIAS_RPL (memmem, void *, | 319 | _GL_CXXALIAS_RPL (memmem, void *, |
| @@ -323,7 +323,7 @@ _GL_CXXALIAS_RPL (memmem, void *, | |||
| 323 | # if ! @HAVE_DECL_MEMMEM@ | 323 | # if ! @HAVE_DECL_MEMMEM@ |
| 324 | _GL_FUNCDECL_SYS (memmem, void *, | 324 | _GL_FUNCDECL_SYS (memmem, void *, |
| 325 | (void const *__haystack, size_t __haystack_len, | 325 | (void const *__haystack, size_t __haystack_len, |
| 326 | void const *__needle, size_t __needle_len) | 326 | void const *__needle, size_t __needle_len), |
| 327 | _GL_ATTRIBUTE_PURE | 327 | _GL_ATTRIBUTE_PURE |
| 328 | _GL_ARG_NONNULL ((1, 3))); | 328 | _GL_ARG_NONNULL ((1, 3))); |
| 329 | # endif | 329 | # endif |
| @@ -351,7 +351,7 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - " | |||
| 351 | # endif | 351 | # endif |
| 352 | _GL_FUNCDECL_RPL (mempcpy, void *, | 352 | _GL_FUNCDECL_RPL (mempcpy, void *, |
| 353 | (void *restrict __dest, void const *restrict __src, | 353 | (void *restrict __dest, void const *restrict __src, |
| 354 | size_t __n) | 354 | size_t __n), |
| 355 | _GL_ARG_NONNULL ((1, 2))); | 355 | _GL_ARG_NONNULL ((1, 2))); |
| 356 | _GL_CXXALIAS_RPL (mempcpy, void *, | 356 | _GL_CXXALIAS_RPL (mempcpy, void *, |
| 357 | (void *restrict __dest, void const *restrict __src, | 357 | (void *restrict __dest, void const *restrict __src, |
| @@ -360,7 +360,7 @@ _GL_CXXALIAS_RPL (mempcpy, void *, | |||
| 360 | # if !@HAVE_MEMPCPY@ | 360 | # if !@HAVE_MEMPCPY@ |
| 361 | _GL_FUNCDECL_SYS (mempcpy, void *, | 361 | _GL_FUNCDECL_SYS (mempcpy, void *, |
| 362 | (void *restrict __dest, void const *restrict __src, | 362 | (void *restrict __dest, void const *restrict __src, |
| 363 | size_t __n) | 363 | size_t __n), |
| 364 | _GL_ARG_NONNULL ((1, 2))); | 364 | _GL_ARG_NONNULL ((1, 2))); |
| 365 | # endif | 365 | # endif |
| 366 | _GL_CXXALIAS_SYS (mempcpy, void *, | 366 | _GL_CXXALIAS_SYS (mempcpy, void *, |
| @@ -381,7 +381,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " | |||
| 381 | /* Search backwards through a block for a byte (specified as an int). */ | 381 | /* Search backwards through a block for a byte (specified as an int). */ |
| 382 | #if @GNULIB_MEMRCHR@ | 382 | #if @GNULIB_MEMRCHR@ |
| 383 | # if ! @HAVE_DECL_MEMRCHR@ | 383 | # if ! @HAVE_DECL_MEMRCHR@ |
| 384 | _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) | 384 | _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t), |
| 385 | _GL_ATTRIBUTE_PURE | 385 | _GL_ATTRIBUTE_PURE |
| 386 | _GL_ARG_NONNULL ((1))); | 386 | _GL_ARG_NONNULL ((1))); |
| 387 | # endif | 387 | # endif |
| @@ -420,12 +420,12 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - " | |||
| 420 | # define memset_explicit rpl_memset_explicit | 420 | # define memset_explicit rpl_memset_explicit |
| 421 | # endif | 421 | # endif |
| 422 | _GL_FUNCDECL_RPL (memset_explicit, void *, | 422 | _GL_FUNCDECL_RPL (memset_explicit, void *, |
| 423 | (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1))); | 423 | (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); |
| 424 | _GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n)); | 424 | _GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n)); |
| 425 | # else | 425 | # else |
| 426 | # if !@HAVE_MEMSET_EXPLICIT@ | 426 | # if !@HAVE_MEMSET_EXPLICIT@ |
| 427 | _GL_FUNCDECL_SYS (memset_explicit, void *, | 427 | _GL_FUNCDECL_SYS (memset_explicit, void *, |
| 428 | (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1))); | 428 | (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); |
| 429 | # endif | 429 | # endif |
| 430 | _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); | 430 | _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); |
| 431 | # endif | 431 | # endif |
| @@ -443,7 +443,7 @@ _GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - " | |||
| 443 | occur within N bytes. */ | 443 | occur within N bytes. */ |
| 444 | #if @GNULIB_RAWMEMCHR@ | 444 | #if @GNULIB_RAWMEMCHR@ |
| 445 | # if ! @HAVE_RAWMEMCHR@ | 445 | # if ! @HAVE_RAWMEMCHR@ |
| 446 | _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) | 446 | _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in), |
| 447 | _GL_ATTRIBUTE_PURE | 447 | _GL_ATTRIBUTE_PURE |
| 448 | _GL_ARG_NONNULL ((1))); | 448 | _GL_ARG_NONNULL ((1))); |
| 449 | # endif | 449 | # endif |
| @@ -481,14 +481,14 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - " | |||
| 481 | # define stpcpy rpl_stpcpy | 481 | # define stpcpy rpl_stpcpy |
| 482 | # endif | 482 | # endif |
| 483 | _GL_FUNCDECL_RPL (stpcpy, char *, | 483 | _GL_FUNCDECL_RPL (stpcpy, char *, |
| 484 | (char *restrict __dst, char const *restrict __src) | 484 | (char *restrict __dst, char const *restrict __src), |
| 485 | _GL_ARG_NONNULL ((1, 2))); | 485 | _GL_ARG_NONNULL ((1, 2))); |
| 486 | _GL_CXXALIAS_RPL (stpcpy, char *, | 486 | _GL_CXXALIAS_RPL (stpcpy, char *, |
| 487 | (char *restrict __dst, char const *restrict __src)); | 487 | (char *restrict __dst, char const *restrict __src)); |
| 488 | # else | 488 | # else |
| 489 | # if !@HAVE_STPCPY@ | 489 | # if !@HAVE_STPCPY@ |
| 490 | _GL_FUNCDECL_SYS (stpcpy, char *, | 490 | _GL_FUNCDECL_SYS (stpcpy, char *, |
| 491 | (char *restrict __dst, char const *restrict __src) | 491 | (char *restrict __dst, char const *restrict __src), |
| 492 | _GL_ARG_NONNULL ((1, 2))); | 492 | _GL_ARG_NONNULL ((1, 2))); |
| 493 | # endif | 493 | # endif |
| 494 | _GL_CXXALIAS_SYS (stpcpy, char *, | 494 | _GL_CXXALIAS_SYS (stpcpy, char *, |
| @@ -515,7 +515,7 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - " | |||
| 515 | # endif | 515 | # endif |
| 516 | _GL_FUNCDECL_RPL (stpncpy, char *, | 516 | _GL_FUNCDECL_RPL (stpncpy, char *, |
| 517 | (char *restrict __dst, char const *restrict __src, | 517 | (char *restrict __dst, char const *restrict __src, |
| 518 | size_t __n) | 518 | size_t __n), |
| 519 | _GL_ARG_NONNULL ((1, 2))); | 519 | _GL_ARG_NONNULL ((1, 2))); |
| 520 | _GL_CXXALIAS_RPL (stpncpy, char *, | 520 | _GL_CXXALIAS_RPL (stpncpy, char *, |
| 521 | (char *restrict __dst, char const *restrict __src, | 521 | (char *restrict __dst, char const *restrict __src, |
| @@ -524,7 +524,7 @@ _GL_CXXALIAS_RPL (stpncpy, char *, | |||
| 524 | # if ! @HAVE_STPNCPY@ | 524 | # if ! @HAVE_STPNCPY@ |
| 525 | _GL_FUNCDECL_SYS (stpncpy, char *, | 525 | _GL_FUNCDECL_SYS (stpncpy, char *, |
| 526 | (char *restrict __dst, char const *restrict __src, | 526 | (char *restrict __dst, char const *restrict __src, |
| 527 | size_t __n) | 527 | size_t __n), |
| 528 | _GL_ARG_NONNULL ((1, 2))); | 528 | _GL_ARG_NONNULL ((1, 2))); |
| 529 | # endif | 529 | # endif |
| 530 | _GL_CXXALIAS_SYS (stpncpy, char *, | 530 | _GL_CXXALIAS_SYS (stpncpy, char *, |
| @@ -560,14 +560,14 @@ _GL_WARN_ON_USE_CXX (strchr, | |||
| 560 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 560 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 561 | # define strchrnul rpl_strchrnul | 561 | # define strchrnul rpl_strchrnul |
| 562 | # endif | 562 | # endif |
| 563 | _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in) | 563 | _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in), |
| 564 | _GL_ATTRIBUTE_PURE | 564 | _GL_ATTRIBUTE_PURE |
| 565 | _GL_ARG_NONNULL ((1))); | 565 | _GL_ARG_NONNULL ((1))); |
| 566 | _GL_CXXALIAS_RPL (strchrnul, char *, | 566 | _GL_CXXALIAS_RPL (strchrnul, char *, |
| 567 | (const char *str, int ch)); | 567 | (const char *str, int ch)); |
| 568 | # else | 568 | # else |
| 569 | # if ! @HAVE_STRCHRNUL@ | 569 | # if ! @HAVE_STRCHRNUL@ |
| 570 | _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) | 570 | _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in), |
| 571 | _GL_ATTRIBUTE_PURE | 571 | _GL_ATTRIBUTE_PURE |
| 572 | _GL_ARG_NONNULL ((1))); | 572 | _GL_ARG_NONNULL ((1))); |
| 573 | # endif | 573 | # endif |
| @@ -606,7 +606,7 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " | |||
| 606 | # define strdup rpl_strdup | 606 | # define strdup rpl_strdup |
| 607 | # endif | 607 | # endif |
| 608 | _GL_FUNCDECL_RPL (strdup, char *, | 608 | _GL_FUNCDECL_RPL (strdup, char *, |
| 609 | (char const *__s) | 609 | (char const *__s), |
| 610 | _GL_ARG_NONNULL ((1)) | 610 | _GL_ARG_NONNULL ((1)) |
| 611 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 611 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 612 | _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); | 612 | _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); |
| @@ -621,16 +621,17 @@ _GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); | |||
| 621 | /* strdup exists as a function and as a macro. Get rid of the macro. */ | 621 | /* strdup exists as a function and as a macro. Get rid of the macro. */ |
| 622 | # undef strdup | 622 | # undef strdup |
| 623 | # endif | 623 | # endif |
| 624 | # if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup | 624 | # if (!@HAVE_DECL_STRDUP@ || (__GNUC__ >= 11 && !defined __clang__)) \ |
| 625 | && !defined strdup | ||
| 625 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 626 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 626 | _GL_FUNCDECL_SYS (strdup, char *, | 627 | _GL_FUNCDECL_SYS (strdup, char *, |
| 627 | (char const *__s) | 628 | (char const *__s), |
| 628 | _GL_ATTRIBUTE_NOTHROW | ||
| 629 | _GL_ARG_NONNULL ((1)) | 629 | _GL_ARG_NONNULL ((1)) |
| 630 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 630 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 631 | _GL_ATTRIBUTE_NOTHROW; | ||
| 631 | # else | 632 | # else |
| 632 | _GL_FUNCDECL_SYS (strdup, char *, | 633 | _GL_FUNCDECL_SYS (strdup, char *, |
| 633 | (char const *__s) | 634 | (char const *__s), |
| 634 | _GL_ARG_NONNULL ((1)) | 635 | _GL_ARG_NONNULL ((1)) |
| 635 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 636 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 636 | # endif | 637 | # endif |
| @@ -639,17 +640,17 @@ _GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); | |||
| 639 | # endif | 640 | # endif |
| 640 | _GL_CXXALIASWARN (strdup); | 641 | _GL_CXXALIASWARN (strdup); |
| 641 | #else | 642 | #else |
| 642 | # if __GNUC__ >= 11 && !defined strdup | 643 | # if (__GNUC__ >= 11 && !defined __clang__) && !defined strdup |
| 643 | /* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */ | 644 | /* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */ |
| 644 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 645 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 645 | _GL_FUNCDECL_SYS (strdup, char *, | 646 | _GL_FUNCDECL_SYS (strdup, char *, |
| 646 | (char const *__s) | 647 | (char const *__s), |
| 647 | _GL_ATTRIBUTE_NOTHROW | ||
| 648 | _GL_ARG_NONNULL ((1)) | 648 | _GL_ARG_NONNULL ((1)) |
| 649 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 649 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 650 | _GL_ATTRIBUTE_NOTHROW; | ||
| 650 | # else | 651 | # else |
| 651 | _GL_FUNCDECL_SYS (strdup, char *, | 652 | _GL_FUNCDECL_SYS (strdup, char *, |
| 652 | (char const *__s) | 653 | (char const *__s), |
| 653 | _GL_ARG_NONNULL ((1)) | 654 | _GL_ARG_NONNULL ((1)) |
| 654 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 655 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 655 | # endif | 656 | # endif |
| @@ -688,7 +689,7 @@ _GL_CXXALIASWARN (strdup); | |||
| 688 | # define strncat rpl_strncat | 689 | # define strncat rpl_strncat |
| 689 | # endif | 690 | # endif |
| 690 | _GL_FUNCDECL_RPL (strncat, char *, | 691 | _GL_FUNCDECL_RPL (strncat, char *, |
| 691 | (char *restrict dest, const char *restrict src, size_t n) | 692 | (char *restrict dest, const char *restrict src, size_t n), |
| 692 | _GL_ARG_NONNULL ((1, 2))); | 693 | _GL_ARG_NONNULL ((1, 2))); |
| 693 | _GL_CXXALIAS_RPL (strncat, char *, | 694 | _GL_CXXALIAS_RPL (strncat, char *, |
| 694 | (char *restrict dest, const char *restrict src, size_t n)); | 695 | (char *restrict dest, const char *restrict src, size_t n)); |
| @@ -715,21 +716,22 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " | |||
| 715 | # define strndup rpl_strndup | 716 | # define strndup rpl_strndup |
| 716 | # endif | 717 | # endif |
| 717 | _GL_FUNCDECL_RPL (strndup, char *, | 718 | _GL_FUNCDECL_RPL (strndup, char *, |
| 718 | (char const *__s, size_t __n) | 719 | (char const *__s, size_t __n), |
| 719 | _GL_ARG_NONNULL ((1)) | 720 | _GL_ARG_NONNULL ((1)) |
| 720 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 721 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 721 | _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); | 722 | _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); |
| 722 | # else | 723 | # else |
| 723 | # if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup) | 724 | # if !@HAVE_DECL_STRNDUP@ \ |
| 725 | || ((__GNUC__ >= 11 && !defined __clang__) && !defined strndup) | ||
| 724 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 726 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 725 | _GL_FUNCDECL_SYS (strndup, char *, | 727 | _GL_FUNCDECL_SYS (strndup, char *, |
| 726 | (char const *__s, size_t __n) | 728 | (char const *__s, size_t __n), |
| 727 | _GL_ATTRIBUTE_NOTHROW | ||
| 728 | _GL_ARG_NONNULL ((1)) | 729 | _GL_ARG_NONNULL ((1)) |
| 729 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 730 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 731 | _GL_ATTRIBUTE_NOTHROW; | ||
| 730 | # else | 732 | # else |
| 731 | _GL_FUNCDECL_SYS (strndup, char *, | 733 | _GL_FUNCDECL_SYS (strndup, char *, |
| 732 | (char const *__s, size_t __n) | 734 | (char const *__s, size_t __n), |
| 733 | _GL_ARG_NONNULL ((1)) | 735 | _GL_ARG_NONNULL ((1)) |
| 734 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 736 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 735 | # endif | 737 | # endif |
| @@ -738,17 +740,17 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); | |||
| 738 | # endif | 740 | # endif |
| 739 | _GL_CXXALIASWARN (strndup); | 741 | _GL_CXXALIASWARN (strndup); |
| 740 | #else | 742 | #else |
| 741 | # if __GNUC__ >= 11 && !defined strndup | 743 | # if (__GNUC__ >= 11 && !defined __clang__) && !defined strndup |
| 742 | /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ | 744 | /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ |
| 743 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 | 745 | # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 |
| 744 | _GL_FUNCDECL_SYS (strndup, char *, | 746 | _GL_FUNCDECL_SYS (strndup, char *, |
| 745 | (char const *__s, size_t __n) | 747 | (char const *__s, size_t __n), |
| 746 | _GL_ATTRIBUTE_NOTHROW | ||
| 747 | _GL_ARG_NONNULL ((1)) | 748 | _GL_ARG_NONNULL ((1)) |
| 748 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 749 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) |
| 750 | _GL_ATTRIBUTE_NOTHROW; | ||
| 749 | # else | 751 | # else |
| 750 | _GL_FUNCDECL_SYS (strndup, char *, | 752 | _GL_FUNCDECL_SYS (strndup, char *, |
| 751 | (char const *__s, size_t __n) | 753 | (char const *__s, size_t __n), |
| 752 | _GL_ARG_NONNULL ((1)) | 754 | _GL_ARG_NONNULL ((1)) |
| 753 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | 755 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); |
| 754 | # endif | 756 | # endif |
| @@ -771,13 +773,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - " | |||
| 771 | # undef strnlen | 773 | # undef strnlen |
| 772 | # define strnlen rpl_strnlen | 774 | # define strnlen rpl_strnlen |
| 773 | # endif | 775 | # endif |
| 774 | _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen) | 776 | _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen), |
| 775 | _GL_ATTRIBUTE_PURE | 777 | _GL_ATTRIBUTE_PURE |
| 776 | _GL_ARG_NONNULL ((1))); | 778 | _GL_ARG_NONNULL ((1))); |
| 777 | _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); | 779 | _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); |
| 778 | # else | 780 | # else |
| 779 | # if ! @HAVE_DECL_STRNLEN@ | 781 | # if ! @HAVE_DECL_STRNLEN@ |
| 780 | _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen) | 782 | _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen), |
| 781 | _GL_ATTRIBUTE_PURE | 783 | _GL_ATTRIBUTE_PURE |
| 782 | _GL_ARG_NONNULL ((1))); | 784 | _GL_ARG_NONNULL ((1))); |
| 783 | # endif | 785 | # endif |
| @@ -807,7 +809,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings " | |||
| 807 | /* Find the first occurrence in S of any character in ACCEPT. */ | 809 | /* Find the first occurrence in S of any character in ACCEPT. */ |
| 808 | #if @GNULIB_STRPBRK@ | 810 | #if @GNULIB_STRPBRK@ |
| 809 | # if ! @HAVE_STRPBRK@ | 811 | # if ! @HAVE_STRPBRK@ |
| 810 | _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) | 812 | _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept), |
| 811 | _GL_ATTRIBUTE_PURE | 813 | _GL_ATTRIBUTE_PURE |
| 812 | _GL_ARG_NONNULL ((1, 2))); | 814 | _GL_ARG_NONNULL ((1, 2))); |
| 813 | # endif | 815 | # endif |
| @@ -892,7 +894,7 @@ _GL_WARN_ON_USE_CXX (strrchr, | |||
| 892 | #if @GNULIB_STRSEP@ | 894 | #if @GNULIB_STRSEP@ |
| 893 | # if ! @HAVE_STRSEP@ | 895 | # if ! @HAVE_STRSEP@ |
| 894 | _GL_FUNCDECL_SYS (strsep, char *, | 896 | _GL_FUNCDECL_SYS (strsep, char *, |
| 895 | (char **restrict __stringp, char const *restrict __delim) | 897 | (char **restrict __stringp, char const *restrict __delim), |
| 896 | _GL_ARG_NONNULL ((1, 2))); | 898 | _GL_ARG_NONNULL ((1, 2))); |
| 897 | # endif | 899 | # endif |
| 898 | _GL_CXXALIAS_SYS (strsep, char *, | 900 | _GL_CXXALIAS_SYS (strsep, char *, |
| @@ -917,7 +919,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - " | |||
| 917 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 919 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 918 | # define strstr rpl_strstr | 920 | # define strstr rpl_strstr |
| 919 | # endif | 921 | # endif |
| 920 | _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) | 922 | _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle), |
| 921 | _GL_ATTRIBUTE_PURE | 923 | _GL_ATTRIBUTE_PURE |
| 922 | _GL_ARG_NONNULL ((1, 2))); | 924 | _GL_ARG_NONNULL ((1, 2))); |
| 923 | _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); | 925 | _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); |
| @@ -963,7 +965,7 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot " | |||
| 963 | # define strcasestr rpl_strcasestr | 965 | # define strcasestr rpl_strcasestr |
| 964 | # endif | 966 | # endif |
| 965 | _GL_FUNCDECL_RPL (strcasestr, char *, | 967 | _GL_FUNCDECL_RPL (strcasestr, char *, |
| 966 | (const char *haystack, const char *needle) | 968 | (const char *haystack, const char *needle), |
| 967 | _GL_ATTRIBUTE_PURE | 969 | _GL_ATTRIBUTE_PURE |
| 968 | _GL_ARG_NONNULL ((1, 2))); | 970 | _GL_ARG_NONNULL ((1, 2))); |
| 969 | _GL_CXXALIAS_RPL (strcasestr, char *, | 971 | _GL_CXXALIAS_RPL (strcasestr, char *, |
| @@ -971,7 +973,7 @@ _GL_CXXALIAS_RPL (strcasestr, char *, | |||
| 971 | # else | 973 | # else |
| 972 | # if ! @HAVE_STRCASESTR@ | 974 | # if ! @HAVE_STRCASESTR@ |
| 973 | _GL_FUNCDECL_SYS (strcasestr, char *, | 975 | _GL_FUNCDECL_SYS (strcasestr, char *, |
| 974 | (const char *haystack, const char *needle) | 976 | (const char *haystack, const char *needle), |
| 975 | _GL_ATTRIBUTE_PURE | 977 | _GL_ATTRIBUTE_PURE |
| 976 | _GL_ARG_NONNULL ((1, 2))); | 978 | _GL_ARG_NONNULL ((1, 2))); |
| 977 | # endif | 979 | # endif |
| @@ -1038,7 +1040,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character " | |||
| 1038 | # endif | 1040 | # endif |
| 1039 | _GL_FUNCDECL_RPL (strtok_r, char *, | 1041 | _GL_FUNCDECL_RPL (strtok_r, char *, |
| 1040 | (char *restrict s, char const *restrict delim, | 1042 | (char *restrict s, char const *restrict delim, |
| 1041 | char **restrict save_ptr) | 1043 | char **restrict save_ptr), |
| 1042 | _GL_ARG_NONNULL ((2, 3))); | 1044 | _GL_ARG_NONNULL ((2, 3))); |
| 1043 | _GL_CXXALIAS_RPL (strtok_r, char *, | 1045 | _GL_CXXALIAS_RPL (strtok_r, char *, |
| 1044 | (char *restrict s, char const *restrict delim, | 1046 | (char *restrict s, char const *restrict delim, |
| @@ -1050,7 +1052,7 @@ _GL_CXXALIAS_RPL (strtok_r, char *, | |||
| 1050 | # if ! @HAVE_DECL_STRTOK_R@ | 1052 | # if ! @HAVE_DECL_STRTOK_R@ |
| 1051 | _GL_FUNCDECL_SYS (strtok_r, char *, | 1053 | _GL_FUNCDECL_SYS (strtok_r, char *, |
| 1052 | (char *restrict s, char const *restrict delim, | 1054 | (char *restrict s, char const *restrict delim, |
| 1053 | char **restrict save_ptr) | 1055 | char **restrict save_ptr), |
| 1054 | _GL_ARG_NONNULL ((2, 3))); | 1056 | _GL_ARG_NONNULL ((2, 3))); |
| 1055 | # endif | 1057 | # endif |
| 1056 | _GL_CXXALIAS_SYS (strtok_r, char *, | 1058 | _GL_CXXALIAS_SYS (strtok_r, char *, |
| @@ -1085,12 +1087,12 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - " | |||
| 1085 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1087 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1086 | # define mbslen rpl_mbslen | 1088 | # define mbslen rpl_mbslen |
| 1087 | # endif | 1089 | # endif |
| 1088 | _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) | 1090 | _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string), |
| 1089 | _GL_ATTRIBUTE_PURE | 1091 | _GL_ATTRIBUTE_PURE |
| 1090 | _GL_ARG_NONNULL ((1))); | 1092 | _GL_ARG_NONNULL ((1))); |
| 1091 | _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string)); | 1093 | _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string)); |
| 1092 | # else | 1094 | # else |
| 1093 | _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) | 1095 | _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string), |
| 1094 | _GL_ATTRIBUTE_PURE | 1096 | _GL_ATTRIBUTE_PURE |
| 1095 | _GL_ARG_NONNULL ((1))); | 1097 | _GL_ARG_NONNULL ((1))); |
| 1096 | _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string)); | 1098 | _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string)); |
| @@ -1117,12 +1119,12 @@ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len) | |||
| 1117 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1119 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1118 | # define mbschr rpl_mbschr /* avoid collision with HP-UX function */ | 1120 | # define mbschr rpl_mbschr /* avoid collision with HP-UX function */ |
| 1119 | # endif | 1121 | # endif |
| 1120 | _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c) | 1122 | _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c), |
| 1121 | _GL_ATTRIBUTE_PURE | 1123 | _GL_ATTRIBUTE_PURE |
| 1122 | _GL_ARG_NONNULL ((1))); | 1124 | _GL_ARG_NONNULL ((1))); |
| 1123 | _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c)); | 1125 | _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c)); |
| 1124 | # else | 1126 | # else |
| 1125 | _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c) | 1127 | _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c), |
| 1126 | _GL_ATTRIBUTE_PURE | 1128 | _GL_ATTRIBUTE_PURE |
| 1127 | _GL_ARG_NONNULL ((1))); | 1129 | _GL_ARG_NONNULL ((1))); |
| 1128 | _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c)); | 1130 | _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c)); |
| @@ -1139,12 +1141,12 @@ _GL_CXXALIASWARN (mbschr); | |||
| 1139 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1141 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1140 | # define mbsrchr rpl_mbsrchr /* avoid collision with system function */ | 1142 | # define mbsrchr rpl_mbsrchr /* avoid collision with system function */ |
| 1141 | # endif | 1143 | # endif |
| 1142 | _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c) | 1144 | _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c), |
| 1143 | _GL_ATTRIBUTE_PURE | 1145 | _GL_ATTRIBUTE_PURE |
| 1144 | _GL_ARG_NONNULL ((1))); | 1146 | _GL_ARG_NONNULL ((1))); |
| 1145 | _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c)); | 1147 | _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c)); |
| 1146 | # else | 1148 | # else |
| 1147 | _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c) | 1149 | _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c), |
| 1148 | _GL_ATTRIBUTE_PURE | 1150 | _GL_ATTRIBUTE_PURE |
| 1149 | _GL_ARG_NONNULL ((1))); | 1151 | _GL_ARG_NONNULL ((1))); |
| 1150 | _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c)); | 1152 | _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c)); |
| @@ -1234,12 +1236,12 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept) | |||
| 1234 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1236 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1235 | # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ | 1237 | # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ |
| 1236 | # endif | 1238 | # endif |
| 1237 | _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept) | 1239 | _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept), |
| 1238 | _GL_ATTRIBUTE_PURE | 1240 | _GL_ATTRIBUTE_PURE |
| 1239 | _GL_ARG_NONNULL ((1, 2))); | 1241 | _GL_ARG_NONNULL ((1, 2))); |
| 1240 | _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept)); | 1242 | _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept)); |
| 1241 | # else | 1243 | # else |
| 1242 | _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept) | 1244 | _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept), |
| 1243 | _GL_ATTRIBUTE_PURE | 1245 | _GL_ATTRIBUTE_PURE |
| 1244 | _GL_ARG_NONNULL ((1, 2))); | 1246 | _GL_ARG_NONNULL ((1, 2))); |
| 1245 | _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept)); | 1247 | _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept)); |
| @@ -1329,12 +1331,12 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - " | |||
| 1329 | # undef strerror_r | 1331 | # undef strerror_r |
| 1330 | # define strerror_r rpl_strerror_r | 1332 | # define strerror_r rpl_strerror_r |
| 1331 | # endif | 1333 | # endif |
| 1332 | _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen) | 1334 | _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen), |
| 1333 | _GL_ARG_NONNULL ((2))); | 1335 | _GL_ARG_NONNULL ((2))); |
| 1334 | _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)); | 1336 | _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)); |
| 1335 | # else | 1337 | # else |
| 1336 | # if !@HAVE_DECL_STRERROR_R@ | 1338 | # if !@HAVE_DECL_STRERROR_R@ |
| 1337 | _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen) | 1339 | _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen), |
| 1338 | _GL_ARG_NONNULL ((2))); | 1340 | _GL_ARG_NONNULL ((2))); |
| 1339 | # endif | 1341 | # endif |
| 1340 | _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); | 1342 | _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); |
| @@ -1433,13 +1435,13 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - " | |||
| 1433 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1435 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1434 | # define strverscmp rpl_strverscmp | 1436 | # define strverscmp rpl_strverscmp |
| 1435 | # endif | 1437 | # endif |
| 1436 | _GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *) | 1438 | _GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *), |
| 1437 | _GL_ATTRIBUTE_PURE | 1439 | _GL_ATTRIBUTE_PURE |
| 1438 | _GL_ARG_NONNULL ((1, 2))); | 1440 | _GL_ARG_NONNULL ((1, 2))); |
| 1439 | _GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *)); | 1441 | _GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *)); |
| 1440 | # else | 1442 | # else |
| 1441 | # if !@HAVE_STRVERSCMP@ | 1443 | # if !@HAVE_STRVERSCMP@ |
| 1442 | _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *) | 1444 | _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *), |
| 1443 | _GL_ATTRIBUTE_PURE | 1445 | _GL_ATTRIBUTE_PURE |
| 1444 | _GL_ARG_NONNULL ((1, 2))); | 1446 | _GL_ARG_NONNULL ((1, 2))); |
| 1445 | # endif | 1447 | # endif |