diff options
| author | Paul Eggert | 2022-02-23 11:11:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2022-02-23 11:41:02 -0800 |
| commit | 308e63ccfcc6a6b1285bb17eff641f48639fb329 (patch) | |
| tree | e3f1daf0bdfb7180fc1f007280fa2a4ee43c259c /lib/string.in.h | |
| parent | 995aed477dc9be708920cc46442673126ed75760 (diff) | |
| download | emacs-308e63ccfcc6a6b1285bb17eff641f48639fb329.tar.gz emacs-308e63ccfcc6a6b1285bb17eff641f48639fb329.zip | |
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'lib/string.in.h')
| -rw-r--r-- | lib/string.in.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/string.in.h b/lib/string.in.h index 03e6a17a36d..c9432948c15 100644 --- a/lib/string.in.h +++ b/lib/string.in.h | |||
| @@ -563,22 +563,35 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " | |||
| 563 | # undef strndup | 563 | # undef strndup |
| 564 | # define strndup rpl_strndup | 564 | # define strndup rpl_strndup |
| 565 | # endif | 565 | # endif |
| 566 | _GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) | 566 | _GL_FUNCDECL_RPL (strndup, char *, |
| 567 | _GL_ARG_NONNULL ((1))); | 567 | (char const *__s, size_t __n) |
| 568 | _GL_ARG_NONNULL ((1)) | ||
| 569 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | ||
| 568 | _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); | 570 | _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); |
| 569 | # else | 571 | # else |
| 570 | # if ! @HAVE_DECL_STRNDUP@ | 572 | # if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11 |
| 571 | _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) | 573 | _GL_FUNCDECL_SYS (strndup, char *, |
| 572 | _GL_ARG_NONNULL ((1))); | 574 | (char const *__s, size_t __n) |
| 575 | _GL_ARG_NONNULL ((1)) | ||
| 576 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | ||
| 573 | # endif | 577 | # endif |
| 574 | _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); | 578 | _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); |
| 575 | # endif | 579 | # endif |
| 576 | _GL_CXXALIASWARN (strndup); | 580 | _GL_CXXALIASWARN (strndup); |
| 577 | #elif defined GNULIB_POSIXCHECK | 581 | #else |
| 578 | # undef strndup | 582 | # if __GNUC__ >= 11 |
| 579 | # if HAVE_RAW_DECL_STRNDUP | 583 | /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ |
| 584 | _GL_FUNCDECL_SYS (strndup, char *, | ||
| 585 | (char const *__s, size_t __n) | ||
| 586 | _GL_ARG_NONNULL ((1)) | ||
| 587 | _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); | ||
| 588 | # endif | ||
| 589 | # if defined GNULIB_POSIXCHECK | ||
| 590 | # undef strndup | ||
| 591 | # if HAVE_RAW_DECL_STRNDUP | ||
| 580 | _GL_WARN_ON_USE (strndup, "strndup is unportable - " | 592 | _GL_WARN_ON_USE (strndup, "strndup is unportable - " |
| 581 | "use gnulib module strndup for portability"); | 593 | "use gnulib module strndup for portability"); |
| 594 | # endif | ||
| 582 | # endif | 595 | # endif |
| 583 | #endif | 596 | #endif |
| 584 | 597 | ||