[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sat, 31 Aug 2024 15:38:56 -0400 (EDT) |
branch: release/7.1
commit a29e70996492faaef66fd833dc8aa5076229ab79
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Aug 31 20:00:24 2024 +0100
* (top-level), tp/Texinfo/XS: run gnulib-tool --add-import
---
.gitignore | 4 +
ChangeLog | 4 +
build-aux/config.rpath | 89 +-
gnulib/lib/Makefile.am | 255 ++-
gnulib/lib/_Noreturn.h | 4 +-
gnulib/lib/alloca.in.h | 2 +-
gnulib/lib/arg-nonnull.h | 2 +-
gnulib/lib/argz.c | 2 +-
gnulib/lib/argz.in.h | 11 +-
gnulib/lib/asnprintf.c | 2 +-
gnulib/lib/asprintf.c | 2 +-
gnulib/lib/assert.in.h | 2 +-
gnulib/lib/attribute.h | 119 +-
gnulib/lib/basename-lgpl.c | 2 +-
gnulib/lib/basename-lgpl.h | 2 +-
gnulib/lib/btowc.c | 2 +-
gnulib/lib/c++defs.h | 41 +-
gnulib/lib/c32is-impl.h | 4 +-
gnulib/lib/c32isalnum.c | 2 +-
gnulib/lib/c32isalpha.c | 2 +-
gnulib/lib/c32isblank.c | 2 +-
gnulib/lib/c32iscntrl.c | 2 +-
gnulib/lib/c32isdigit.c | 2 +-
gnulib/lib/c32isgraph.c | 2 +-
gnulib/lib/c32islower.c | 2 +-
gnulib/lib/c32isprint.c | 2 +-
gnulib/lib/c32ispunct.c | 2 +-
gnulib/lib/c32isspace.c | 2 +-
gnulib/lib/c32isupper.c | 2 +-
gnulib/lib/c32isxdigit.c | 2 +-
gnulib/lib/c32to-impl.h | 4 +-
gnulib/lib/c32tolower.c | 2 +-
gnulib/lib/c32width.c | 4 +-
gnulib/lib/calloc.c | 2 +-
gnulib/lib/cdefs.h | 8 +-
gnulib/lib/cloexec.c | 2 +-
gnulib/lib/cloexec.h | 12 +-
gnulib/lib/close.c | 2 +-
gnulib/lib/dirname-lgpl.c | 2 +-
gnulib/lib/dirname.h | 2 +-
gnulib/lib/dup2.c | 2 +-
gnulib/lib/dynarray.h | 2 +-
gnulib/lib/errno.in.h | 11 +-
gnulib/lib/error.c | 172 +-
gnulib/lib/error.in.h | 65 +-
gnulib/lib/exitfail.c | 2 +-
gnulib/lib/exitfail.h | 12 +-
gnulib/lib/fcntl.c | 2 +-
gnulib/lib/fcntl.in.h | 13 +-
gnulib/lib/fd-hook.c | 2 +-
gnulib/lib/fd-hook.h | 2 +-
gnulib/lib/filename.h | 2 +-
gnulib/lib/float+.h | 2 +-
gnulib/lib/float.c | 97 +-
gnulib/lib/float.in.h | 154 +-
gnulib/lib/free.c | 2 +-
gnulib/lib/fstat.c | 2 +-
gnulib/lib/getdtablesize.c | 2 +-
gnulib/lib/getopt-cdefs.in.h | 2 +-
gnulib/lib/getopt-core.h | 2 +-
gnulib/lib/getopt-ext.h | 2 +-
gnulib/lib/getopt-pfx-core.h | 2 +-
gnulib/lib/getopt-pfx-ext.h | 2 +-
gnulib/lib/getopt.c | 37 +-
gnulib/lib/getopt.in.h | 2 +-
gnulib/lib/getopt1.c | 4 +-
gnulib/lib/getopt_int.h | 2 +-
gnulib/lib/getprogname.c | 2 +-
gnulib/lib/getprogname.h | 2 +-
gnulib/lib/getrandom.c | 2 +-
gnulib/lib/gettext.h | 2 +-
gnulib/lib/glthread/lock.c | 44 +-
gnulib/lib/glthread/lock.h | 153 +-
gnulib/lib/glthread/once.c | 80 +
gnulib/lib/glthread/once.h | 272 +++
gnulib/lib/glthread/threadlib.c | 2 +-
gnulib/lib/hard-locale.c | 2 +-
gnulib/lib/hard-locale.h | 14 +-
gnulib/lib/ialloc.c | 2 +-
gnulib/lib/ialloc.h | 45 +-
gnulib/lib/idx.h | 12 +-
gnulib/lib/intprops-internal.h | 14 +-
gnulib/lib/intprops.h | 2 +-
gnulib/lib/inttypes.in.h | 10 +-
gnulib/lib/iswblank.c | 2 +-
gnulib/lib/iswctype-impl.h | 2 +-
gnulib/lib/iswctype.c | 2 +-
gnulib/lib/iswdigit.c | 2 +-
gnulib/lib/iswpunct.c | 2 +-
gnulib/lib/iswxdigit.c | 2 +-
gnulib/lib/itold.c | 2 +-
gnulib/lib/langinfo.in.h | 2 +-
gnulib/lib/lc-charset-dispatch.c | 2 +-
gnulib/lib/lc-charset-dispatch.h | 2 +-
gnulib/lib/libc-config.h | 7 +-
gnulib/lib/limits.in.h | 4 +-
gnulib/lib/localcharset.c | 4 +-
gnulib/lib/localcharset.h | 2 +-
gnulib/lib/locale.in.h | 20 +-
gnulib/lib/localeconv.c | 2 +-
gnulib/lib/lstat.c | 2 +-
gnulib/lib/malloc.c | 2 +-
gnulib/lib/malloc/dynarray-skeleton.c | 2 +-
gnulib/lib/malloc/dynarray.h | 2 +-
gnulib/lib/malloc/dynarray_at_failure.c | 2 +-
gnulib/lib/malloc/dynarray_emplace_enlarge.c | 2 +-
gnulib/lib/malloc/dynarray_finalize.c | 2 +-
gnulib/lib/malloc/dynarray_resize.c | 2 +-
gnulib/lib/malloc/dynarray_resize_clear.c | 2 +-
gnulib/lib/malloca.c | 41 +-
gnulib/lib/malloca.h | 29 +-
gnulib/lib/mbchar.c | 2 +-
gnulib/lib/mbchar.h | 12 +-
gnulib/lib/mbiter.c | 2 +-
gnulib/lib/mbiter.h | 12 +-
gnulib/lib/mbrtoc32.c | 10 +-
gnulib/lib/mbrtowc-impl-utf8.h | 2 +-
gnulib/lib/mbrtowc-impl.h | 2 +-
gnulib/lib/mbrtowc.c | 8 +-
gnulib/lib/mbscasecmp.c | 2 +-
gnulib/lib/mbschr.c | 20 +-
gnulib/lib/mbsinit.c | 2 +-
gnulib/lib/mbslen.c | 2 +-
gnulib/lib/mbsncasecmp.c | 21 +-
gnulib/lib/mbsstr.c | 10 +-
gnulib/lib/mbswidth.c | 2 +-
gnulib/lib/mbswidth.h | 2 +-
gnulib/lib/mbszero.c | 2 +-
gnulib/lib/mbtowc-impl.h | 2 +-
gnulib/lib/mbtowc-lock.c | 5 +-
gnulib/lib/mbtowc-lock.h | 4 +-
gnulib/lib/mbtowc.c | 2 +-
gnulib/lib/mbuiter.c | 2 +-
gnulib/lib/mbuiter.h | 12 +-
gnulib/lib/mbuiterf.c | 2 +-
gnulib/lib/mbuiterf.h | 12 +-
gnulib/lib/memchr.c | 2 +-
gnulib/lib/memchr.valgrind | 2 +-
gnulib/lib/mempcpy.c | 2 +-
gnulib/lib/memrchr.c | 2 +-
gnulib/lib/minmax.h | 2 +-
gnulib/lib/mkdir.c | 2 +-
gnulib/lib/mkstemp.c | 2 +-
gnulib/lib/msvc-inval.c | 2 +-
gnulib/lib/msvc-inval.h | 2 +-
gnulib/lib/msvc-nothrow.c | 2 +-
gnulib/lib/msvc-nothrow.h | 10 +-
gnulib/lib/nl_langinfo-lock.c | 5 +-
gnulib/lib/nl_langinfo.c | 21 +-
gnulib/lib/open.c | 8 +-
gnulib/lib/pathmax.h | 2 +-
gnulib/lib/printf-args.c | 4 +-
gnulib/lib/printf-args.h | 13 +-
gnulib/lib/printf-parse.c | 13 +-
gnulib/lib/printf-parse.h | 2 +-
gnulib/lib/pthread-once.c | 148 ++
gnulib/lib/pthread.in.h | 2032 ++++++++++++++++++++
gnulib/lib/realloc.c | 2 +-
gnulib/lib/reallocarray.c | 2 +-
gnulib/lib/regcomp.c | 2 +-
gnulib/lib/regex.c | 6 +-
gnulib/lib/regex.h | 2 +-
gnulib/lib/regex_internal.c | 2 +-
gnulib/lib/regex_internal.h | 2 +-
gnulib/lib/regexec.c | 2 +-
gnulib/lib/sched.in.h | 111 ++
gnulib/lib/setlocale-lock.c | 5 +-
gnulib/lib/setlocale_null-unlocked.c | 149 ++
gnulib/lib/setlocale_null.c | 172 +-
gnulib/lib/setlocale_null.h | 30 +-
gnulib/lib/size_max.h | 2 +-
gnulib/lib/stat-time.c | 2 +-
gnulib/lib/stat-time.h | 15 +-
gnulib/lib/stat-w32.c | 2 +-
gnulib/lib/stat-w32.h | 2 +-
gnulib/lib/stat.c | 2 +-
gnulib/lib/stdarg.in.h | 2 +-
gnulib/lib/stdckdint.in.h | 2 +-
gnulib/lib/stddef.in.h | 44 +-
gnulib/lib/stdint.in.h | 15 +-
gnulib/lib/stdio-read.c | 2 +-
gnulib/lib/stdio-write.c | 2 +-
gnulib/lib/stdio.in.h | 543 ++++--
gnulib/lib/stdlib.in.h | 437 +++--
gnulib/lib/stpcpy.c | 2 +-
gnulib/lib/str-kmp.h | 2 +-
gnulib/lib/str-two-way.h | 2 +-
gnulib/lib/strcasecmp.c | 2 +-
gnulib/lib/strcasestr.c | 2 +-
gnulib/lib/strdup.c | 2 +-
gnulib/lib/streq.h | 12 +-
gnulib/lib/strerror-override.c | 7 +-
gnulib/lib/strerror-override.h | 75 +-
gnulib/lib/strerror.c | 2 +-
gnulib/lib/string.in.h | 152 +-
gnulib/lib/strings.in.h | 2 +-
gnulib/lib/stripslash.c | 2 +-
gnulib/lib/strncasecmp.c | 2 +-
gnulib/lib/strndup.c | 2 +-
gnulib/lib/strnlen.c | 18 +-
gnulib/lib/strnlen1.c | 2 +-
gnulib/lib/strnlen1.h | 2 +-
gnulib/lib/strstr.c | 2 +-
gnulib/lib/sys_random.in.h | 13 +-
gnulib/lib/sys_stat.in.h | 92 +-
gnulib/lib/sys_types.in.h | 11 +-
gnulib/lib/tempname.c | 6 +-
gnulib/lib/tempname.h | 2 +-
gnulib/lib/time.in.h | 78 +-
gnulib/lib/uchar.in.h | 30 +-
gnulib/lib/unicase.in.h | 2 +-
gnulib/lib/unicase/simple-mapping.h | 2 +-
gnulib/lib/unicase/tolower.c | 2 +-
gnulib/lib/unicase/tolower.h | 4 +-
gnulib/lib/unictype.in.h | 48 +-
gnulib/lib/unictype/bitmap.h | 2 +-
gnulib/lib/unictype/ctype_alnum.c | 2 +-
gnulib/lib/unictype/ctype_alnum.h | 22 +-
gnulib/lib/unictype/ctype_alpha.c | 2 +-
gnulib/lib/unictype/ctype_alpha.h | 22 +-
gnulib/lib/unictype/ctype_blank.c | 2 +-
gnulib/lib/unictype/ctype_blank.h | 4 +-
gnulib/lib/unictype/ctype_cntrl.c | 2 +-
gnulib/lib/unictype/ctype_cntrl.h | 4 +-
gnulib/lib/unictype/ctype_digit.c | 2 +-
gnulib/lib/unictype/ctype_digit.h | 4 +-
gnulib/lib/unictype/ctype_graph.c | 2 +-
gnulib/lib/unictype/ctype_graph.h | 30 +-
gnulib/lib/unictype/ctype_lower.c | 2 +-
gnulib/lib/unictype/ctype_lower.h | 4 +-
gnulib/lib/unictype/ctype_print.c | 2 +-
gnulib/lib/unictype/ctype_print.h | 30 +-
gnulib/lib/unictype/ctype_punct.c | 2 +-
gnulib/lib/unictype/ctype_punct.h | 8 +-
gnulib/lib/unictype/ctype_space.c | 2 +-
gnulib/lib/unictype/ctype_space.h | 4 +-
gnulib/lib/unictype/ctype_upper.c | 2 +-
gnulib/lib/unictype/ctype_upper.h | 4 +-
gnulib/lib/unictype/ctype_xdigit.c | 2 +-
gnulib/lib/unictype/ctype_xdigit.h | 4 +-
gnulib/lib/uninorm.in.h | 2 +-
gnulib/lib/unistd.c | 4 +-
gnulib/lib/unistd.in.h | 374 ++--
gnulib/lib/unitypes.in.h | 12 +-
gnulib/lib/uniwidth.in.h | 2 +-
gnulib/lib/uniwidth/cjk.h | 2 +-
gnulib/lib/uniwidth/width.c | 2 +-
gnulib/lib/uniwidth/width0.h | 18 +-
gnulib/lib/uniwidth/width2.h | 4 +-
gnulib/lib/vasnprintf.c | 709 +++++--
gnulib/lib/vasnprintf.h | 2 +-
gnulib/lib/vasprintf.c | 14 +-
gnulib/lib/verify.h | 26 +-
gnulib/lib/warn-on-use.h | 14 +-
gnulib/lib/wchar.in.h | 150 +-
gnulib/lib/wcrtomb.c | 2 +-
gnulib/lib/wctype-h.c | 4 +-
gnulib/lib/wctype-impl.h | 2 +-
gnulib/lib/wctype.c | 2 +-
gnulib/lib/wctype.in.h | 10 +-
gnulib/lib/wcwidth.c | 2 +-
gnulib/lib/windows-initguard.h | 2 +-
gnulib/lib/windows-mutex.c | 26 +-
gnulib/lib/windows-mutex.h | 3 +-
gnulib/lib/windows-once.c | 51 +-
gnulib/lib/windows-once.h | 7 +-
gnulib/lib/windows-recmutex.c | 2 +-
gnulib/lib/windows-recmutex.h | 2 +-
gnulib/lib/windows-rwlock.c | 2 +-
gnulib/lib/windows-rwlock.h | 2 +-
gnulib/lib/xalloc-die.c | 4 +-
gnulib/lib/xalloc-oversized.h | 8 +-
gnulib/lib/xalloc.h | 2 +-
gnulib/lib/xmalloc.c | 16 +-
gnulib/lib/xsize.c | 2 +-
gnulib/lib/xsize.h | 30 +-
gnulib/m4/00gnulib.m4 | 13 +-
gnulib/m4/__inline.m4 | 7 +-
gnulib/m4/absolute-header.m4 | 5 +-
gnulib/m4/alloca.m4 | 5 +-
gnulib/m4/argz.m4 | 20 +-
gnulib/m4/assert_h.m4 | 11 +-
gnulib/m4/btowc.m4 | 5 +-
gnulib/m4/builtin-expect.m4 | 8 +-
gnulib/m4/c-bool.m4 | 8 +-
gnulib/m4/c32rtomb.m4 | 186 ++
gnulib/m4/calloc.m4 | 17 +-
gnulib/m4/clock_time.m4 | 5 +-
gnulib/m4/close.m4 | 5 +-
gnulib/m4/codeset.m4 | 5 +-
gnulib/m4/double-slash-root.m4 | 5 +-
gnulib/m4/dup2.m4 | 5 +-
gnulib/m4/eealloc.m4 | 5 +-
gnulib/m4/errno_h.m4 | 13 +-
gnulib/m4/error.m4 | 13 +-
gnulib/m4/error_h.m4 | 22 +-
gnulib/m4/exponentd.m4 | 5 +-
gnulib/m4/extensions-aix.m4 | 25 +
gnulib/m4/extensions.m4 | 24 +-
gnulib/m4/extern-inline.m4 | 8 +-
gnulib/m4/fcntl-o.m4 | 5 +-
gnulib/m4/fcntl.m4 | 7 +-
gnulib/m4/fcntl_h.m4 | 6 +-
gnulib/m4/float_h.m4 | 30 +-
gnulib/m4/free.m4 | 11 +-
gnulib/m4/fstat.m4 | 9 +-
gnulib/m4/getdtablesize.m4 | 5 +-
gnulib/m4/getopt.m4 | 14 +-
gnulib/m4/getprogname.m4 | 14 +-
gnulib/m4/getrandom.m4 | 7 +-
gnulib/m4/gnulib-cache.m4 | 2 +-
gnulib/m4/gnulib-common.m4 | 435 ++++-
gnulib/m4/gnulib-comp.m4 | 135 +-
gnulib/m4/gnulib-tool.m4 | 8 +-
gnulib/m4/host-cpu-c-abi.m4 | 248 +--
gnulib/m4/iconv.m4 | 56 +-
gnulib/m4/include_next.m4 | 13 +-
gnulib/m4/intmax_t.m4 | 5 +-
gnulib/m4/inttypes.m4 | 5 +-
gnulib/m4/inttypes_h.m4 | 5 +-
gnulib/m4/iswblank.m4 | 5 +-
gnulib/m4/iswctype.m4 | 5 +-
gnulib/m4/iswdigit.m4 | 14 +-
gnulib/m4/iswpunct.m4 | 6 +-
gnulib/m4/iswxdigit.m4 | 10 +-
gnulib/m4/langinfo_h.m4 | 5 +-
gnulib/m4/largefile.m4 | 45 +-
gnulib/m4/lib-ld.m4 | 11 +-
gnulib/m4/lib-link.m4 | 33 +-
gnulib/m4/lib-prefix.m4 | 32 +-
gnulib/m4/libunistring-base.m4 | 11 +-
gnulib/m4/limits-h.m4 | 8 +-
gnulib/m4/localcharset.m4 | 5 +-
gnulib/m4/locale-fr.m4 | 9 +-
gnulib/m4/locale-ja.m4 | 7 +-
gnulib/m4/locale-zh.m4 | 19 +-
gnulib/m4/locale_h.m4 | 10 +-
gnulib/m4/localeconv.m4 | 5 +-
gnulib/m4/lock.m4 | 5 +-
gnulib/m4/lstat.m4 | 15 +-
gnulib/m4/malloc.m4 | 13 +-
gnulib/m4/malloca.m4 | 5 +-
gnulib/m4/math_h.m4 | 66 +-
gnulib/m4/mbchar.m4 | 5 +-
gnulib/m4/mbiter.m4 | 5 +-
gnulib/m4/mbrtoc32.m4 | 65 +-
gnulib/m4/mbrtowc.m4 | 5 +-
gnulib/m4/mbsinit.m4 | 5 +-
gnulib/m4/mbslen.m4 | 5 +-
gnulib/m4/mbstate_t.m4 | 5 +-
gnulib/m4/mbswidth.m4 | 5 +-
gnulib/m4/mbtowc.m4 | 5 +-
gnulib/m4/memchr.m4 | 7 +-
gnulib/m4/mempcpy.m4 | 5 +-
gnulib/m4/memrchr.m4 | 5 +-
gnulib/m4/minmax.m4 | 5 +-
gnulib/m4/mkdir.m4 | 13 +-
gnulib/m4/mkstemp.m4 | 12 +-
gnulib/m4/mmap-anon.m4 | 5 +-
gnulib/m4/mode_t.m4 | 5 +-
gnulib/m4/msvc-inval.m4 | 5 +-
gnulib/m4/msvc-nothrow.m4 | 5 +-
gnulib/m4/multiarch.m4 | 5 +-
gnulib/m4/musl.m4 | 5 +-
gnulib/m4/nl_langinfo.m4 | 5 +-
gnulib/m4/nocrash.m4 | 5 +-
gnulib/m4/off64_t.m4 | 31 +
gnulib/m4/off_t.m4 | 5 +-
gnulib/m4/{msvc-nothrow.m4 => once.m4} | 11 +-
gnulib/m4/open-cloexec.m4 | 8 +-
gnulib/m4/open-slash.m4 | 5 +-
gnulib/m4/open.m4 | 5 +-
gnulib/m4/pathmax.m4 | 5 +-
gnulib/m4/pid_t.m4 | 5 +-
gnulib/m4/printf.m4 | 254 ++-
gnulib/m4/pthread-once.m4 | 36 +
gnulib/m4/pthread-spin.m4 | 71 +
gnulib/m4/pthread_h.m4 | 292 +++
gnulib/m4/pthread_rwlock_rdlock.m4 | 11 +-
gnulib/m4/realloc.m4 | 13 +-
gnulib/m4/reallocarray.m4 | 5 +-
gnulib/m4/regex.m4 | 11 +-
gnulib/m4/sched_h.m4 | 101 +
gnulib/m4/setlocale_null.m4 | 5 +-
gnulib/m4/size_max.m4 | 5 +-
gnulib/m4/ssize_t.m4 | 5 +-
gnulib/m4/stat-time.m4 | 14 +-
gnulib/m4/stat.m4 | 17 +-
gnulib/m4/std-gnu11.m4 | 11 +-
gnulib/m4/stdalign.m4 | 16 +-
gnulib/m4/stdarg.m4 | 5 +-
gnulib/m4/stddef_h.m4 | 44 +-
gnulib/m4/stdint.m4 | 5 +-
gnulib/m4/stdint_h.m4 | 5 +-
gnulib/m4/stdio_h.m4 | 17 +-
gnulib/m4/stdlib_h.m4 | 14 +-
gnulib/m4/stpcpy.m4 | 5 +-
gnulib/m4/strcase.m4 | 5 +-
gnulib/m4/strcasestr.m4 | 7 +-
gnulib/m4/strdup.m4 | 5 +-
gnulib/m4/strerror.m4 | 5 +-
gnulib/m4/string_h.m4 | 16 +-
gnulib/m4/strings_h.m4 | 11 +-
gnulib/m4/strndup.m4 | 5 +-
gnulib/m4/strnlen.m4 | 54 +-
gnulib/m4/strstr.m4 | 7 +-
gnulib/m4/sys_cdefs_h.m4 | 25 +
gnulib/m4/sys_random_h.m4 | 5 +-
gnulib/m4/sys_socket_h.m4 | 5 +-
gnulib/m4/sys_stat_h.m4 | 5 +-
gnulib/m4/sys_types_h.m4 | 8 +-
gnulib/m4/tempname.m4 | 12 +-
gnulib/m4/threadlib.m4 | 22 +-
gnulib/m4/time_h.m4 | 17 +-
gnulib/m4/uchar_h.m4 | 5 +-
gnulib/m4/unicase_h.m4 | 5 +-
gnulib/m4/unictype_h.m4 | 9 +-
gnulib/m4/uninorm_h.m4 | 5 +-
gnulib/m4/unistd_h.m4 | 7 +-
gnulib/m4/vararrays.m4 | 14 +-
gnulib/m4/vasnprintf.m4 | 60 +-
gnulib/m4/vasprintf.m4 | 5 +-
gnulib/m4/visibility.m4 | 13 +-
gnulib/m4/warn-on-use.m4 | 9 +-
gnulib/m4/wchar_h.m4 | 19 +-
gnulib/m4/wchar_t.m4 | 24 -
gnulib/m4/wcrtomb.m4 | 5 +-
gnulib/m4/wctype.m4 | 5 +-
gnulib/m4/wctype_h.m4 | 5 +-
gnulib/m4/wcwidth.m4 | 10 +-
gnulib/m4/wint_t.m4 | 5 +-
gnulib/m4/xalloc.m4 | 5 +-
gnulib/m4/xsize.m4 | 5 +-
gnulib/m4/zzgnulib.m4 | 5 +-
tp/Texinfo/XS/config.rpath | 89 +-
tp/Texinfo/XS/gnulib/lib/Makefile.am | 109 +-
tp/Texinfo/XS/gnulib/lib/_Noreturn.h | 4 +-
tp/Texinfo/XS/gnulib/lib/alignof.h | 2 +-
tp/Texinfo/XS/gnulib/lib/alloca.in.h | 2 +-
tp/Texinfo/XS/gnulib/lib/arg-nonnull.h | 2 +-
tp/Texinfo/XS/gnulib/lib/asnprintf.c | 2 +-
tp/Texinfo/XS/gnulib/lib/asprintf.c | 2 +-
tp/Texinfo/XS/gnulib/lib/assert.in.h | 2 +-
tp/Texinfo/XS/gnulib/lib/attribute.h | 119 +-
tp/Texinfo/XS/gnulib/lib/c++defs.h | 41 +-
tp/Texinfo/XS/gnulib/lib/c-ctype.c | 2 +-
tp/Texinfo/XS/gnulib/lib/c-ctype.h | 2 +-
tp/Texinfo/XS/gnulib/lib/c-strcase.h | 2 +-
tp/Texinfo/XS/gnulib/lib/c-strcasecmp.c | 2 +-
tp/Texinfo/XS/gnulib/lib/c-strcaseeq.h | 12 +-
tp/Texinfo/XS/gnulib/lib/c-strncasecmp.c | 2 +-
tp/Texinfo/XS/gnulib/lib/errno.in.h | 11 +-
tp/Texinfo/XS/gnulib/lib/exitfail.c | 2 +-
tp/Texinfo/XS/gnulib/lib/exitfail.h | 12 +-
tp/Texinfo/XS/gnulib/lib/float+.h | 2 +-
tp/Texinfo/XS/gnulib/lib/float.c | 97 +-
tp/Texinfo/XS/gnulib/lib/float.in.h | 154 +-
tp/Texinfo/XS/gnulib/lib/free.c | 2 +-
tp/Texinfo/XS/gnulib/lib/getdelim.c | 2 +-
tp/Texinfo/XS/gnulib/lib/getline.c | 2 +-
tp/Texinfo/XS/gnulib/lib/gettext.h | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv.c | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv.in.h | 4 +-
tp/Texinfo/XS/gnulib/lib/iconv_close.c | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-aix.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-aix.h | 68 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.h | 92 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-irix.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-irix.h | 42 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-osf.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-osf.h | 80 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.h | 30 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-zos.gperf | 2 +-
tp/Texinfo/XS/gnulib/lib/iconv_open-zos.h | 102 +-
tp/Texinfo/XS/gnulib/lib/iconv_open.c | 2 +-
tp/Texinfo/XS/gnulib/lib/iconveh.h | 2 +-
tp/Texinfo/XS/gnulib/lib/idx.h | 12 +-
tp/Texinfo/XS/gnulib/lib/intprops-internal.h | 14 +-
tp/Texinfo/XS/gnulib/lib/inttypes.in.h | 10 +-
tp/Texinfo/XS/gnulib/lib/itold.c | 2 +-
tp/Texinfo/XS/gnulib/lib/libunistring.valgrind | 2 +-
tp/Texinfo/XS/gnulib/lib/limits.in.h | 4 +-
tp/Texinfo/XS/gnulib/lib/localcharset.c | 4 +-
tp/Texinfo/XS/gnulib/lib/localcharset.h | 2 +-
tp/Texinfo/XS/gnulib/lib/malloca.c | 41 +-
tp/Texinfo/XS/gnulib/lib/malloca.h | 29 +-
tp/Texinfo/XS/gnulib/lib/mbszero.c | 2 +-
tp/Texinfo/XS/gnulib/lib/memchr.c | 2 +-
tp/Texinfo/XS/gnulib/lib/memchr.valgrind | 2 +-
tp/Texinfo/XS/gnulib/lib/obstack.c | 93 +-
.../XS/gnulib/lib/{obstack.h => obstack.in.h} | 64 +-
tp/Texinfo/XS/gnulib/lib/printf-args.c | 4 +-
tp/Texinfo/XS/gnulib/lib/printf-args.h | 13 +-
tp/Texinfo/XS/gnulib/lib/printf-parse.c | 13 +-
tp/Texinfo/XS/gnulib/lib/printf-parse.h | 2 +-
tp/Texinfo/XS/gnulib/lib/rawmemchr.c | 28 +-
tp/Texinfo/XS/gnulib/lib/rawmemchr.valgrind | 2 +-
tp/Texinfo/XS/gnulib/lib/size_max.h | 2 +-
tp/Texinfo/XS/gnulib/lib/stdckdint.in.h | 2 +-
tp/Texinfo/XS/gnulib/lib/stddef.in.h | 44 +-
tp/Texinfo/XS/gnulib/lib/stdint.in.h | 15 +-
tp/Texinfo/XS/gnulib/lib/stdio-read.c | 2 +-
tp/Texinfo/XS/gnulib/lib/stdio-write.c | 2 +-
tp/Texinfo/XS/gnulib/lib/stdio.in.h | 543 ++++--
tp/Texinfo/XS/gnulib/lib/stdlib.in.h | 437 +++--
tp/Texinfo/XS/gnulib/lib/strchrnul.c | 2 +-
tp/Texinfo/XS/gnulib/lib/strchrnul.valgrind | 2 +-
tp/Texinfo/XS/gnulib/lib/streq.h | 12 +-
tp/Texinfo/XS/gnulib/lib/striconveh.c | 29 +-
tp/Texinfo/XS/gnulib/lib/striconveh.h | 2 +-
tp/Texinfo/XS/gnulib/lib/striconveha.c | 41 +-
tp/Texinfo/XS/gnulib/lib/striconveha.h | 2 +-
tp/Texinfo/XS/gnulib/lib/string.in.h | 152 +-
tp/Texinfo/XS/gnulib/lib/strndup.c | 2 +-
tp/Texinfo/XS/gnulib/lib/strnlen.c | 18 +-
tp/Texinfo/XS/gnulib/lib/sys_types.in.h | 11 +-
tp/Texinfo/XS/gnulib/lib/uniconv.in.h | 2 +-
.../XS/gnulib/lib/uniconv/u-strconv-from-enc.h | 2 +-
.../XS/gnulib/lib/uniconv/u8-conv-from-enc.c | 2 +-
.../XS/gnulib/lib/uniconv/u8-strconv-from-enc.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unictype/bitmap.h | 2 +-
tp/Texinfo/XS/gnulib/lib/unistd.c | 4 +-
tp/Texinfo/XS/gnulib/lib/unistd.in.h | 374 ++--
tp/Texinfo/XS/gnulib/lib/unistr.in.h | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-check.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mblen.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mbsnlen.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-aux.c | 2 +-
.../XS/gnulib/lib/unistr/u8-mbtouc-unsafe-aux.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtoucr.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-prev.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-strlen.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb-aux.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb.c | 2 +-
tp/Texinfo/XS/gnulib/lib/unitypes.in.h | 12 +-
tp/Texinfo/XS/gnulib/lib/uniwidth.in.h | 2 +-
tp/Texinfo/XS/gnulib/lib/uniwidth/cjk.h | 2 +-
tp/Texinfo/XS/gnulib/lib/uniwidth/width.c | 2 +-
tp/Texinfo/XS/gnulib/lib/uniwidth/width0.h | 18 +-
tp/Texinfo/XS/gnulib/lib/uniwidth/width2.h | 4 +-
tp/Texinfo/XS/gnulib/lib/vasnprintf.c | 709 +++++--
tp/Texinfo/XS/gnulib/lib/vasnprintf.h | 2 +-
tp/Texinfo/XS/gnulib/lib/vasprintf.c | 14 +-
tp/Texinfo/XS/gnulib/lib/verify.h | 26 +-
tp/Texinfo/XS/gnulib/lib/warn-on-use.h | 14 +-
tp/Texinfo/XS/gnulib/lib/wchar.in.h | 150 +-
tp/Texinfo/XS/gnulib/lib/wctype-h.c | 4 +-
tp/Texinfo/XS/gnulib/lib/wctype.in.h | 10 +-
tp/Texinfo/XS/gnulib/lib/wcwidth.c | 2 +-
tp/Texinfo/XS/gnulib/lib/xalloc-oversized.h | 8 +-
tp/Texinfo/XS/gnulib/lib/xsize.c | 2 +-
tp/Texinfo/XS/gnulib/lib/xsize.h | 30 +-
tp/Texinfo/XS/gnulib/m4/00gnulib.m4 | 13 +-
tp/Texinfo/XS/gnulib/m4/absolute-header.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/alloca.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/assert_h.m4 | 11 +-
tp/Texinfo/XS/gnulib/m4/c-bool.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/codeset.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/eealloc.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/errno_h.m4 | 13 +-
tp/Texinfo/XS/gnulib/m4/exponentd.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/extensions-aix.m4 | 25 +
tp/Texinfo/XS/gnulib/m4/extensions.m4 | 24 +-
tp/Texinfo/XS/gnulib/m4/extern-inline.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/float_h.m4 | 30 +-
tp/Texinfo/XS/gnulib/m4/free.m4 | 11 +-
tp/Texinfo/XS/gnulib/m4/getdelim.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/getline.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/gnulib-cache.m4 | 2 +-
tp/Texinfo/XS/gnulib/m4/gnulib-common.m4 | 435 ++++-
tp/Texinfo/XS/gnulib/m4/gnulib-comp.m4 | 24 +-
tp/Texinfo/XS/gnulib/m4/gnulib-tool.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4 | 248 +--
tp/Texinfo/XS/gnulib/m4/iconv.m4 | 56 +-
tp/Texinfo/XS/gnulib/m4/iconv_h.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/iconv_open.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/include_next.m4 | 13 +-
tp/Texinfo/XS/gnulib/m4/inline.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/intmax_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/inttypes.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/inttypes_h.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/lib-ld.m4 | 11 +-
tp/Texinfo/XS/gnulib/m4/lib-link.m4 | 33 +-
tp/Texinfo/XS/gnulib/m4/lib-prefix.m4 | 32 +-
tp/Texinfo/XS/gnulib/m4/libunistring-base.m4 | 11 +-
tp/Texinfo/XS/gnulib/m4/libunistring.m4 | 9 +-
tp/Texinfo/XS/gnulib/m4/limits-h.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/localcharset.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/locale-fr.m4 | 9 +-
tp/Texinfo/XS/gnulib/m4/locale-ja.m4 | 7 +-
tp/Texinfo/XS/gnulib/m4/locale-zh.m4 | 19 +-
tp/Texinfo/XS/gnulib/m4/malloca.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/math_h.m4 | 66 +-
tp/Texinfo/XS/gnulib/m4/mbrtowc.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/mbstate_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/memchr.m4 | 7 +-
tp/Texinfo/XS/gnulib/m4/mmap-anon.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/multiarch.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/musl.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/obstack.m4 | 78 +-
tp/Texinfo/XS/gnulib/m4/off64_t.m4 | 31 +
tp/Texinfo/XS/gnulib/m4/off_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/pid_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/printf.m4 | 254 ++-
tp/Texinfo/XS/gnulib/m4/rawmemchr.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/size_max.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/ssize_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/std-gnu11.m4 | 11 +-
tp/Texinfo/XS/gnulib/m4/stdalign.m4 | 16 +-
tp/Texinfo/XS/gnulib/m4/stddef_h.m4 | 44 +-
tp/Texinfo/XS/gnulib/m4/stdint.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/stdint_h.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/stdio_h.m4 | 17 +-
tp/Texinfo/XS/gnulib/m4/stdlib_h.m4 | 14 +-
tp/Texinfo/XS/gnulib/m4/strchrnul.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/string_h.m4 | 16 +-
tp/Texinfo/XS/gnulib/m4/strndup.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/strnlen.m4 | 54 +-
tp/Texinfo/XS/gnulib/m4/sys_types_h.m4 | 8 +-
tp/Texinfo/XS/gnulib/m4/unistd_h.m4 | 7 +-
tp/Texinfo/XS/gnulib/m4/vararrays.m4 | 14 +-
tp/Texinfo/XS/gnulib/m4/vasnprintf.m4 | 60 +-
tp/Texinfo/XS/gnulib/m4/vasprintf.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/warn-on-use.m4 | 9 +-
tp/Texinfo/XS/gnulib/m4/wchar_h.m4 | 19 +-
tp/Texinfo/XS/gnulib/m4/wchar_t.m4 | 24 -
tp/Texinfo/XS/gnulib/m4/wctype_h.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/wcwidth.m4 | 10 +-
tp/Texinfo/XS/gnulib/m4/wint_t.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/xsize.m4 | 5 +-
tp/Texinfo/XS/gnulib/m4/zzgnulib.m4 | 5 +-
635 files changed, 13152 insertions(+), 4786 deletions(-)
diff --git a/.gitignore b/.gitignore
index 95e1bb2e25..eaf0f5e9f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,6 +54,8 @@ gnulib/lib/getopt.h
gnulib/lib/inttypes.h
gnulib/lib/langinfo.h
gnulib/lib/locale.h
+gnulib/lib/pthread.h
+gnulib/lib/sched.h
gnulib/lib/stdarg.h
gnulib/lib/stdbool.h
gnulib/lib/stdint.h
@@ -88,6 +90,8 @@ tp/Texinfo/XS/gnulib/lib/iconv.h
tp/Texinfo/XS/gnulib/lib/stdckdint.h
tp/Texinfo/XS/gnulib/lib/uniconv.h
tp/Texinfo/XS/gnulib/lib/unistr.h
+tp/Texinfo/XS/gnulib/lib/obstack.h
+tp/Texinfo/XS/gnulib/lib/float.h
gnulib/lib/**/.dirstamp
diff --git a/ChangeLog b/ChangeLog
index c306e7e083..dc8361f88d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-08-31 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * (top-level), tp/Texinfo/XS: run gnulib-tool --add-import
+
2024-06-16 Patrice Dumas <pertusus@free.fr>
* system.h: remove strerror definition, the prototype looks wrong and
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index 1e2595ff59..58870bd70d 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -1,23 +1,15 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
+# run time search path of shared libraries in a binary (executable or
+# shared library).
#
-# Copyright 1996-2023 Free Software Foundation, Inc.
+# Copyright 1996-2024 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-#
-# The first argument passed to this file is the canonical host specification,
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
@@ -25,6 +17,81 @@
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
+# func_usage
+# outputs to stdout the --help usage message.
+func_usage ()
+{
+ echo "\
+Usage: config.rpath [OPTION] HOST
+
+Prints shell variable assignments that describe how to hardcode a directory
+for the lookup of shared libraries into a binary (executable or shared
library).
+
+The first argument passed to this file is the canonical host specification,
+ CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+or
+ CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+
+The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+should be set by the caller.
+
+The set of defined variables is at the end of this script.
+
+Options:
+ --help print this help and exit
+ --version print version information and exit
+
+Send patches and bug reports to <bug-gnulib@gnu.org>."
+}
+
+# func_version
+# outputs to stdout the --version message.
+func_version ()
+{
+ echo "config.rpath (GNU gnulib, module havelib)"
+ echo "Copyright (C) 2024 Free Software Foundation, Inc.
+License: All-Permissive.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law."
+ echo
+ printf 'Written by %s.\n' "Bruno Haible"
+}
+
+# func_fatal_error message
+# outputs to stderr a fatal error message, and terminates the program.
+func_fatal_error ()
+{
+ echo "config.rpath: *** $1" 1>&2
+ echo "config.rpath: *** Stop." 1>&2
+ exit 1
+}
+
+# Command-line option processing.
+while test $# -gt 0; do
+ case "$1" in
+ --help | --hel | --he | --h )
+ func_usage
+ exit 0 ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v )
+ func_version
+ exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ -* )
+ func_fatal_error "unrecognized option: $1"
+ ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# -gt 1; then
+ func_fatal_error "too many arguments"
+fi
+if test $# -lt 1; then
+ func_fatal_error "too few arguments"
+fi
+
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index 8984cd3f30..0c49c6cfb7 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -61,6 +61,7 @@ SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES =
+pkgdata_DATA =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
@@ -582,6 +583,7 @@ SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e
1G
SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+# is its recipe's first line if and only if @NMD@ lines are absent.
gl_V_at = $(AM_V_GEN)
## end gnulib module gen-header
@@ -925,7 +927,7 @@ locale.h: locale.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_SETLOCALE''@/$(GL_GNULIB_SETLOCALE)/g' \
-e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_GNULIB_SETLOCALE_NULL)/g' \
-e 's/@''GNULIB_DUPLOCALE''@/$(GL_GNULIB_DUPLOCALE)/g' \
- -e 's/@''GNULIB_LOCALENAME''@/$(GL_GNULIB_LOCALENAME)/g' \
+ -e
's/@''GNULIB_LOCALENAME_UNSAFE''@/$(GL_GNULIB_LOCALENAME_UNSAFE)/g' \
-e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
-e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
-e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
@@ -1210,6 +1212,14 @@ EXTRA_DIST += windows-initguard.h
## end gnulib module nl_langinfo
+## begin gnulib module once
+
+if gl_GNULIB_ENABLED_once
+libgnu_a_SOURCES += glthread/once.h glthread/once.c
+
+endif
+## end gnulib module once
+
## begin gnulib module open
if gl_GNULIB_ENABLED_open
@@ -1229,6 +1239,167 @@ EXTRA_DIST += pathmax.h
## end gnulib module pathmax
+## begin gnulib module pthread-h
+
+if gl_GNULIB_ENABLED_94ea50e7ff7c2508f8a5894b17b1211c
+BUILT_SOURCES += pthread.h
+
+# We need the following in order to create <pthread.h> when the system
+# doesn't have one that works with the given compiler.
+pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H)
$(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \
+ -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GL_GNULIB_PTHREAD_THREAD)/g' \
+ -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GL_GNULIB_PTHREAD_ONCE)/g' \
+ -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GL_GNULIB_PTHREAD_MUTEX)/g' \
+ -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GL_GNULIB_PTHREAD_RWLOCK)/g' \
+ -e 's/@''GNULIB_PTHREAD_COND''@/$(GL_GNULIB_PTHREAD_COND)/g' \
+ -e 's/@''GNULIB_PTHREAD_TSS''@/$(GL_GNULIB_PTHREAD_TSS)/g' \
+ -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GL_GNULIB_PTHREAD_SPIN)/g' \
+ -e
's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GL_GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g'
\
+ -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \
+ -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g'
\
+ -e
's|@''HAVE_PTHREAD_CREATE_DETACHED''@|$(HAVE_PTHREAD_CREATE_DETACHED)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEX_RECURSIVE''@|$(HAVE_PTHREAD_MUTEX_RECURSIVE)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEX_ROBUST''@|$(HAVE_PTHREAD_MUTEX_ROBUST)|g' \
+ -e
's|@''HAVE_PTHREAD_PROCESS_SHARED''@|$(HAVE_PTHREAD_PROCESS_SHARED)|g' \
+ -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \
+ -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g'
\
+ -e
's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g'
\
+ -e
's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \
+ -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \
+ -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \
+ -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \
+ -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \
+ -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \
+ < $(srcdir)/pthread.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \
+ -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g'
\
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g'
\
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g'
\
+ -e
's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \
+ -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g'
\
+ -e
's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \
+ -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \
+ -e
's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \
+ -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \
+ -e
's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \
+ -e
's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \
+ -e
's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \
+ -e
's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \
+ -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g'
\
+ -e
's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \
+ -e
's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \
+ -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g'
\
+ -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \
+ -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \
+ -e
's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \
+ -e
's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g'
\
+ -e
's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g'
\
+ -e
's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \
+ -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \
+ -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \
+ -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \
+ -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \
+ -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \
+ -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g'
\
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g'
\
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g'
\
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g'
\
+ -e
's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g'
\
+ -e
's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g'
\
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g'
\
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g'
\
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g'
\
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g'
\
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \
+ < $@-t2 > $@-t3
+ $(AM_V_at)sed \
+ -e
's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g'
\
+ -e
's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \
+ -e
's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \
+ -e
's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \
+ -e
's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \
+ -e
's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \
+ -e
's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \
+ -e
's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \
+ -e
's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \
+ -e
's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \
+ -e
's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $@-t3 > $@-t4
+ $(AM_V_at)rm -f $@-t1 $@-t2 $@-t3
+ $(AM_V_at)mv $@-t4 $@
+MOSTLYCLEANFILES += pthread.h pthread.h-t1 pthread.h-t2 pthread.h-t3
pthread.h-t4
+
+endif
+EXTRA_DIST += pthread.in.h
+
+## end gnulib module pthread-h
+
+## begin gnulib module pthread-once
+
+if gl_GNULIB_ENABLED_e0dc424e76447be3f4b8566d84038f5a
+if GL_COND_OBJ_PTHREAD_ONCE
+libgnu_a_SOURCES += pthread-once.c
+endif
+
+endif
+## end gnulib module pthread-once
+
## begin gnulib module realloc-gnu
@@ -1267,6 +1438,37 @@ EXTRA_libgnu_a_SOURCES += regcomp.c regex_internal.c
regexec.c
## end gnulib module regex
+## begin gnulib module sched
+
+if gl_GNULIB_ENABLED_sched
+BUILT_SOURCES += sched.h
+
+# We need the following in order to create a replacement for <sched.h> when
+# the system doesn't have one.
+sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \
+ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \
+ -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g'
\
+ -e 's/@''GNULIB_SCHED_YIELD''@/$(GL_GNULIB_SCHED_YIELD)/g' \
+ -e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \
+ -e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sched.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sched.h sched.h-t
+
+endif
+EXTRA_DIST += sched.in.h
+
+## end gnulib module sched
+
## begin gnulib module setlocale-null
if gl_GNULIB_ENABLED_e7e881d32ca02f1c997b13c737c64bbd
@@ -1280,6 +1482,16 @@ EXTRA_DIST += setlocale_null.h windows-initguard.h
## end gnulib module setlocale-null
+## begin gnulib module setlocale-null-unlocked
+
+if gl_GNULIB_ENABLED_e7ab648fbf42deb155fb024e2402e26d
+libgnu_a_SOURCES += setlocale_null-unlocked.c
+
+endif
+EXTRA_DIST += setlocale_null.h
+
+## end gnulib module setlocale-null-unlocked
+
## begin gnulib module size_max
if gl_GNULIB_ENABLED_size_max
@@ -1421,9 +1633,10 @@ stddef.h: stddef.in.h $(top_builddir)/config.status
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
- -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
- -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''NULLPTR_T_NEEDS_STDDEF''@|$(NULLPTR_T_NEEDS_STDDEF)|g' \
+ -e 's|@''STDDEF_NOT_IDEMPOTENT''@|$(STDDEF_NOT_IDEMPOTENT)|g' \
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
$(srcdir)/stddef.in.h > $@-t
$(AM_V_at)mv $@-t $@
else
@@ -1498,6 +1711,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_DZPRINTF''@/$(GL_GNULIB_DZPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
@@ -1518,12 +1732,14 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_FZPRINTF''@/$(GL_GNULIB_FZPRINTF)/g' \
-e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
-e
's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e
's/@''GNULIB_OBSTACK_ZPRINTF''@/$(GL_GNULIB_OBSTACK_ZPRINTF)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
@@ -1537,20 +1753,29 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SNZPRINTF''@/$(GL_GNULIB_SNZPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
-e
's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
-e
's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SZPRINTF''@/$(GL_GNULIB_SZPRINTF)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VASZPRINTF''@/$(GL_GNULIB_VASZPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VDZPRINTF''@/$(GL_GNULIB_VDZPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFZPRINTF''@/$(GL_GNULIB_VFZPRINTF)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSNZPRINTF''@/$(GL_GNULIB_VSNZPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSZPRINTF''@/$(GL_GNULIB_VSZPRINTF)/g' \
+ -e 's/@''GNULIB_VZPRINTF''@/$(GL_GNULIB_VZPRINTF)/g' \
+ -e 's/@''GNULIB_ZPRINTF''@/$(GL_GNULIB_ZPRINTF)/g' \
-e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
-e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
-e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
@@ -1648,6 +1873,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ABORT_DEBUG''@/$(GL_GNULIB_ABORT_DEBUG)/g' \
-e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
-e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
-e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
@@ -1673,6 +1899,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
-e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
-e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RAND''@/$(GL_GNULIB_RAND)/g' \
-e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
-e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
-e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
@@ -1682,7 +1909,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
-e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STACK_TRACE''@/$(GL_GNULIB_STACK_TRACE)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOF''@/$(GL_GNULIB_STRTOF)/g' \
-e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
-e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
@@ -1735,6 +1964,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
-e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOF''@|$(HAVE_STRTOF)|g' \
-e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
-e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
@@ -1747,6 +1977,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
< $@-t1 > $@-t2
$(AM_V_at)sed \
-e 's|@''REPLACE__EXIT''@|$(REPLACE__EXIT)|g' \
+ -e 's|@''REPLACE_ABORT''@|$(REPLACE_ABORT)|g' \
-e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
-e
's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
-e
's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
@@ -1770,6 +2001,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RAND''@|$(REPLACE_RAND)|g' \
-e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e
's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
@@ -1779,6 +2011,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOF''@|$(REPLACE_STRTOF)|g' \
-e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
-e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
-e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
@@ -1786,6 +2019,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e 's|@''CAN_PRINT_STACK_TRACE''@|$(CAN_PRINT_STACK_TRACE)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -1962,6 +2196,7 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
+ -e 's|@''REPLACE_MEMSET_EXPLICIT''@|$(REPLACE_MEMSET_EXPLICIT)|g'
\
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
@@ -1977,6 +2212,7 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
-e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g'
\
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRVERSCMP''@|$(REPLACE_STRVERSCMP)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -2187,10 +2423,12 @@ sys/types.h: sys_types.in.h
$(top_builddir)/config.status
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''HAVE_OFF64_T''@|$(HAVE_OFF64_T)|g' \
-e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
$(srcdir)/sys_types.in.h > $@-t
$(AM_V_at)mv $@-t $@
MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+MOSTLYCLEANDIRS += sys
EXTRA_DIST += sys_types.in.h
@@ -2240,6 +2478,7 @@ time.h: time.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e
's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
-e 's/@''GNULIB_TIME_R''@/$(GL_GNULIB_TIME_R)/g' \
-e 's/@''GNULIB_TIME_RZ''@/$(GL_GNULIB_TIME_RZ)/g' \
+ -e 's/@''GNULIB_TZNAME''@/$(GL_GNULIB_TZNAME)/g' \
-e 's/@''GNULIB_TZSET''@/$(GL_GNULIB_TZSET)/g' \
-e 's/@''GNULIB_MDA_TZSET''@/$(GL_GNULIB_MDA_TZSET)/g' \
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
@@ -2259,6 +2498,7 @@ time.h: time.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''REPLACE_TIMESPEC_GET''@|$(REPLACE_TIMESPEC_GET)|g' \
+ -e 's|@''REPLACE_TIMESPEC_GETRES''@|$(REPLACE_TIMESPEC_GETRES)|g'
\
-e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
-e
's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g'
\
-e
's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g'
\
@@ -2463,6 +2703,8 @@ unictype.h: unictype.in.h
-e
's/@''GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE)/g'
\
+ -e
's/@''GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE)/g'
\
+ -e
's/@''GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_JOIN_CONTROL_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_JOIN_CONTROL_DLL_VARIABLE)/g'
\
@@ -2494,6 +2736,7 @@ unictype.h: unictype.in.h
-e
's/@''GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE)/g'
\
+ -e
's/@''GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_EMOJI_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_EMOJI_DLL_VARIABLE)/g'
\
@@ -2507,6 +2750,7 @@ unictype.h: unictype.in.h
-e
's/@''GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE)/g'
\
+ -e
's/@''GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE)/g'
\
-e
's/@''GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE''@/$(GL_GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE)/g'
\
@@ -2844,6 +3088,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
-e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
-e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_FDATASYNC''@|$(REPLACE_FDATASYNC)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
@@ -2856,6 +3101,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
-e
's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_GETUSERSHELL''@|$(REPLACE_GETUSERSHELL)|g' \
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -3017,6 +3263,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
-e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
-e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_WGETCWD''@/$(GL_GNULIB_WGETCWD)/g' \
-e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
< $(srcdir)/wchar.in.h > $@-t1
diff --git a/gnulib/lib/_Noreturn.h b/gnulib/lib/_Noreturn.h
index 6ecea98b54..9806f2b1a0 100644
--- a/gnulib/lib/_Noreturn.h
+++ b/gnulib/lib/_Noreturn.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that a function does not return.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -34,7 +34,7 @@
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
- && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __clang__
\
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))))
diff --git a/gnulib/lib/alloca.in.h b/gnulib/lib/alloca.in.h
index a1bb3d758d..6aa47df8ec 100644
--- a/gnulib/lib/alloca.in.h
+++ b/gnulib/lib/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/arg-nonnull.h b/gnulib/lib/arg-nonnull.h
index 9498ae1f7d..46c711ca1a 100644
--- a/gnulib/lib/arg-nonnull.h
+++ b/gnulib/lib/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/gnulib/lib/argz.c b/gnulib/lib/argz.c
index c2b6307276..2f27fca2a5 100644
--- a/gnulib/lib/argz.c
+++ b/gnulib/lib/argz.c
@@ -1,5 +1,5 @@
/* Functions for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2023 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2024 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gnulib/lib/argz.in.h b/gnulib/lib/argz.in.h
index 3ba80a69ec..e37a1fd306 100644
--- a/gnulib/lib/argz.in.h
+++ b/gnulib/lib/argz.in.h
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2000, 2004, 2007, 2009-2023 Free Software Foundation,
+ Copyright (C) 1995-2000, 2004, 2007, 2009-2024 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
@@ -24,6 +24,11 @@
#include <errno.h>
#include <string.h> /* Need size_t. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifndef __error_t_defined
typedef int error_t;
#endif
@@ -127,4 +132,8 @@ extern char *argz_next (const char *restrict /*argz*/,
size_t /*argz_len*/,
const char *restrict /*entry*/);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* argz.h */
diff --git a/gnulib/lib/asnprintf.c b/gnulib/lib/asnprintf.c
index f4861bf845..a6c09bc205 100644
--- a/gnulib/lib/asnprintf.c
+++ b/gnulib/lib/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/asprintf.c b/gnulib/lib/asprintf.c
index ba58e06481..b0c334788a 100644
--- a/gnulib/lib/asprintf.c
+++ b/gnulib/lib/asprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2007, 2009-2023 Free Software Foundation,
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/assert.in.h b/gnulib/lib/assert.in.h
index b0ab99c776..6e4995e145 100644
--- a/gnulib/lib/assert.in.h
+++ b/gnulib/lib/assert.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <assert.h>
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/attribute.h b/gnulib/lib/attribute.h
index e4e36092b0..186faa5526 100644
--- a/gnulib/lib/attribute.h
+++ b/gnulib/lib/attribute.h
@@ -1,6 +1,6 @@
/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
- Copyright 2020-2023 Free Software Foundation, Inc.
+ Copyright 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,12 +20,49 @@
/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
macros used within Gnulib. */
-/* These attributes can be placed in two ways:
- - At the start of a declaration (i.e. even before storage-class
- specifiers!); then they apply to all entities that are declared
- by the declaration.
- - Immediately after the name of an entity being declared by the
- declaration; then they apply to that entity only. */
+/* The placement of these attributes depends on the kind of declaration
+ and, in some cases, also on the programming language (C vs. C++).
+
+ In function declarations and function definitions:
+
+ * ATTRIBUTE_NOTHROW must come after the parameter list.
+
+ * The macros
+ ATTRIBUTE_CONST
+ ATTRIBUTE_PURE
+ DEPRECATED
+ MAYBE_UNUSED
+ NODISCARD
+ REPRODUCIBLE
+ UNSEQUENCED
+ must come before the return type, and more precisely:
+ - In a function declaration/definition without a storage-class
+ specifier: at the beginning of the declaration/definition.
+ - In a function declaration/definition with a storage-class
+ specifier:
+ - In C: before the storage-class specifier.
+ - In C++: between the storage-class specifier and the return type.
+
+ * The other macros can be placed
+ - Either
+ - In a function declaration/definition without a storage-class
+ specifier: at the beginning of the declaration/definition.
+ - In a function declaration/definition with a storage-class
+ specifier: between the storage-class specifier and the return
+ type.
+ - Or after the parameter list,
+ ∙ but after ATTRIBUTE_NOTHROW if present.
+
+ In other declarations, such as variable declarations:
+
+ * Either
+ - In C: before the storage-class specifier.
+ - In C++: between the storage-class specifier and the return type.
+ Then they apply to all entities that are declared by the declaration.
+
+ * Or immediately after the name of an entity being declared by the
+ declaration. Then they apply to that entity only.
+ */
#ifndef _GL_ATTRIBUTE_H
#define _GL_ATTRIBUTE_H
@@ -49,8 +86,9 @@
_GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED,
_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL,
_GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED,
- _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL,
- _GL_ATTRIBUTE_SENTINEL. */
+ _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL, _GL_ATTRIBUTE_SENTINEL,
+ _GL_ATTRIBUTE_UNSEQUENCED. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -88,7 +126,7 @@
is the size of the returned memory block.
ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
to determine the size of the returned memory block. */
-/* Applies to: function, pointer to function, function types. */
+/* Applies to: functions, pointer to functions, function types. */
#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
/* ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
@@ -170,7 +208,7 @@
/* Attributes regarding debugging information emitted by the compiler. */
/* Omit the function from stack traces when debugging. */
-/* Applies to: function. */
+/* Applies to: functions. */
#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */
@@ -192,25 +230,64 @@
/* Always inline the function, and report an error if the compiler
cannot inline. */
-/* Applies to: function. */
+/* Applies to: functions. */
#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
-/* It is OK for a compiler to omit duplicate calls with the same arguments.
+/* It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used.
This attribute is safe for a function that neither depends on
- nor affects observable state, and always returns exactly once -
- e.g., does not loop forever, and does not call longjmp.
- (This attribute is stricter than ATTRIBUTE_PURE.) */
+ nor affects state, and always returns exactly once -
+ e.g., does not raise an exception, call longjmp, or loop forever.
+ (This attribute is stricter than ATTRIBUTE_PURE because the
+ function cannot observe state. It is stricter than UNSEQUENCED
+ because the function must return exactly once and cannot depend on
+ state addressed by its arguments.) */
/* Applies to: functions. */
#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
-/* It is OK for a compiler to omit duplicate calls with the same
- arguments if observable state is not changed between calls.
- This attribute is safe for a function that does not affect
- observable state, and always returns exactly once.
- (This attribute is looser than ATTRIBUTE_CONST.) */
+/* It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same.
+ This attribute is safe for a function that is effectless, idempotent,
+ stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of
+ these terms.
+ (This attribute is stricter than REPRODUCIBLE because the function
+ must be stateless and independent. It is looser than ATTRIBUTE_CONST
+ because the function need not return exactly once and can depend
+ on state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function type. */
+#define UNSEQUENCED _GL_ATTRIBUTE_UNSEQUENCED
+
+/* It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used, and if observable state is the same.
+ This attribute is safe for a function that does not affect observable state
+ and always returns exactly once.
+ (This attribute is looser than ATTRIBUTE_CONST because the function
+ can depend on observable state. It is stricter than REPRODUCIBLE
+ because the function must return exactly once and cannot affect
+ state addressed by its arguments.) */
/* Applies to: functions. */
#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+/* It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same and is updated in time for
+ the rest of the program.
+ This attribute is safe for a function that is effectless and idempotent; see
+ ISO C 23 § 6.7.12.7 for a definition of these terms.
+ (This attribute is looser than UNSEQUENCED because the function need
+ not be stateless and idempotent. It is looser than ATTRIBUTE_PURE
+ because the function need not return exactly once and can affect
+ state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function type. */
+#define REPRODUCIBLE _GL_ATTRIBUTE_REPRODUCIBLE
+
/* The function is rarely executed. */
/* Applies to: functions. */
#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
diff --git a/gnulib/lib/basename-lgpl.c b/gnulib/lib/basename-lgpl.c
index 6de60aa678..256f84609c 100644
--- a/gnulib/lib/basename-lgpl.c
+++ b/gnulib/lib/basename-lgpl.c
@@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name
- Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/basename-lgpl.h b/gnulib/lib/basename-lgpl.h
index c1982fa8eb..2a56be98e2 100644
--- a/gnulib/lib/basename-lgpl.h
+++ b/gnulib/lib/basename-lgpl.h
@@ -1,6 +1,6 @@
/* Extract the last component (base name) of a file name.
- Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/btowc.c b/gnulib/lib/btowc.c
index 13ceab2e90..8bf21aa674 100644
--- a/gnulib/lib/btowc.c
+++ b/gnulib/lib/btowc.c
@@ -1,5 +1,5 @@
/* Convert unibyte character to wide character.
- Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/c++defs.h b/gnulib/lib/c++defs.h
index 458c014de5..7082af3fc2 100644
--- a/gnulib/lib/c++defs.h
+++ b/gnulib/lib/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -93,11 +93,22 @@
# define _GL_EXTERN_C extern
#endif
-/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+/* _GL_EXTERN_C_FUNC declaration;
+ performs the declaration of a function with C linkage. */
+#if defined __cplusplus
+# define _GL_EXTERN_C_FUNC extern "C"
+#else
+/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
+ are not allowed between 'extern' and the return type (see gnulib-common.m4).
+ */
+# define _GL_EXTERN_C_FUNC
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
- _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
@@ -105,21 +116,27 @@
because
[[...]] extern "C" <declaration>;
is invalid syntax in C++.)
+
+ Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
+ of the _GL_FUNCDECL_RPL invocation, at the end of the declaration.
*/
-#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
- _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
-#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
- _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
+ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
+ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
-/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
- _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
+
+ Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
+ of the _GL_FUNCDECL_SYS invocation, at the end of the declaration.
*/
-#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
- _GL_EXTERN_C rettype func parameters_and_attributes
+#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
+ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
/* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
@@ -297,7 +314,7 @@
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func
# else
diff --git a/gnulib/lib/c32is-impl.h b/gnulib/lib/c32is-impl.h
index fd916341ee..9e9802583f 100644
--- a/gnulib/lib/c32is-impl.h
+++ b/gnulib/lib/c32is-impl.h
@@ -1,5 +1,5 @@
/* Test whether a 32-bit wide character belongs to a specific character class.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -57,7 +57,7 @@ FUNC (wint_t wc)
else
return 0;
-#elif HAVE_WORKING_MBRTOC32 /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
/* mbrtoc32() is essentially defined by the system libc. */
# if _GL_WCHAR_T_IS_UCS4
diff --git a/gnulib/lib/c32isalnum.c b/gnulib/lib/c32isalnum.c
index 21ae6ceb63..6335af6de4 100644
--- a/gnulib/lib/c32isalnum.c
+++ b/gnulib/lib/c32isalnum.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being alphanumeric.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isalpha.c b/gnulib/lib/c32isalpha.c
index 3bc13d8302..ea43be56b5 100644
--- a/gnulib/lib/c32isalpha.c
+++ b/gnulib/lib/c32isalpha.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being alphabetic.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isblank.c b/gnulib/lib/c32isblank.c
index bb5ca5d38a..ee06d3d05b 100644
--- a/gnulib/lib/c32isblank.c
+++ b/gnulib/lib/c32isblank.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being blank.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32iscntrl.c b/gnulib/lib/c32iscntrl.c
index 17897abb2a..1f50527bd7 100644
--- a/gnulib/lib/c32iscntrl.c
+++ b/gnulib/lib/c32iscntrl.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being a control character.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isdigit.c b/gnulib/lib/c32isdigit.c
index 71b6402861..4cb99c2a0e 100644
--- a/gnulib/lib/c32isdigit.c
+++ b/gnulib/lib/c32isdigit.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being a digit.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isgraph.c b/gnulib/lib/c32isgraph.c
index 0c90be5fc3..407d6d1a24 100644
--- a/gnulib/lib/c32isgraph.c
+++ b/gnulib/lib/c32isgraph.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being graphic.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32islower.c b/gnulib/lib/c32islower.c
index 88b45a3261..f2bfda7c02 100644
--- a/gnulib/lib/c32islower.c
+++ b/gnulib/lib/c32islower.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being lowercase.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isprint.c b/gnulib/lib/c32isprint.c
index dd7c0d369f..fd8d7a630a 100644
--- a/gnulib/lib/c32isprint.c
+++ b/gnulib/lib/c32isprint.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being printable.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32ispunct.c b/gnulib/lib/c32ispunct.c
index b14849530e..03d64699f5 100644
--- a/gnulib/lib/c32ispunct.c
+++ b/gnulib/lib/c32ispunct.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being a punctuation or symbol character.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isspace.c b/gnulib/lib/c32isspace.c
index 1e8a7cce22..1449fc4e71 100644
--- a/gnulib/lib/c32isspace.c
+++ b/gnulib/lib/c32isspace.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being white-space.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isupper.c b/gnulib/lib/c32isupper.c
index bfd7e541a3..4b21860314 100644
--- a/gnulib/lib/c32isupper.c
+++ b/gnulib/lib/c32isupper.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being uppercase.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32isxdigit.c b/gnulib/lib/c32isxdigit.c
index 1ede8ab178..133d010360 100644
--- a/gnulib/lib/c32isxdigit.c
+++ b/gnulib/lib/c32isxdigit.c
@@ -1,5 +1,5 @@
/* Test 32-bit wide character for being a hexadecimal digit.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32to-impl.h b/gnulib/lib/c32to-impl.h
index 94ca7bdfb5..32039c612d 100644
--- a/gnulib/lib/c32to-impl.h
+++ b/gnulib/lib/c32to-impl.h
@@ -1,5 +1,5 @@
/* Case mapping of a 32-bit wide character.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -53,7 +53,7 @@ FUNC (wint_t wc)
else
return wc;
-#elif HAVE_WORKING_MBRTOC32 /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
/* mbrtoc32() is essentially defined by the system libc. */
# if _GL_WCHAR_T_IS_UCS4
diff --git a/gnulib/lib/c32tolower.c b/gnulib/lib/c32tolower.c
index 8934f6fe68..52b149b19d 100644
--- a/gnulib/lib/c32tolower.c
+++ b/gnulib/lib/c32tolower.c
@@ -1,5 +1,5 @@
/* Map a 32-bit wide character to lowercase.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/c32width.c b/gnulib/lib/c32width.c
index 1bea29dfba..37ce1a57dc 100644
--- a/gnulib/lib/c32width.c
+++ b/gnulib/lib/c32width.c
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a 32-bit wide character.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -58,7 +58,7 @@ c32width (char32_t wc)
else
return wcwidth (wc);
-#elif HAVE_WORKING_MBRTOC32 /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
/* mbrtoc32() is essentially defined by the system libc. */
# if _GL_WCHAR_T_IS_UCS4
diff --git a/gnulib/lib/calloc.c b/gnulib/lib/calloc.c
index 08843acd28..81dfd3efb5 100644
--- a/gnulib/lib/calloc.c
+++ b/gnulib/lib/calloc.c
@@ -1,6 +1,6 @@
/* calloc() function that is glibc compatible.
This wrapper function is required at least on Tru64 UNIX 5.1 and mingw.
- Copyright (C) 2004-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2004-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/cdefs.h b/gnulib/lib/cdefs.h
index 412f036ce3..9c49eeb413 100644
--- a/gnulib/lib/cdefs.h
+++ b/gnulib/lib/cdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
Copyright The GNU Toolchain Authors.
This file is part of the GNU C Library.
@@ -42,8 +42,8 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
- : 3 < __clang_major__ + (5 <= __clang_minor__))))
+ ? 7000000 <= __apple_build_version__ \
+ : 5 <= __clang_major__)))
# define __glibc_has_attribute(attr) __has_attribute (attr)
#else
# define __glibc_has_attribute(attr) 0
@@ -83,7 +83,7 @@
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
# else
-# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
# if __cplusplus >= 201103L
# define __THROW noexcept (true)
# else
diff --git a/gnulib/lib/cloexec.c b/gnulib/lib/cloexec.c
index e4cecbd2e8..cdb0d740eb 100644
--- a/gnulib/lib/cloexec.c
+++ b/gnulib/lib/cloexec.c
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 1991, 2004-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2004-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/cloexec.h b/gnulib/lib/cloexec.h
index 057fd668c9..a7944d6dd5 100644
--- a/gnulib/lib/cloexec.h
+++ b/gnulib/lib/cloexec.h
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 2004, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -15,6 +15,11 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
or clear the flag if VALUE is false.
Return 0 on success, or -1 on error with 'errno' set.
@@ -32,3 +37,8 @@ int set_cloexec_flag (int desc, bool value);
be duplicated. */
int dup_cloexec (int fd);
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gnulib/lib/close.c b/gnulib/lib/close.c
index 3c1b09ea52..830fd82081 100644
--- a/gnulib/lib/close.c
+++ b/gnulib/lib/close.c
@@ -1,5 +1,5 @@
/* close replacement.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/dirname-lgpl.c b/gnulib/lib/dirname-lgpl.c
index e9454af397..8333c0ebad 100644
--- a/gnulib/lib/dirname-lgpl.c
+++ b/gnulib/lib/dirname-lgpl.c
@@ -1,6 +1,6 @@
/* dirname.c -- return all but the last element in a file name
- Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/dirname.h b/gnulib/lib/dirname.h
index 0344f1c44c..33935ba937 100644
--- a/gnulib/lib/dirname.h
+++ b/gnulib/lib/dirname.h
@@ -1,6 +1,6 @@
/* Take file names apart into directory and base names.
- Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/dup2.c b/gnulib/lib/dup2.c
index 7d197ca312..916e113dd8 100644
--- a/gnulib/lib/dup2.c
+++ b/gnulib/lib/dup2.c
@@ -1,6 +1,6 @@
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/dynarray.h b/gnulib/lib/dynarray.h
index 9155910934..8940e81b25 100644
--- a/gnulib/lib/dynarray.h
+++ b/gnulib/lib/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright 2021-2023 Free Software Foundation, Inc.
+ Copyright 2021-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/errno.in.h b/gnulib/lib/errno.in.h
index 3dda9c260e..18eb8a0c58 100644
--- a/gnulib/lib/errno.in.h
+++ b/gnulib/lib/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -133,7 +133,7 @@
/* These are intentionally the same values as the WSA* error numbers, defined
in <winsock2.h>. */
-# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
+# define ESOCKTNOSUPPORT 10044
# define EPFNOSUPPORT 10046 /* not required by POSIX */
# define ESHUTDOWN 10058 /* not required by POSIX */
# define ETOOMANYREFS 10059 /* not required by POSIX */
@@ -270,10 +270,17 @@
# define GNULIB_defined_ENOTRECOVERABLE 1
# endif
+/* On LynxOS, the macro EILSEQ is not defined. */
# ifndef EILSEQ
# define EILSEQ 2015
# define GNULIB_defined_EILSEQ 1
# endif
+/* On Haiku, the macro ESOCKTNOSUPPORT is not defined. */
+# ifndef ESOCKTNOSUPPORT
+# define ESOCKTNOSUPPORT 2016
+# define GNULIB_defined_ESOCKTNOSUPPORT 1
+# endif
+
#endif /* _@GUARD_PREFIX@_ERRNO_H */
#endif /* _@GUARD_PREFIX@_ERRNO_H */
diff --git a/gnulib/lib/error.c b/gnulib/lib/error.c
index 9e26391e98..837d5e56c6 100644
--- a/gnulib/lib/error.c
+++ b/gnulib/lib/error.c
@@ -1,28 +1,35 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1990-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- This file is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
- This file is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#if !_LIBC
# include <config.h>
# define _GL_NO_INLINE_ERROR
+# define __error_internal(status, err, fmt, args, flags) \
+ verror (status, err, fmt, args)
+# define __error_at_line_internal(status, err, file, line, fmt, args, flags) \
+ verror_at_line (status, err, file, line, fmt, args)
+# define error_tail(status, err, fmt, args, flags) \
+ error_tail (status, err, fmt, args)
#endif
-#include "error.h"
+#include <error.h>
#include <stdarg.h>
#include <stdio.h>
@@ -85,7 +92,7 @@ extern void __error_at_line (int status, int errnum, const
char *file_name,
# undef putc
# define putc(c, fp) _IO_putc (c, fp)
-# include <bits/libc-lock.h>
+# include <libc-lock.h>
#else /* not _LIBC */
@@ -123,6 +130,13 @@ int strerror_r (int errnum, char *buf, size_t buflen);
# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
# define __strerror_r strerror_r
# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
+
+# if GNULIB_defined_verror
+# undef verror
+# endif
+# if GNULIB_defined_verror_at_line
+# undef verror_at_line
+# endif
#endif /* not _LIBC */
#if !_LIBC
@@ -202,75 +216,19 @@ print_errno_message (int errnum)
}
static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))
-error_tail (int status, int errnum, const char *message, va_list args)
+error_tail (int status, int errnum, const char *message, va_list args,
+ unsigned int mode_flags)
{
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- {
- size_t len = strlen (message) + 1;
- wchar_t *wmessage = NULL;
- mbstate_t st;
- size_t res;
- const char *tmp;
- bool use_malloc = false;
-
- while (1)
- {
- if (__libc_use_alloca (len * sizeof (wchar_t)))
- wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
- else
- {
- if (!use_malloc)
- wmessage = NULL;
-
- wchar_t *p = (wchar_t *) realloc (wmessage,
- len * sizeof (wchar_t));
- if (p == NULL)
- {
- free (wmessage);
- fputws_unlocked (L"out of memory\n", stderr);
- return;
- }
- wmessage = p;
- use_malloc = true;
- }
-
- memset (&st, '\0', sizeof (st));
- tmp = message;
-
- res = mbsrtowcs (wmessage, &tmp, len, &st);
- if (res != len)
- break;
-
- if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
- {
- /* This really should not happen if everything is fine. */
- res = (size_t) -1;
- break;
- }
-
- len *= 2;
- }
-
- if (res == (size_t) -1)
- {
- /* The string cannot be converted. */
- if (use_malloc)
- {
- free (wmessage);
- use_malloc = false;
- }
- wmessage = (wchar_t *) L"???";
- }
-
- __vfwprintf (stderr, wmessage, args);
-
- if (use_malloc)
- free (wmessage);
- }
- else
+ int ret = __vfxprintf (stderr, message, args, mode_flags);
+ if (ret < 0 && errno == ENOMEM && _IO_fwide (stderr, 0) > 0)
+ /* Leave a trace in case the heap allocation of the message string
+ failed. */
+ fputws_unlocked (L"out of memory\n", stderr);
+#else
+ vfprintf (stderr, message, args);
#endif
- vfprintf (stderr, message, args);
+ va_end (args);
++error_message_count;
if (errnum)
@@ -291,16 +249,14 @@ error_tail (int status, int errnum, const char *message,
va_list args)
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
void
-error (int status, int errnum, const char *message, ...)
+__error_internal (int status, int errnum, const char *message,
+ va_list args, unsigned int mode_flags)
{
- va_list args;
-
-#if defined _LIBC && defined __libc_ptf_call
+#if defined _LIBC
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
+ __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
#endif
flush_stdout ();
@@ -318,28 +274,32 @@ error (int status, int errnum, const char *message, ...)
#endif
}
- va_start (args, message);
- error_tail (status, errnum, message, args);
- va_end (args);
+ error_tail (status, errnum, message, args, mode_flags);
#ifdef _LIBC
_IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
+ __pthread_setcancelstate (state, NULL);
#endif
}
+
+void
+error (int status, int errnum, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ __error_internal (status, errnum, message, ap, 0);
+ va_end (ap);
+}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
-error_at_line (int status, int errnum, const char *file_name,
- unsigned int line_number, const char *message, ...)
+__error_at_line_internal (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message,
+ va_list args, unsigned int mode_flags)
{
- va_list args;
-
if (error_one_per_line)
{
static const char *old_file_name;
@@ -358,12 +318,11 @@ error_at_line (int status, int errnum, const char
*file_name,
old_line_number = line_number;
}
-#if defined _LIBC && defined __libc_ptf_call
+#if defined _LIBC
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
+ __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
#endif
flush_stdout ();
@@ -389,18 +348,25 @@ error_at_line (int status, int errnum, const char
*file_name,
file_name, line_number);
#endif
- va_start (args, message);
- error_tail (status, errnum, message, args);
- va_end (args);
+ error_tail (status, errnum, message, args, mode_flags);
#ifdef _LIBC
_IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
+ __pthread_setcancelstate (state, NULL);
#endif
}
+void
+error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ __error_at_line_internal (status, errnum, file_name, line_number,
+ message, ap, 0);
+ va_end (ap);
+}
+
#ifdef _LIBC
/* Make the weak alias. */
# undef error
diff --git a/gnulib/lib/error.in.h b/gnulib/lib/error.in.h
index 61f98c5216..4804c8c465 100644
--- a/gnulib/lib/error.in.h
+++ b/gnulib/lib/error.in.h
@@ -1,5 +1,5 @@
/* Declarations for error-reporting functions.
- Copyright (C) 1995-1997, 2003, 2006, 2008-2023 Free Software Foundation,
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2024 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
@@ -23,19 +23,22 @@
or error_at_line(...) invocations. */
/* The include_next requires a split double-inclusion guard. */
-#if @HAVE_ERROR_H@
+#if @HAVE_ERROR_H@ && !defined __MINGW32__
# @INCLUDE_NEXT@ @NEXT_ERROR_H@
#endif
#ifndef _@GUARD_PREFIX@_ERROR_H
#define _@GUARD_PREFIX@_ERROR_H
-/* This file uses _GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_FORMAT,
- _GL_ATTRIBUTE_MAYBE_UNUSED. */
+/* This file uses _GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_COLD,
+ _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_MAYBE_UNUSED. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+/* Get va_list. */
+#include <stdarg.h>
+
/* Get 'unreachable'. */
#include <stddef.h>
@@ -92,7 +95,8 @@ extern "C" {
# define error rpl_error
# endif
_GL_FUNCDECL_RPL (error, void,
- (int __status, int __errnum, const char *__format, ...)
+ (int __status, int __errnum, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3,
4)));
_GL_CXXALIAS_RPL (error, void,
(int __status, int __errnum, const char *__format, ...));
@@ -104,7 +108,8 @@ _GL_CXXALIAS_RPL (error, void,
#else
# if ! @HAVE_ERROR@
_GL_FUNCDECL_SYS (error, void,
- (int __status, int __errnum, const char *__format, ...)
+ (int __status, int __errnum, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3,
4)));
# endif
_GL_CXXALIAS_SYS (error, void,
@@ -117,7 +122,7 @@ _GL_CXXALIAS_SYS (error, void,
# pragma GCC diagnostic ignored "-Wattributes"
_GL_ATTRIBUTE_MAYBE_UNUSED
static void
-_GL_ATTRIBUTE_ALWAYS_INLINE
+_GL_ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4))
_gl_inline_error (int __status, int __errnum, const char *__format, ...)
{
@@ -147,7 +152,8 @@ _GL_CXXALIASWARN (error);
# endif
_GL_FUNCDECL_RPL (error_at_line, void,
(int __status, int __errnum, const char *__filename,
- unsigned int __lineno, const char *__format, ...)
+ unsigned int __lineno, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5,
6)));
_GL_CXXALIAS_RPL (error_at_line, void,
(int __status, int __errnum, const char *__filename,
@@ -161,7 +167,8 @@ _GL_CXXALIAS_RPL (error_at_line, void,
# if ! @HAVE_ERROR_AT_LINE@
_GL_FUNCDECL_SYS (error_at_line, void,
(int __status, int __errnum, const char *__filename,
- unsigned int __lineno, const char *__format, ...)
+ unsigned int __lineno, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5,
6)));
# endif
_GL_CXXALIAS_SYS (error_at_line, void,
@@ -175,7 +182,7 @@ _GL_CXXALIAS_SYS (error_at_line, void,
# pragma GCC diagnostic ignored "-Wattributes"
_GL_ATTRIBUTE_MAYBE_UNUSED
static void
-_GL_ATTRIBUTE_ALWAYS_INLINE
+_GL_ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6))
_gl_inline_error_at_line (int __status, int __errnum, const char *__filename,
unsigned int __lineno, const char *__format, ...)
@@ -196,6 +203,44 @@ _gl_inline_error_at_line (int __status, int __errnum,
const char *__filename,
#endif
_GL_CXXALIASWARN (error_at_line);
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ Use the globals error_print_progname and error_message_count similarly
+ to error(). */
+
+extern void verror (int __status, int __errnum, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_COLD
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
+#ifndef _GL_NO_INLINE_ERROR
+# ifndef verror
+# define verror(status, ...) \
+ __gl_error_call (verror, status, __VA_ARGS__)
+# define GNULIB_defined_verror 1
+# endif
+#endif
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ If FNAME is not NULL, prepend the message with "FNAME:LINENO:".
+ Use the globals error_print_progname, error_message_count, and
+ error_one_per_line similarly to error_at_line(). */
+
+extern void verror_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_COLD
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 0));
+#ifdef _GL_NO_INLINE_ERROR
+# ifndef verror_at_line
+# define verror_at_line(status, ...) \
+ __gl_error_call (verror_at_line, status, __VA_ARGS__)
+# define GNULIB_defined_verror_at_line 1
+# endif
+#endif
+
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
diff --git a/gnulib/lib/exitfail.c b/gnulib/lib/exitfail.c
index d67a130c05..8a5962e82f 100644
--- a/gnulib/lib/exitfail.c
+++ b/gnulib/lib/exitfail.c
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/exitfail.h b/gnulib/lib/exitfail.h
index 85a6af64ad..fa264b5c8c 100644
--- a/gnulib/lib/exitfail.h
+++ b/gnulib/lib/exitfail.h
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -15,4 +15,14 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern int volatile exit_failure;
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gnulib/lib/fcntl.c b/gnulib/lib/fcntl.c
index e220800845..7cd3a0f976 100644
--- a/gnulib/lib/fcntl.c
+++ b/gnulib/lib/fcntl.c
@@ -1,6 +1,6 @@
/* Provide file descriptor control.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/fcntl.in.h b/gnulib/lib/fcntl.in.h
index d0bb85f30b..8b8274295a 100644
--- a/gnulib/lib/fcntl.in.h
+++ b/gnulib/lib/fcntl.in.h
@@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -51,7 +51,8 @@
#ifndef _@GUARD_PREFIX@_FCNTL_H
/* Needed before <sys/stat.h>.
- May also define off_t to a 64-bit type on native Windows. */
+ May also define off_t to a 64-bit type on native Windows.
+ Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
#include <sys/types.h>
/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
<fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
@@ -99,7 +100,7 @@
# undef creat
# define creat rpl_creat
# endif
-_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
+_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -169,7 +170,7 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX
compliant - "
# undef open
# define open rpl_open
# endif
-_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -216,14 +217,14 @@ _GL_CXXALIASWARN (open);
# define openat rpl_openat
# endif
_GL_FUNCDECL_RPL (openat, int,
- (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ (int fd, char const *file, int flags, /* mode_t mode */ ...),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */
...));
# else
# if !@HAVE_OPENAT@
_GL_FUNCDECL_SYS (openat, int,
- (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ (int fd, char const *file, int flags, /* mode_t mode */ ...),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (openat, int,
diff --git a/gnulib/lib/fd-hook.c b/gnulib/lib/fd-hook.c
index 362611507e..75bbe49c92 100644
--- a/gnulib/lib/fd-hook.c
+++ b/gnulib/lib/fd-hook.c
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/fd-hook.h b/gnulib/lib/fd-hook.h
index 6bf3c24da1..2150460bc1 100644
--- a/gnulib/lib/fd-hook.h
+++ b/gnulib/lib/fd-hook.h
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/filename.h b/gnulib/lib/filename.h
index a2400a9dfe..4f0f0fbc3c 100644
--- a/gnulib/lib/filename.h
+++ b/gnulib/lib/filename.h
@@ -1,5 +1,5 @@
/* Basic filename support macros.
- Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/float+.h b/gnulib/lib/float+.h
index e7531e46a3..104f477faa 100644
--- a/gnulib/lib/float+.h
+++ b/gnulib/lib/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/float.c b/gnulib/lib/float.c
index f81ff33d3b..7a563048e2 100644
--- a/gnulib/lib/float.c
+++ b/gnulib/lib/float.c
@@ -1,5 +1,5 @@
/* Auxiliary definitions for <float.h>.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
@@ -20,14 +20,101 @@
/* Specification. */
#include <float.h>
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined
__linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+#if GNULIB_defined_long_double_union
+# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined
__linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
const union gl_long_double_union gl_LDBL_MAX =
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
-#elif defined __i386__
+# elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
-#else
+# endif
+# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* We can't even simply evaluate the formula (LDBL_MIN /
9223372036854775808.0L)
+ at run time, because it would require BEGIN_LONG_DOUBLE_ROUNDING /
+ END_LONG_DOUBLE_ROUNDING invocations. It simpler to just write down the
+ representation of LDBL_TRUE_MIN, based on
+
<https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>.
*/
+const union gl_long_double_union gl_LDBL_TRUE_MIN =
+ { { 0x00000001, 0x00000000, 0 } };
+# endif
+#endif
+
+#if GNULIB_defined_FLT_SNAN
+/* Define like memory_positive_SNaNf(), see signed-snan.h and snan.h,
+ or like setpayloadsigf() with an arbitrary payload. */
+gl_FLT_SNAN_t gl_FLT_SNAN =
+# if FLT_MANT_DIG == 24
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 8 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FE00000U } }
+# else
+ /* sign bit: 0, 8 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FA00000U } }
+# endif
+# endif
+ ;
+#endif
+
+#if GNULIB_defined_DBL_SNAN
+/* Define like memory_positive_SNaNd(), see signed-snan.h and snan.h,
+ or like setpayloadsig() with an arbitrary payload. */
+gl_DBL_SNAN_t gl_DBL_SNAN =
+# if DBL_MANT_DIG == 53
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FFC000000000000ULL } }
+# else
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FF4000000000000ULL } }
+# endif
+# endif
+ ;
+#endif
+
+#if GNULIB_defined_LDBL_SNAN
+# ifdef WORDS_BIGENDIAN
+# define TWO(hi,lo) { hi, lo }
+# else
+# define TWO(hi,lo) { lo, hi }
+# endif
+/* Define like memory_positive_SNaNl(), see signed-snan.h and snan.h,
+ or like setpayloadsigl() with an arbitrary payload. */
+gl_LDBL_SNAN_t gl_LDBL_SNAN =
+# if LDBL_MANT_DIG == 53 /* on arm, hppa, mips, sh, but also MSVC */
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FFC000000000000ULL } }
+# else
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FF4000000000000ULL } }
+# endif
+# elif LDBL_MANT_DIG == 64 /* on i386, x86_64, ia64, m68k */
+# if defined __m68k__
+ /* sign bit: 0, 15 exponent bits: all 1, 16 gap bits: all 0,
+ always=1 bit: 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FFF0000ULL, 0xA0000000ULL, 0x00000000ULL } }
+# else
+ /* sign bit: 0, 15 exponent bits: all 1, always=1 bit: 1, next bit: 0,
payload: 0b10...0
+ (see
<https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>)
*/
+ { TWO (0x00007FFFULL, 0xA000000000000000ULL) }
+# endif
+# elif LDBL_MANT_DIG == 106 /* on powerpc, powerpc64, powerpc64le */
+ /* most-significant double:
+ sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0,
+ least-significant double: 0.0 */
+ { { 0x7FF4000000000000ULL, 0ULL } }
+# elif LDBL_MANT_DIG == 113 /* on alpha, arm64, loongarch64, mips64, riscv64,
s390x, sparc64 */
+# if (defined __mips__ && !MIPS_NAN2008_FLOAT)
+ /* sign bit: 0, 15 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { TWO (0x7FFFC00000000000ULL, 0ULL) }
+# else
+ /* sign bit: 0, 15 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { TWO (0x7FFF400000000000ULL, 0ULL) }
+# endif
+# endif
+ ;
+#endif
+
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
-#endif
diff --git a/gnulib/lib/float.in.h b/gnulib/lib/float.in.h
index bf2c502c7f..5e78b4f296 100644
--- a/gnulib/lib/float.in.h
+++ b/gnulib/lib/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -28,6 +28,8 @@
#ifndef _@GUARD_PREFIX@_FLOAT_H
#define _@GUARD_PREFIX@_FLOAT_H
+/* ============================ ISO C99 support ============================ */
+
/* 'long double' properties. */
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
@@ -179,6 +181,156 @@ extern const union gl_long_double_union gl_LDBL_MAX;
# endif
#endif
+/* ============================ ISO C11 support ============================ */
+
+/* 'float' properties */
+
+#ifndef FLT_HAS_SUBNORM
+# define FLT_HAS_SUBNORM 1
+#endif
+#ifndef FLT_DECIMAL_DIG
+/* FLT_MANT_DIG = 24 => FLT_DECIMAL_DIG = 9 */
+# define FLT_DECIMAL_DIG ((int)(FLT_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#if defined _AIX && !defined __GNUC__
+/* On AIX, the value of FLT_TRUE_MIN in /usr/include/float.h is a 'double',
+ not a 'float'. */
+# undef FLT_TRUE_MIN
+#endif
+#ifndef FLT_TRUE_MIN
+/* FLT_MIN / 2^(FLT_MANT_DIG-1) */
+# define FLT_TRUE_MIN (FLT_MIN / 8388608.0f)
+#endif
+
+/* 'double' properties */
+
+#ifndef DBL_HAS_SUBNORM
+# define DBL_HAS_SUBNORM 1
+#endif
+#ifndef DBL_DECIMAL_DIG
+/* DBL_MANT_DIG = 53 => DBL_DECIMAL_DIG = 17 */
+# define DBL_DECIMAL_DIG ((int)(DBL_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#ifndef DBL_TRUE_MIN
+/* DBL_MIN / 2^(DBL_MANT_DIG-1) */
+# define DBL_TRUE_MIN (DBL_MIN / 4503599627370496.0)
+#endif
+
+/* 'long double' properties */
+
+#ifndef LDBL_HAS_SUBNORM
+# define LDBL_HAS_SUBNORM 1
+#endif
+#ifndef LDBL_DECIMAL_DIG
+/* LDBL_MANT_DIG = 53 => LDBL_DECIMAL_DIG = 17 */
+/* LDBL_MANT_DIG = 64 => LDBL_DECIMAL_DIG = 21 */
+/* LDBL_MANT_DIG = 106 => LDBL_DECIMAL_DIG = 33 */
+/* LDBL_MANT_DIG = 113 => LDBL_DECIMAL_DIG = 36 */
+# define LDBL_DECIMAL_DIG ((int)(LDBL_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#ifndef LDBL_TRUE_MIN
+/* LDBL_MIN / 2^(LDBL_MANT_DIG-1) */
+# if LDBL_MANT_DIG == 53
+# define LDBL_TRUE_MIN (LDBL_MIN / 4503599627370496.0L)
+# elif LDBL_MANT_DIG == 64
+# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* Work around FreeBSD/x86 problem mentioned above. */
+extern const union gl_long_double_union gl_LDBL_TRUE_MIN;
+# define LDBL_TRUE_MIN (gl_LDBL_TRUE_MIN.ld)
+# else
+# define LDBL_TRUE_MIN (LDBL_MIN / 9223372036854775808.0L)
+# endif
+# elif LDBL_MANT_DIG == 106
+# define LDBL_TRUE_MIN (LDBL_MIN / 40564819207303340847894502572032.0L)
+# elif LDBL_MANT_DIG == 113
+# define LDBL_TRUE_MIN (LDBL_MIN / 5192296858534827628530496329220096.0L)
+# endif
+#endif
+
+/* ============================ ISO C23 support ============================ */
+
+/* 'float' properties */
+
+#ifndef FLT_IS_IEC_60559
+# if defined __m68k__
+# define FLT_IS_IEC_60559 0
+# else
+# define FLT_IS_IEC_60559 1
+# endif
+#endif
+#ifndef FLT_NORM_MAX
+# define FLT_NORM_MAX FLT_MAX
+#endif
+#ifndef FLT_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define FLT_SNAN __builtin_nansf ("")
+# else
+typedef union { unsigned int word[1]; float value; } gl_FLT_SNAN_t;
+extern gl_FLT_SNAN_t gl_FLT_SNAN;
+# define FLT_SNAN (gl_FLT_SNAN.value)
+# define GNULIB_defined_FLT_SNAN 1
+# endif
+#endif
+
+/* 'double' properties */
+
+#ifndef DBL_IS_IEC_60559
+# if defined __m68k__
+# define DBL_IS_IEC_60559 0
+# else
+# define DBL_IS_IEC_60559 1
+# endif
+#endif
+#ifndef DBL_NORM_MAX
+# define DBL_NORM_MAX DBL_MAX
+#endif
+#ifndef DBL_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define DBL_SNAN __builtin_nans ("")
+# else
+typedef union { unsigned long long word[1]; double value; } gl_DBL_SNAN_t;
+extern gl_DBL_SNAN_t gl_DBL_SNAN;
+# define DBL_SNAN (gl_DBL_SNAN.value)
+# define GNULIB_defined_DBL_SNAN 1
+# endif
+#endif
+
+/* 'long double' properties */
+
+#ifndef LDBL_IS_IEC_60559
+# if defined __m68k__
+# define LDBL_IS_IEC_60559 0
+# elif LDBL_MANT_DIG == 53 || LDBL_MANT_DIG == 113
+# define LDBL_IS_IEC_60559 1
+# else
+# define LDBL_IS_IEC_60559 0
+# endif
+#endif
+#ifndef LDBL_NORM_MAX
+# define LDBL_NORM_MAX LDBL_MAX
+#endif
+#ifndef LDBL_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define LDBL_SNAN __builtin_nansl ("")
+# else
+# if LDBL_MANT_DIG == 53
+typedef union { unsigned long long word[1]; long double value; }
gl_LDBL_SNAN_t;
+# elif defined __m68k__
+typedef union { unsigned int word[3]; long double value; } gl_LDBL_SNAN_t;
+# else
+typedef union { unsigned long long word[2]; long double value; }
gl_LDBL_SNAN_t;
+# endif
+extern gl_LDBL_SNAN_t gl_LDBL_SNAN;
+# define LDBL_SNAN (gl_LDBL_SNAN.value)
+# define GNULIB_defined_LDBL_SNAN 1
+# endif
+#endif
+
+/* ================================= Other ================================= */
+
#if @REPLACE_ITOLD@
/* Pull in a function that fixes the 'int' to 'long double' conversion
of glibc 2.7. */
diff --git a/gnulib/lib/free.c b/gnulib/lib/free.c
index 372a6b0fec..2f0c40ba89 100644
--- a/gnulib/lib/free.c
+++ b/gnulib/lib/free.c
@@ -1,6 +1,6 @@
/* Make free() preserve errno.
- Copyright (C) 2003, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/fstat.c b/gnulib/lib/fstat.c
index 6a235002e1..205d5aab80 100644
--- a/gnulib/lib/fstat.c
+++ b/gnulib/lib/fstat.c
@@ -1,5 +1,5 @@
/* fstat() replacement.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/getdtablesize.c b/gnulib/lib/getdtablesize.c
index ac2d1753a6..762c100b38 100644
--- a/gnulib/lib/getdtablesize.c
+++ b/gnulib/lib/getdtablesize.c
@@ -1,5 +1,5 @@
/* getdtablesize() function: Return maximum possible file descriptor value + 1.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/getopt-cdefs.in.h b/gnulib/lib/getopt-cdefs.in.h
index 1a666ebb7b..a1d304d49e 100644
--- a/gnulib/lib/getopt-cdefs.in.h
+++ b/gnulib/lib/getopt-cdefs.in.h
@@ -1,5 +1,5 @@
/* getopt-on-non-glibc compatibility macros.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
diff --git a/gnulib/lib/getopt-core.h b/gnulib/lib/getopt-core.h
index c5dd49363f..12d09a25c0 100644
--- a/gnulib/lib/getopt-core.h
+++ b/gnulib/lib/getopt-core.h
@@ -1,5 +1,5 @@
/* Declarations for getopt (basic, portable features only).
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
diff --git a/gnulib/lib/getopt-ext.h b/gnulib/lib/getopt-ext.h
index d37c29328b..e4b499d4e8 100644
--- a/gnulib/lib/getopt-ext.h
+++ b/gnulib/lib/getopt-ext.h
@@ -1,5 +1,5 @@
/* Declarations for getopt (GNU extensions).
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
diff --git a/gnulib/lib/getopt-pfx-core.h b/gnulib/lib/getopt-pfx-core.h
index 095e3930fe..78b7816aa4 100644
--- a/gnulib/lib/getopt-pfx-core.h
+++ b/gnulib/lib/getopt-pfx-core.h
@@ -1,5 +1,5 @@
/* getopt (basic, portable features) gnulib wrapper header.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
diff --git a/gnulib/lib/getopt-pfx-ext.h b/gnulib/lib/getopt-pfx-ext.h
index 8578d72530..f001c11e05 100644
--- a/gnulib/lib/getopt-pfx-ext.h
+++ b/gnulib/lib/getopt-pfx-ext.h
@@ -1,5 +1,5 @@
/* getopt (GNU extensions) gnulib wrapper header.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
diff --git a/gnulib/lib/getopt.c b/gnulib/lib/getopt.c
index 1e2441c4af..ea2d1a529c 100644
--- a/gnulib/lib/getopt.c
+++ b/gnulib/lib/getopt.c
@@ -1,5 +1,5 @@
/* Getopt for GNU.
- Copyright (C) 1987-2023 Free Software Foundation, Inc.
+ Copyright (C) 1987-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
@@ -21,7 +21,7 @@
# include <config.h>
#endif
-#include "getopt.h"
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
@@ -223,8 +223,9 @@ process_long_option (int argc, char **argv, const char
*optstring,
{
/* Didn't find an exact match, so look for abbreviations. */
unsigned char *ambig_set = NULL;
- int ambig_malloced = 0;
- int ambig_fallback = 0;
+ /* Use simpler fallback diagnostic if ambig_set == &ambig_fallback. */
+ unsigned char ambig_fallback;
+ void *ambig_malloced = NULL;
int indfound = -1;
for (p = longopts, option_index = 0; p->name; p++, option_index++)
@@ -242,39 +243,42 @@ process_long_option (int argc, char **argv, const char
*optstring,
|| pfound->val != p->val)
{
/* Second or later nonexact match found. */
- if (!ambig_fallback)
+ if (ambig_set != &ambig_fallback)
{
if (!print_errors)
/* Don't waste effort tracking the ambig set if
we're not going to print it anyway. */
- ambig_fallback = 1;
+ ambig_set = &ambig_fallback;
else if (!ambig_set)
{
if (__libc_use_alloca (n_options))
ambig_set = alloca (n_options);
- else if ((ambig_set = malloc (n_options)) == NULL)
- /* Fall back to simpler error message. */
- ambig_fallback = 1;
else
- ambig_malloced = 1;
+ {
+ ambig_malloced = malloc (n_options);
+ /* Fall back to simpler diagnostic if
+ memory allocation fails. */
+ ambig_set = (ambig_malloced ? ambig_malloced
+ : &ambig_fallback);
+ }
- if (ambig_set)
+ if (ambig_set != &ambig_fallback)
{
memset (ambig_set, 0, n_options);
ambig_set[indfound] = 1;
}
}
- if (ambig_set)
+ if (ambig_set && ambig_set != &ambig_fallback)
ambig_set[option_index] = 1;
}
}
}
- if (ambig_set || ambig_fallback)
+ if (ambig_set)
{
if (print_errors)
{
- if (ambig_fallback)
+ if (ambig_set == &ambig_fallback)
fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"),
argv[0], prefix, d->__nextchar);
else
@@ -296,8 +300,7 @@ process_long_option (int argc, char **argv, const char
*optstring,
funlockfile (stderr);
}
}
- if (ambig_malloced)
- free (ambig_set);
+ free (ambig_malloced);
d->__nextchar += strlen (d->__nextchar);
d->optind++;
d->optopt = 0;
@@ -720,7 +723,7 @@ _getopt_internal (int argc, char **argv, const char
*optstring,
return result;
}
-/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt.
+/* glibc gets a LSB-compliant getopt and a POSIX-compliant __posix_getopt.
Standalone applications just get a POSIX-compliant getopt.
POSIX and LSB both require these functions to take 'char *const *argv'
even though this is incorrect (because of the permutation). */
diff --git a/gnulib/lib/getopt.in.h b/gnulib/lib/getopt.in.h
index 0867d365f4..c2411a754f 100644
--- a/gnulib/lib/getopt.in.h
+++ b/gnulib/lib/getopt.in.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library, which supplies a different version of
diff --git a/gnulib/lib/getopt1.c b/gnulib/lib/getopt1.c
index 49323aa8ed..c42d29f8b5 100644
--- a/gnulib/lib/getopt1.c
+++ b/gnulib/lib/getopt1.c
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987-2023 Free Software Foundation, Inc.
+ Copyright (C) 1987-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
@@ -21,7 +21,7 @@
# include <config.h>
#endif
-#include "getopt.h"
+#include <getopt.h>
#include "getopt_int.h"
int
diff --git a/gnulib/lib/getopt_int.h b/gnulib/lib/getopt_int.h
index 4d9e24beeb..c00c0b6940 100644
--- a/gnulib/lib/getopt_int.h
+++ b/gnulib/lib/getopt_int.h
@@ -1,5 +1,5 @@
/* Internal declarations for getopt.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
diff --git a/gnulib/lib/getprogname.c b/gnulib/lib/getprogname.c
index 204855a4a8..392a9a2f98 100644
--- a/gnulib/lib/getprogname.c
+++ b/gnulib/lib/getprogname.c
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ Copyright (C) 2016-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/gnulib/lib/getprogname.h b/gnulib/lib/getprogname.h
index 13314f21e2..bee1c1a21a 100644
--- a/gnulib/lib/getprogname.h
+++ b/gnulib/lib/getprogname.h
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ Copyright (C) 2016-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/gnulib/lib/getrandom.c b/gnulib/lib/getrandom.c
index 19bb3429ba..44283cf181 100644
--- a/gnulib/lib/getrandom.c
+++ b/gnulib/lib/getrandom.c
@@ -1,6 +1,6 @@
/* Obtain a series of random bytes.
- Copyright 2020-2023 Free Software Foundation, Inc.
+ Copyright 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/gettext.h b/gnulib/lib/gettext.h
index d0462c47e1..39d5ae4daa 100644
--- a/gnulib/lib/gettext.h
+++ b/gnulib/lib/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/glthread/lock.c b/gnulib/lib/glthread/lock.c
index 82fb7553f6..40b2a5ee4f 100644
--- a/gnulib/lib/glthread/lock.c
+++ b/gnulib/lib/glthread/lock.c
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -240,8 +240,6 @@ glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
return 0;
}
-/* -------------------------- gl_once_t datatype -------------------------- */
-
#endif
/* ========================================================================= */
@@ -698,46 +696,6 @@ glthread_recursive_lock_destroy_multithreaded
(gl_recursive_lock_t *lock)
# endif
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
-
-int
-glthread_once_singlethreaded (pthread_once_t *once_control)
-{
- /* We don't know whether pthread_once_t is an integer type, a floating-point
- type, a pointer type, or a structure type. */
- char *firstbyte = (char *)once_control;
- if (*firstbyte == *(const char *)&fresh_once)
- {
- /* First time use of once_control. Invert the first byte. */
- *firstbyte = ~ *(const char *)&fresh_once;
- return 1;
- }
- else
- return 0;
-}
-
-# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
-
-int
-glthread_once_multithreaded (pthread_once_t *once_control,
- void (*init_function) (void))
-{
- int err = pthread_once (once_control, init_function);
- if (err == ENOSYS)
- {
- /* This happens on FreeBSD 11: The pthread_once function in libc returns
- ENOSYS. */
- if (glthread_once_singlethreaded (once_control))
- init_function ();
- return 0;
- }
- return err;
-}
-
-# endif
-
#endif
/* ========================================================================= */
diff --git a/gnulib/lib/glthread/lock.h b/gnulib/lib/glthread/lock.h
index 805cd1cf61..2b9c0f2e14 100644
--- a/gnulib/lib/glthread/lock.h
+++ b/gnulib/lib/glthread/lock.h
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -64,13 +64,6 @@
Taking the lock: err = glthread_recursive_lock_lock (&name);
Releasing the lock: err = glthread_recursive_lock_unlock (&name);
De-initialization: err = glthread_recursive_lock_destroy (&name);
-
- Once-only execution:
- Type: gl_once_t
- Initializer: gl_once_define(extern, name)
- Execution: gl_once (name, initfunction);
- Equivalent functions with control of error handling:
- Execution: err = glthread_once (&name, initfunction);
*/
@@ -88,17 +81,9 @@
#include <errno.h>
#include <stdlib.h>
-#if !defined c11_threads_in_use
-# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
-# define c11_threads_in_use() 1
-# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
-# include <threads.h>
-# pragma weak thrd_exit
-# define c11_threads_in_use() (thrd_exit != NULL)
-# else
-# define c11_threads_in_use() 0
-# endif
-#endif
+#include "glthread/once.h"
+
+/* c11_threads_in_use() is defined in glthread/once.h. */
/* ========================================================================= */
@@ -195,14 +180,6 @@ extern int glthread_recursive_lock_lock
(gl_recursive_lock_t *lock);
extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef once_flag gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
- STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (call_once (ONCE_CONTROL, INITFUNCTION), 0)
-
# ifdef __cplusplus
}
# endif
@@ -221,80 +198,7 @@ typedef once_flag gl_once_t;
extern "C" {
# endif
-# if PTHREAD_IN_USE_DETECTION_HARD
-
-/* The pthread_in_use() detection needs to be done at runtime. */
-# define pthread_in_use() \
- glthread_in_use ()
-extern int glthread_in_use (void);
-
-# endif
-
-# if USE_POSIX_THREADS_WEAK
-
-/* Use weak references to the POSIX threads library. */
-
-/* Weak references avoid dragging in external libraries if the other parts
- of the program don't use them. Here we use them, because we don't want
- every program that uses libintl to depend on libpthread. This assumes
- that libpthread would not be loaded after libintl; i.e. if libintl is
- loaded first, by an executable that does not depend on libpthread, and
- then a module is dynamically loaded that depends on libpthread, libintl
- will not be multithread-safe. */
-
-/* The way to test at runtime whether libpthread is present is to test
- whether a function pointer's value, such as &pthread_mutex_init, is
- non-NULL. However, some versions of GCC have a bug through which, in
- PIC mode, &foo != NULL always evaluates to true if there is a direct
- call to foo(...) in the same function. To avoid this, we test the
- address of a function in libpthread that we don't use. */
-
-# pragma weak pthread_mutex_init
-# pragma weak pthread_mutex_lock
-# pragma weak pthread_mutex_unlock
-# pragma weak pthread_mutex_destroy
-# pragma weak pthread_rwlock_init
-# pragma weak pthread_rwlock_rdlock
-# pragma weak pthread_rwlock_wrlock
-# pragma weak pthread_rwlock_unlock
-# pragma weak pthread_rwlock_destroy
-# pragma weak pthread_once
-# pragma weak pthread_cond_init
-# pragma weak pthread_cond_wait
-# pragma weak pthread_cond_signal
-# pragma weak pthread_cond_broadcast
-# pragma weak pthread_cond_destroy
-# pragma weak pthread_mutexattr_init
-# pragma weak pthread_mutexattr_settype
-# pragma weak pthread_mutexattr_destroy
-# pragma weak pthread_rwlockattr_init
-# if __GNU_LIBRARY__ > 1
-# pragma weak pthread_rwlockattr_setkind_np
-# endif
-# pragma weak pthread_rwlockattr_destroy
-# ifndef pthread_self
-# pragma weak pthread_self
-# endif
-
-# if !PTHREAD_IN_USE_DETECTION_HARD
- /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
- can be used to determine whether libpthread is in use. These are:
- pthread_mutexattr_gettype
- pthread_rwlockattr_destroy
- pthread_rwlockattr_init
- */
-# pragma weak pthread_mutexattr_gettype
-# define pthread_in_use() \
- (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
-# endif
-
-# else
-
-# if !PTHREAD_IN_USE_DETECTION_HARD
-# define pthread_in_use() 1
-# endif
-
-# endif
+/* pthread_in_use() is defined in glthread/once.h. */
/* -------------------------- gl_lock_t datatype -------------------------- */
@@ -510,26 +414,6 @@ extern int glthread_recursive_lock_destroy_multithreaded
(gl_recursive_lock_t *l
# endif
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef pthread_once_t gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
- STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
-# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (pthread_in_use ()
\
- ? pthread_once (ONCE_CONTROL, INITFUNCTION)
\
- : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) :
0))
-# else
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (pthread_in_use ()
\
- ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)
\
- : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) :
0))
-extern int glthread_once_multithreaded (pthread_once_t *once_control,
- void (*init_function) (void));
-# endif
-extern int glthread_once_singlethreaded (pthread_once_t *once_control);
-
# ifdef __cplusplus
}
# endif
@@ -546,7 +430,6 @@ extern int glthread_once_singlethreaded (pthread_once_t
*once_control);
# include "windows-mutex.h"
# include "windows-rwlock.h"
# include "windows-recmutex.h"
-# include "windows-once.h"
# ifdef __cplusplus
extern "C" {
@@ -619,14 +502,6 @@ typedef glwthread_recmutex_t gl_recursive_lock_t;
# define glthread_recursive_lock_destroy(LOCK) \
glwthread_recmutex_destroy (LOCK)
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef glwthread_once_t gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
- STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
-
# ifdef __cplusplus
}
# endif
@@ -670,14 +545,6 @@ typedef int gl_recursive_lock_t;
# define glthread_recursive_lock_unlock(NAME) 0
# define glthread_recursive_lock_destroy(NAME) 0
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef int gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
- STORAGECLASS gl_once_t NAME = 0;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
-
#endif
/* ========================================================================= */
@@ -784,16 +651,6 @@ typedef int gl_once_t;
} \
while (0)
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-#define gl_once(NAME, INITFUNCTION) \
- do \
- { \
- if (glthread_once (&NAME, INITFUNCTION)) \
- abort (); \
- } \
- while (0)
-
/* ========================================================================= */
#endif /* _LOCK_H */
diff --git a/gnulib/lib/glthread/once.c b/gnulib/lib/glthread/once.c
new file mode 100644
index 0000000000..869ba3ba9a
--- /dev/null
+++ b/gnulib/lib/glthread/once.c
@@ -0,0 +1,80 @@
+/* Once-only initialization in multithreaded situations.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h. */
+
+#include <config.h>
+
+#include "glthread/once.h"
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+ /* We don't know whether pthread_once_t is an integer type, a floating-point
+ type, a pointer type, or a structure type. */
+ char *firstbyte = (char *)once_control;
+ if (*firstbyte == *(const char *)&fresh_once)
+ {
+ /* First time use of once_control. Invert the first byte. */
+ *firstbyte = ~ *(const char *)&fresh_once;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
+
+int
+glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void))
+{
+ int err = pthread_once (once_control, init_function);
+ if (err == ENOSYS)
+ {
+ /* This happens on FreeBSD 11: The pthread_once function in libc returns
+ ENOSYS. */
+ if (glthread_once_singlethreaded (once_control))
+ init_function ();
+ return 0;
+ }
+ return err;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+#endif
+
+/* ========================================================================= */
diff --git a/gnulib/lib/glthread/once.h b/gnulib/lib/glthread/once.h
new file mode 100644
index 0000000000..2452f88dc1
--- /dev/null
+++ b/gnulib/lib/glthread/once.h
@@ -0,0 +1,272 @@
+/* Once-only initialization in multithreaded situations.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
+
+/* This file contains once-only initialization primitives for use with a given
+ thread library.
+ It does not contain primitives for creating threads or for other
+ synchronization primitives.
+
+ Once-only execution:
+ Type: gl_once_t
+ Initializer: gl_once_define(extern, name)
+ Execution: gl_once (name, initfunction);
+ Equivalent functions with control of error handling:
+ Execution: err = glthread_once (&name, initfunction);
+*/
+
+
+#ifndef _ONCE_H
+#define _ONCE_H
+
+/* This file uses HAVE_THREADS_H. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
+# define c11_threads_in_use() 1
+# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library. */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef once_flag gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (call_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime. */
+# define pthread_in_use() \
+ glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library. */
+
+/* Weak references avoid dragging in external libraries if the other parts
+ of the program don't use them. Here we use them, because we don't want
+ every program that uses libintl to depend on libpthread. This assumes
+ that libpthread would not be loaded after libintl; i.e. if libintl is
+ loaded first, by an executable that does not depend on libpthread, and
+ then a module is dynamically loaded that depends on libpthread, libintl
+ will not be multithread-safe. */
+
+/* The way to test at runtime whether libpthread is present is to test
+ whether a function pointer's value, such as &pthread_mutex_init, is
+ non-NULL. However, some versions of GCC have a bug through which, in
+ PIC mode, &foo != NULL always evaluates to true if there is a direct
+ call to foo(...) in the same function. To avoid this, we test the
+ address of a function in libpthread that we don't use. */
+
+# pragma weak pthread_mutex_init
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+/* Work around clang bug <https://github.com/llvm/llvm-project/issues/104670>
*/
+# ifndef pthread_rwlock_init
+# pragma weak pthread_rwlock_init
+# endif
+# pragma weak pthread_rwlock_rdlock
+# pragma weak pthread_rwlock_wrlock
+# pragma weak pthread_rwlock_unlock
+# pragma weak pthread_rwlock_destroy
+# pragma weak pthread_once
+# pragma weak pthread_cond_init
+# pragma weak pthread_cond_wait
+# pragma weak pthread_cond_signal
+# pragma weak pthread_cond_broadcast
+# pragma weak pthread_cond_destroy
+# pragma weak pthread_mutexattr_init
+# pragma weak pthread_mutexattr_settype
+# pragma weak pthread_mutexattr_destroy
+/* Work around clang bug <https://github.com/llvm/llvm-project/issues/104670>
*/
+# ifndef pthread_rwlockattr_init
+# pragma weak pthread_rwlockattr_init
+# endif
+# if __GNU_LIBRARY__ > 1
+# pragma weak pthread_rwlockattr_setkind_np
+# endif
+# pragma weak pthread_rwlockattr_destroy
+# ifndef pthread_self
+# pragma weak pthread_self
+# endif
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+ /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
+ can be used to determine whether libpthread is in use. These are:
+ pthread_mutexattr_gettype
+ pthread_rwlockattr_destroy
+ pthread_rwlockattr_init
+ */
+# pragma weak pthread_mutexattr_gettype
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+# endif
+
+# else
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+# define pthread_in_use() 1
+# endif
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use ()
\
+ ? pthread_once (ONCE_CONTROL, INITFUNCTION)
\
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) :
0))
+# else
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use ()
\
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)
\
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) :
0))
+extern int glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void));
+# endif
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-once.h"
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+ Mutex, Semaphore types, because
+ - we need only to synchronize inside a single process (address space),
+ not inter-process locking,
+ - we don't need to support trylock operations. (TryEnterCriticalSection
+ does not work on Windows 95/98/ME. Packages that need trylock usually
+ define their own mutex type.) */
+
+/* There is no way to statically initialize a CRITICAL_SECTION. It needs
+ to be done lazily, once only. For this we need spinlocks. */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef glwthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS ||
USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported. */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = 0;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling. */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+ do \
+ { \
+ if (glthread_once (&NAME, INITFUNCTION)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ========================================================================= */
+
+#endif /* _ONCE_H */
diff --git a/gnulib/lib/glthread/threadlib.c b/gnulib/lib/glthread/threadlib.c
index 5ecf827ff3..7a77676841 100644
--- a/gnulib/lib/glthread/threadlib.c
+++ b/gnulib/lib/glthread/threadlib.c
@@ -1,5 +1,5 @@
/* Multithreading primitives.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/hard-locale.c b/gnulib/lib/hard-locale.c
index c01fce5344..653c580925 100644
--- a/gnulib/lib/hard-locale.c
+++ b/gnulib/lib/hard-locale.c
@@ -1,6 +1,6 @@
/* hard-locale.c -- Determine whether a locale is hard.
- Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2023 Free Software
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/hard-locale.h b/gnulib/lib/hard-locale.h
index 5123d71d95..5d40e522a4 100644
--- a/gnulib/lib/hard-locale.h
+++ b/gnulib/lib/hard-locale.h
@@ -1,6 +1,6 @@
/* Determine whether a locale is hard.
- Copyright (C) 1999, 2003-2004, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003-2004, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -16,7 +16,12 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef HARD_LOCALE_H_
-# define HARD_LOCALE_H_ 1
+#define HARD_LOCALE_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Return true if the specified CATEGORY of the current locale is hard, i.e.
different from the C or POSIX locale that has a fixed behavior.
@@ -25,4 +30,9 @@
per-thread locale. */
extern bool hard_locale (int category);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HARD_LOCALE_H_ */
diff --git a/gnulib/lib/ialloc.c b/gnulib/lib/ialloc.c
index cd44d8caf7..8564a15b6a 100644
--- a/gnulib/lib/ialloc.c
+++ b/gnulib/lib/ialloc.c
@@ -1,6 +1,6 @@
/* malloc with idx_t rather than size_t
- Copyright 2021-2023 Free Software Foundation, Inc.
+ Copyright 2021-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/ialloc.h b/gnulib/lib/ialloc.h
index 22f57a47d8..2aa94ae7ca 100644
--- a/gnulib/lib/ialloc.h
+++ b/gnulib/lib/ialloc.h
@@ -1,6 +1,6 @@
/* ialloc.h -- malloc with idx_t rather than size_t
- Copyright 2021-2023 Free Software Foundation, Inc.
+ Copyright 2021-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -29,6 +29,9 @@
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
+#if defined __CHERI_PURE_CAPABILITY__
+# include <cheri.h>
+#endif
_GL_INLINE_HEADER_BEGIN
#ifndef IALLOC_INLINE
@@ -65,9 +68,19 @@ IALLOC_INLINE
void *
irealloc (void *p, idx_t s)
{
- /* Work around GNU realloc glitch by treating a zero size as if it
- were 1, so that returning NULL is equivalent to failing. */
- return s <= SIZE_MAX ? realloc (p, s | !s) : _gl_alloc_nomem ();
+ if (s <= SIZE_MAX)
+ {
+ /* Work around GNU realloc glitch by treating a zero size as if it
+ were 1, so that returning NULL is equivalent to failing. */
+ p = realloc (p, s | !s);
+#if defined __CHERI_PURE_CAPABILITY__
+ if (p != NULL)
+ p = cheri_bounds_set (p, s);
+#endif
+ return p;
+ }
+ else
+ return _gl_alloc_nomem ();
}
/* icalloc (num, size) is like calloc (num, size).
@@ -99,13 +112,23 @@ icalloc (idx_t n, idx_t s)
IALLOC_INLINE void *
ireallocarray (void *p, idx_t n, idx_t s)
{
- /* Work around GNU reallocarray glitch by treating a zero size as if
- it were 1, so that returning NULL is equivalent to failing. */
- if (n == 0 || s == 0)
- n = s = 1;
- return (n <= SIZE_MAX && s <= SIZE_MAX
- ? reallocarray (p, n, s)
- : _gl_alloc_nomem ());
+ if (n <= SIZE_MAX && s <= SIZE_MAX)
+ {
+ /* Work around GNU reallocarray glitch by treating a zero size as if
+ it were 1, so that returning NULL is equivalent to failing. */
+ size_t nx = n;
+ size_t sx = s;
+ if (n == 0 || s == 0)
+ nx = sx = 1;
+ p = reallocarray (p, nx, sx);
+#if defined __CHERI_PURE_CAPABILITY__
+ if (p != NULL && (n == 0 || s == 0))
+ p = cheri_bounds_set (p, 0);
+#endif
+ return p;
+ }
+ else
+ return _gl_alloc_nomem ();
}
#ifdef __cplusplus
diff --git a/gnulib/lib/idx.h b/gnulib/lib/idx.h
index 23020b7ec0..43793f2d62 100644
--- a/gnulib/lib/idx.h
+++ b/gnulib/lib/idx.h
@@ -1,5 +1,5 @@
/* A type for indices and sizes.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -111,6 +111,11 @@
help producing good code and good warnings. The type 'idx_t' could
then be typedef'ed to a range type that is signed after promotion. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* In the future, idx_t could be typedef'ed to a signed range type.
The clang "extended integer types", supported in Clang 11 or newer
<https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
@@ -131,4 +136,9 @@ typedef ptrdiff_t idx_t;
Perhaps there should be another macro IDX_VALUE_BITS that does not
count the sign bit and is therefore one less than PTRDIFF_WIDTH. */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _IDX_H */
diff --git a/gnulib/lib/intprops-internal.h b/gnulib/lib/intprops-internal.h
index 41039a093b..c8cc0e2019 100644
--- a/gnulib/lib/intprops-internal.h
+++ b/gnulib/lib/intprops-internal.h
@@ -1,6 +1,6 @@
/* intprops-internal.h -- properties of integer types not visible to users
- Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -21,7 +21,7 @@
#include <limits.h>
/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wtype-limits"
#endif
@@ -163,13 +163,15 @@
#if _GL_HAS_BUILTIN_MUL_OVERFLOW
# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
|| (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
- && !defined __EDG__)
+ && !defined __clang__ && !defined __EDG__)
# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
# else
/* Work around GCC bug 91450. */
# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) &&
_GL_EXPR_SIGNED (b) \
- && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+ && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, \
+ (__typeof__ (*(r))) 0, \
+ (__typeof__ (*(r))) -1)) \
? ((void) __builtin_mul_overflow (a, b, r), 1) \
: __builtin_mul_overflow (a, b, r))
# endif
@@ -183,10 +185,10 @@
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
https://llvm.org/bugs/show_bug.cgi?id=25390
- For now, assume all versions of GCC-like compilers generate bogus
+ For now, assume GCC < 14 and all Clang versions generate bogus
warnings for _Generic. This matters only for compilers that
lack relevant builtins. */
-#if __GNUC__ || defined __clang__
+#if (__GNUC__ && __GNUC__ < 14) || defined __clang__
# define _GL__GENERIC_BOGUS 1
#else
# define _GL__GENERIC_BOGUS 0
diff --git a/gnulib/lib/intprops.h b/gnulib/lib/intprops.h
index 44b5e60fb9..43734f3440 100644
--- a/gnulib/lib/intprops.h
+++ b/gnulib/lib/intprops.h
@@ -1,6 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/gnulib/lib/inttypes.in.h b/gnulib/lib/inttypes.in.h
index 22643876ab..e9c80f3dca 100644
--- a/gnulib/lib/inttypes.in.h
+++ b/gnulib/lib/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2024 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
@@ -970,7 +970,7 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
# define strtoimax rpl_strtoimax
# endif
_GL_FUNCDECL_RPL (strtoimax, intmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int));
@@ -978,7 +978,7 @@ _GL_CXXALIAS_RPL (strtoimax, intmax_t,
# if !@HAVE_DECL_STRTOIMAX@
# undef strtoimax
_GL_FUNCDECL_SYS (strtoimax, intmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoimax, intmax_t,
@@ -1000,7 +1000,7 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
# define strtoumax rpl_strtoumax
# endif
_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int));
@@ -1008,7 +1008,7 @@ _GL_CXXALIAS_RPL (strtoumax, uintmax_t,
# if !@HAVE_DECL_STRTOUMAX@
# undef strtoumax
_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
diff --git a/gnulib/lib/iswblank.c b/gnulib/lib/iswblank.c
index 5540f1fe03..f699850a1b 100644
--- a/gnulib/lib/iswblank.c
+++ b/gnulib/lib/iswblank.c
@@ -1,5 +1,5 @@
/* Test wide character for being blank.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/iswctype-impl.h b/gnulib/lib/iswctype-impl.h
index 13dc6664c6..999f220cc1 100644
--- a/gnulib/lib/iswctype-impl.h
+++ b/gnulib/lib/iswctype-impl.h
@@ -1,5 +1,5 @@
/* Test whether a wide character has a given property.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/iswctype.c b/gnulib/lib/iswctype.c
index e70446aef9..f4e6f015d9 100644
--- a/gnulib/lib/iswctype.c
+++ b/gnulib/lib/iswctype.c
@@ -1,5 +1,5 @@
/* Test whether a wide character has a given property.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/iswdigit.c b/gnulib/lib/iswdigit.c
index 94db27402b..57363ab8e4 100644
--- a/gnulib/lib/iswdigit.c
+++ b/gnulib/lib/iswdigit.c
@@ -1,5 +1,5 @@
/* Test wide character for being a digit.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/iswpunct.c b/gnulib/lib/iswpunct.c
index 0d60cb71eb..c7cb28b5fa 100644
--- a/gnulib/lib/iswpunct.c
+++ b/gnulib/lib/iswpunct.c
@@ -1,5 +1,5 @@
/* Test wide character for being a punctuation or symbol character.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/iswxdigit.c b/gnulib/lib/iswxdigit.c
index 7ec4566d0e..d32e3b0f7c 100644
--- a/gnulib/lib/iswxdigit.c
+++ b/gnulib/lib/iswxdigit.c
@@ -1,5 +1,5 @@
/* Test wide character for being a hexadecimal digit.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/itold.c b/gnulib/lib/itold.c
index 0ef4464eea..e6fbcff408 100644
--- a/gnulib/lib/itold.c
+++ b/gnulib/lib/itold.c
@@ -1,5 +1,5 @@
/* Replacement for 'int' to 'long double' conversion routine.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/langinfo.in.h b/gnulib/lib/langinfo.in.h
index 4cf712eb3e..febbd25f24 100644
--- a/gnulib/lib/langinfo.in.h
+++ b/gnulib/lib/langinfo.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <langinfo.h>.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/lc-charset-dispatch.c b/gnulib/lib/lc-charset-dispatch.c
index cd74466b4c..e2f8b2f5de 100644
--- a/gnulib/lib/lc-charset-dispatch.c
+++ b/gnulib/lib/lc-charset-dispatch.c
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2023 Free Software Foundation, Inc.
+ Copyright (C) 2018-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/lc-charset-dispatch.h b/gnulib/lib/lc-charset-dispatch.h
index c82b6a609d..4c1cf5f1ac 100644
--- a/gnulib/lib/lc-charset-dispatch.h
+++ b/gnulib/lib/lc-charset-dispatch.h
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2023 Free Software Foundation, Inc.
+ Copyright (C) 2018-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/libc-config.h b/gnulib/lib/libc-config.h
index 5f5ad01037..33bdb73660 100644
--- a/gnulib/lib/libc-config.h
+++ b/gnulib/lib/libc-config.h
@@ -1,6 +1,6 @@
/* System definitions for code taken from the GNU C Library
- Copyright 2017-2023 Free Software Foundation, Inc.
+ Copyright 2017-2024 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -48,6 +48,11 @@
/* From glibc <features.h>. */
+#if defined __clang__
+ /* clang really only groks GNU C 4.2, regardless of its value of __GNUC__.
*/
+# undef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) ((maj) < 4 + ((min) <= 2))
+#endif
#ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <=
__GNUC_MINOR__))
diff --git a/gnulib/lib/limits.in.h b/gnulib/lib/limits.in.h
index e2e173eb2d..c65eb4c1cf 100644
--- a/gnulib/lib/limits.in.h
+++ b/gnulib/lib/limits.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <limits.h>.
- Copyright 2016-2023 Free Software Foundation, Inc.
+ Copyright 2016-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -130,7 +130,7 @@
# define BOOL_WIDTH 1
# define BOOL_MAX 1
# elif ! defined BOOL_MAX
-# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1)
+# define BOOL_MAX 1
# endif
#endif
diff --git a/gnulib/lib/localcharset.c b/gnulib/lib/localcharset.c
index 7ed9c957db..93c4baa471 100644
--- a/gnulib/lib/localcharset.c
+++ b/gnulib/lib/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -1054,7 +1054,7 @@ locale_charset (void)
}
}
if (0)
- done_table_lookup: ;
+ done_table_lookup: {}
else
# endif
{
diff --git a/gnulib/lib/localcharset.h b/gnulib/lib/localcharset.h
index 25c9bb9c6e..472140248c 100644
--- a/gnulib/lib/localcharset.h
+++ b/gnulib/lib/localcharset.h
@@ -1,5 +1,5 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2003, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2009-2024 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/locale.in.h b/gnulib/lib/locale.in.h
index 41a93c1dad..d025ef53ca 100644
--- a/gnulib/lib/locale.in.h
+++ b/gnulib/lib/locale.in.h
@@ -1,5 +1,5 @@
/* A POSIX <locale.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -177,8 +177,10 @@ _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
_GL_CXXALIASWARN (localeconv);
# endif
#elif @REPLACE_STRUCT_LCONV@
-# undef localeconv
-# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+# if !GNULIB_LOCALECONV
+# undef localeconv
+# define localeconv
localeconv_used_without_requesting_gnulib_module_localeconv
+# endif
#elif defined GNULIB_POSIXCHECK
# undef localeconv
# if HAVE_RAW_DECL_LOCALECONV
@@ -216,7 +218,7 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on
native Windows - "
# include "setlocale_null.h"
#endif
-#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
+#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME_UNSAFE@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
# if @REPLACE_NEWLOCALE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef newlocale
@@ -224,7 +226,7 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on
native Windows - "
# define GNULIB_defined_newlocale 1
# endif
_GL_FUNCDECL_RPL (newlocale, locale_t,
- (int category_mask, const char *name, locale_t base)
+ (int category_mask, const char *name, locale_t base),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (newlocale, locale_t,
(int category_mask, const char *name, locale_t base));
@@ -249,7 +251,7 @@ _GL_WARN_ON_USE (newlocale, "newlocale is not portable");
# endif
#endif
-#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
+#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME_UNSAFE@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
# if @HAVE_DUPLOCALE@ /* locale_t may be undefined if !@HAVE_DUPLOCALE@. */
# if @REPLACE_DUPLOCALE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -257,7 +259,7 @@ _GL_WARN_ON_USE (newlocale, "newlocale is not portable");
# define duplocale rpl_duplocale
# define GNULIB_defined_duplocale 1
# endif
-_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL
((1)));
+_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale), _GL_ARG_NONNULL
((1)));
_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
# else
_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
@@ -279,14 +281,14 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some
glibc systems - "
# endif
#endif
-#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
+#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME_UNSAFE@ &&
@LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
# if @REPLACE_FREELOCALE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef freelocale
# define freelocale rpl_freelocale
# define GNULIB_defined_freelocale 1
# endif
-_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
# else
# if @HAVE_FREELOCALE@
diff --git a/gnulib/lib/localeconv.c b/gnulib/lib/localeconv.c
index c1a34baa05..10fc7b748b 100644
--- a/gnulib/lib/localeconv.c
+++ b/gnulib/lib/localeconv.c
@@ -1,5 +1,5 @@
/* Query locale dependent information for formatting numbers.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/lstat.c b/gnulib/lib/lstat.c
index 00a4ce2ab8..7c09957e20 100644
--- a/gnulib/lib/lstat.c
+++ b/gnulib/lib/lstat.c
@@ -1,6 +1,6 @@
/* Work around a bug of lstat on some systems
- Copyright (C) 1997-2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 1997-2006, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/malloc.c b/gnulib/lib/malloc.c
index 3ade35cb63..2a7867a1d1 100644
--- a/gnulib/lib/malloc.c
+++ b/gnulib/lib/malloc.c
@@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible.
- Copyright (C) 1997-1998, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2006-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/malloc/dynarray-skeleton.c
b/gnulib/lib/malloc/dynarray-skeleton.c
index 580c278b7c..a95241abd2 100644
--- a/gnulib/lib/malloc/dynarray-skeleton.c
+++ b/gnulib/lib/malloc/dynarray-skeleton.c
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray.h b/gnulib/lib/malloc/dynarray.h
index a9a3b0859c..3163e2782b 100644
--- a/gnulib/lib/malloc/dynarray.h
+++ b/gnulib/lib/malloc/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically. Shared definitions.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray_at_failure.c
b/gnulib/lib/malloc/dynarray_at_failure.c
index ebc9310982..95e34e7aac 100644
--- a/gnulib/lib/malloc/dynarray_at_failure.c
+++ b/gnulib/lib/malloc/dynarray_at_failure.c
@@ -1,5 +1,5 @@
/* Report an dynamic array index out of bounds condition.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray_emplace_enlarge.c
b/gnulib/lib/malloc/dynarray_emplace_enlarge.c
index 65aabb1e4a..7bdba1597e 100644
--- a/gnulib/lib/malloc/dynarray_emplace_enlarge.c
+++ b/gnulib/lib/malloc/dynarray_emplace_enlarge.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array in preparation of an emplace operation.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray_finalize.c
b/gnulib/lib/malloc/dynarray_finalize.c
index 673595a5fa..52764f7328 100644
--- a/gnulib/lib/malloc/dynarray_finalize.c
+++ b/gnulib/lib/malloc/dynarray_finalize.c
@@ -1,5 +1,5 @@
/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray_resize.c
b/gnulib/lib/malloc/dynarray_resize.c
index 014f98c330..7323f8eeb0 100644
--- a/gnulib/lib/malloc/dynarray_resize.c
+++ b/gnulib/lib/malloc/dynarray_resize.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloc/dynarray_resize_clear.c
b/gnulib/lib/malloc/dynarray_resize_clear.c
index bb23c522a1..aa17f740e5 100644
--- a/gnulib/lib/malloc/dynarray_resize_clear.c
+++ b/gnulib/lib/malloc/dynarray_resize_clear.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array and clear the new part.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/malloca.c b/gnulib/lib/malloca.c
index f055b1e5ca..e75c72df84 100644
--- a/gnulib/lib/malloca.c
+++ b/gnulib/lib/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
This file is free software: you can redistribute it and/or modify
@@ -22,6 +22,9 @@
#include "malloca.h"
#include <stdckdint.h>
+#if defined __CHERI_PURE_CAPABILITY__
+# include <cheri.h>
+#endif
#include "idx.h"
@@ -36,10 +39,15 @@
allocation.
- NULL comes from a failed heap allocation. */
+#if defined __CHERI_PURE_CAPABILITY__
+/* Type for holding the original malloc() result. */
+typedef uintptr_t small_t;
+#else
/* Type for holding very small pointer differences. */
typedef unsigned char small_t;
/* Verify that it is wide enough. */
static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
+#endif
void *
mmalloca (size_t n)
@@ -56,20 +64,28 @@ mmalloca (size_t n)
if (mem != NULL)
{
- uintptr_t umem = (uintptr_t)mem, umemplus;
+ uintptr_t umem = (uintptr_t) mem;
/* The ckd_add avoids signed integer overflow on
theoretical platforms where UINTPTR_MAX <= INT_MAX. */
+ uintptr_t umemplus;
ckd_add (&umemplus, umem, sizeof (small_t) + sa_alignment_max - 1);
- idx_t offset = ((umemplus & ~alignment2_mask)
+ idx_t offset = (umemplus - umemplus % (2 * sa_alignment_max)
+ sa_alignment_max - umem);
- void *vp = mem + offset;
- small_t *p = vp;
+ void *p = mem + offset;
/* Here p >= mem + sizeof (small_t),
and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
hence p + n <= mem + nplus.
So, the memory range [p, p+n) lies in the allocated memory range
[mem, mem + nplus). */
- p[-1] = offset;
+ small_t *sp = p;
+# if defined __CHERI_PURE_CAPABILITY__
+ sp[-1] = umem;
+ p = (char *) cheri_bounds_set ((char *) p - sizeof (small_t),
+ sizeof (small_t) + n)
+ + sizeof (small_t);
+# else
+ sp[-1] = offset;
+# endif
/* p ≡ sa_alignment_max mod 2*sa_alignment_max. */
return p;
}
@@ -90,15 +106,22 @@ void
freea (void *p)
{
/* Check argument. */
- if ((uintptr_t) p & (sa_alignment_max - 1))
+ uintptr_t u = (uintptr_t) p;
+ if (u & (sa_alignment_max - 1))
{
/* p was not the result of a malloca() call. Invalid argument. */
abort ();
}
/* Determine whether p was a non-NULL pointer returned by mmalloca(). */
- if ((uintptr_t) p & sa_alignment_max)
+ if (u & sa_alignment_max)
{
- void *mem = (char *) p - ((small_t *) p)[-1];
+ char *cp = p;
+ small_t *sp = p;
+# if defined __CHERI_PURE_CAPABILITY__
+ void *mem = sp[-1];
+# else
+ void *mem = cp - sp[-1];
+# endif
free (mem);
}
}
diff --git a/gnulib/lib/malloca.h b/gnulib/lib/malloca.h
index f68ddfe010..c520842171 100644
--- a/gnulib/lib/malloca.h
+++ b/gnulib/lib/malloca.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
@@ -28,6 +28,9 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
+#if defined __CHERI_PURE_CAPABILITY__
+# include <cheri.h>
+#endif
#include "xalloc-oversized.h"
@@ -68,12 +71,24 @@ extern void freea (void *p);
memory allocated on the stack, that must be freed using freea() before
the function returns. Upon failure, it returns NULL. */
#if HAVE_ALLOCA
-# define malloca(N) \
- ((N) < 4032 - (2 * sa_alignment_max - 1) \
- ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
- + (2 * sa_alignment_max - 1)) \
- & ~(uintptr_t)(2 * sa_alignment_max - 1)) \
- : mmalloca (N))
+# if defined __CHERI_PURE_CAPABILITY__
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1) \
+ ? cheri_bounds_set ((void *) (((uintptr_t) \
+ (char *) \
+ alloca ((N) + 2 * sa_alignment_max - 1) \
+ + (2 * sa_alignment_max - 1)) \
+ & ~(uintptr_t)(2 * sa_alignment_max - 1)), \
+ (N)) \
+ : mmalloca (N))
+# else
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1)
\
+ ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1)
\
+ + (2 * sa_alignment_max - 1))
\
+ & ~(uintptr_t)(2 * sa_alignment_max - 1))
\
+ : mmalloca (N))
+# endif
#else
# define malloca(N) \
mmalloca (N)
diff --git a/gnulib/lib/mbchar.c b/gnulib/lib/mbchar.c
index af3c7934dc..d94b7c339c 100644
--- a/gnulib/lib/mbchar.c
+++ b/gnulib/lib/mbchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbchar.h b/gnulib/lib/mbchar.h
index fd5b2ed4ec..5a1529ddcb 100644
--- a/gnulib/lib/mbchar.h
+++ b/gnulib/lib/mbchar.h
@@ -1,5 +1,5 @@
/* Multibyte character data type.
- Copyright (C) 2001, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -157,6 +157,11 @@ _GL_INLINE_HEADER_BEGIN
# define MBCHAR_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* The longest multibyte characters, nowadays, are 4 bytes long.
Regardless of the values of MB_CUR_MAX and MB_LEN_MAX. */
#define MBCHAR_BUF_SIZE 4
@@ -368,6 +373,11 @@ is_basic (char c)
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBCHAR_H */
diff --git a/gnulib/lib/mbiter.c b/gnulib/lib/mbiter.c
index 530181aa50..bf525b1bdd 100644
--- a/gnulib/lib/mbiter.c
+++ b/gnulib/lib/mbiter.c
@@ -1,6 +1,6 @@
/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbiter.h b/gnulib/lib/mbiter.h
index b9222fcc3a..bee76d2f81 100644
--- a/gnulib/lib/mbiter.h
+++ b/gnulib/lib/mbiter.h
@@ -1,5 +1,5 @@
/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2001, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -101,6 +101,11 @@ _GL_INLINE_HEADER_BEGIN
# define MBITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbiter_multi
{
const char *limit; /* pointer to end of string */
@@ -263,6 +268,11 @@ typedef struct mbiter_multi mbi_iterator_t;
/* Copying an iterator. */
#define mbi_copy mbiter_multi_copy
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBITER_H */
diff --git a/gnulib/lib/mbrtoc32.c b/gnulib/lib/mbrtoc32.c
index 0933437a4b..771c857d7d 100644
--- a/gnulib/lib/mbrtoc32.c
+++ b/gnulib/lib/mbrtoc32.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to 32-bit wide character.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -41,7 +41,11 @@
branch below.
They are equivalent. */
-# if defined _WIN32 && !defined __CYGWIN__
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+
+# elif defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
@@ -113,7 +117,7 @@ mbrtoc32 (char32_t *pwc, const char *s, size_t n, mbstate_t
*ps)
if (ps == NULL)
ps = &internal_state;
-# if HAVE_WORKING_MBRTOC32
+# if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB &&
!MBRTOC32_MULTIBYTE_LOCALE_BUG
/* mbrtoc32() may produce different values for wc than mbrtowc(). Therefore
use mbrtoc32(). */
diff --git a/gnulib/lib/mbrtowc-impl-utf8.h b/gnulib/lib/mbrtowc-impl-utf8.h
index 4fdd65d847..3a3ba13c0b 100644
--- a/gnulib/lib/mbrtowc-impl-utf8.h
+++ b/gnulib/lib/mbrtowc-impl-utf8.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbrtowc-impl.h b/gnulib/lib/mbrtowc-impl.h
index e9c04ed776..963631cae5 100644
--- a/gnulib/lib/mbrtowc-impl.h
+++ b/gnulib/lib/mbrtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbrtowc.c b/gnulib/lib/mbrtowc.c
index c1a689a270..8a1646d2f7 100644
--- a/gnulib/lib/mbrtowc.c
+++ b/gnulib/lib/mbrtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -28,7 +28,11 @@
# include <stdint.h>
# include <stdlib.h>
-# if defined _WIN32 && !defined __CYGWIN__
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+
+# elif defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
diff --git a/gnulib/lib/mbscasecmp.c b/gnulib/lib/mbscasecmp.c
index 5e0bc67dc0..1abeb129d6 100644
--- a/gnulib/lib/mbscasecmp.c
+++ b/gnulib/lib/mbscasecmp.c
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison function.
- Copyright (C) 1998-1999, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005,
based on earlier glibc code.
diff --git a/gnulib/lib/mbschr.c b/gnulib/lib/mbschr.c
index 330e3f1c75..a5f6e38623 100644
--- a/gnulib/lib/mbschr.c
+++ b/gnulib/lib/mbschr.c
@@ -1,5 +1,5 @@
/* Searching a string for a character.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
@@ -20,7 +20,13 @@
/* Specification. */
#include <string.h>
-#include "mbuiterf.h"
+#include <stdlib.h>
+
+#if GNULIB_MCEL_PREFER
+# include "mcel.h"
+#else
+# include "mbuiterf.h"
+#endif
/* Locate the first single-byte character C in the character string STRING,
and return a pointer to it. Return NULL if C is not found in STRING. */
@@ -33,6 +39,15 @@ mbschr (const char *string, int c)
the faster unibyte loop can be used. */
&& (unsigned char) c >= 0x30)
{
+#if GNULIB_MCEL_PREFER
+ while (*string)
+ {
+ mcel_t g = mcel_scanz (string);
+ if (g.len == 1 && (unsigned char) *string == (unsigned char) c)
+ return (char *) string;
+ string += g.len;
+ }
+#else
mbuif_state_t state;
const char *iter;
for (mbuif_init (state), iter = string;; )
@@ -46,6 +61,7 @@ mbschr (const char *string, int c)
}
return (char *) iter;
notfound:
+#endif
return NULL;
}
else
diff --git a/gnulib/lib/mbsinit.c b/gnulib/lib/mbsinit.c
index 85b6087cf4..d1b8475c78 100644
--- a/gnulib/lib/mbsinit.c
+++ b/gnulib/lib/mbsinit.c
@@ -1,5 +1,5 @@
/* Test for initial conversion state.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/mbslen.c b/gnulib/lib/mbslen.c
index db9fa70d63..171d395475 100644
--- a/gnulib/lib/mbslen.c
+++ b/gnulib/lib/mbslen.c
@@ -1,5 +1,5 @@
/* Counting the multibyte characters in a string.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/mbsncasecmp.c b/gnulib/lib/mbsncasecmp.c
index 8ee1df7d4d..2a6f62364c 100644
--- a/gnulib/lib/mbsncasecmp.c
+++ b/gnulib/lib/mbsncasecmp.c
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison function.
- Copyright (C) 1998-1999, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005,
based on earlier glibc code.
@@ -23,8 +23,13 @@
#include <ctype.h>
#include <limits.h>
+#include <stdlib.h>
-#include "mbuiterf.h"
+#if GNULIB_MCEL_PREFER
+# include "mcel.h"
+#else
+# include "mbuiterf.h"
+#endif
/* Compare the initial segment of the character string S1 consisting of at most
N characters with the initial segment of the character string S2 consisting
@@ -47,6 +52,17 @@ mbsncasecmp (const char *s1, const char *s2, size_t n)
most often already in the very few first characters. */
if (MB_CUR_MAX > 1)
{
+#if GNULIB_MCEL_PREFER
+ while (true)
+ {
+ mcel_t g1 = mcel_scanz (iter1); iter1 += g1.len;
+ mcel_t g2 = mcel_scanz (iter2); iter2 += g2.len;
+ int cmp = mcel_tocmp (c32tolower, g1, g2);
+ n--;
+ if (cmp | !n | !g1.ch)
+ return cmp;
+ }
+#else
mbuif_state_t state1;
mbuif_init (state1);
@@ -75,6 +91,7 @@ mbsncasecmp (const char *s1, const char *s2, size_t n)
/* s1 terminated before s2 and n. */
return -1;
return 0;
+#endif
}
else
for (;;)
diff --git a/gnulib/lib/mbsstr.c b/gnulib/lib/mbsstr.c
index b8d15f9521..8469702474 100644
--- a/gnulib/lib/mbsstr.c
+++ b/gnulib/lib/mbsstr.c
@@ -1,5 +1,5 @@
/* Searching in a string. -*- coding: utf-8 -*-
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This file is free software: you can redistribute it and/or modify
@@ -67,19 +67,19 @@ knuth_morris_pratt_multibyte (const char *haystack, const
char *needle,
size_t *table = table_memory = aligned;
/* Fill needle_mbchars. */
- {
#if GNULIB_MCEL_PREFER
- for (size_t j = 0; *needle; needle += needle_mbchars[j++].len)
- needle_mbchars[j] = mcel_scanz (needle);
+ for (size_t j = 0; *needle; needle += needle_mbchars[j++].len)
+ needle_mbchars[j] = mcel_scanz (needle);
#else
+ {
mbui_iterator_t iter;
size_t j;
j = 0;
for (mbui_init (iter, needle); mbui_avail (iter); mbui_advance (iter), j++)
mb_copy (&needle_mbchars[j], &mbui_cur (iter));
-#endif
}
+#endif
/* Fill the table.
For 0 < i < m:
diff --git a/gnulib/lib/mbswidth.c b/gnulib/lib/mbswidth.c
index 9ce94ae80d..87eee40223 100644
--- a/gnulib/lib/mbswidth.c
+++ b/gnulib/lib/mbswidth.c
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a string.
- Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gnulib/lib/mbswidth.h b/gnulib/lib/mbswidth.h
index f385b64999..ccd176d6b8 100644
--- a/gnulib/lib/mbswidth.h
+++ b/gnulib/lib/mbswidth.h
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a string.
- Copyright (C) 2000-2004, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2004, 2007, 2009-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gnulib/lib/mbszero.c b/gnulib/lib/mbszero.c
index 6da91c6b20..25af2848ea 100644
--- a/gnulib/lib/mbszero.c
+++ b/gnulib/lib/mbszero.c
@@ -1,5 +1,5 @@
/* Put an mbstate_t into an initial conversion state.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbtowc-impl.h b/gnulib/lib/mbtowc-impl.h
index 01fef1823d..92efb4a708 100644
--- a/gnulib/lib/mbtowc-impl.h
+++ b/gnulib/lib/mbtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/mbtowc-lock.c b/gnulib/lib/mbtowc-lock.c
index c4d0b088f6..9001c5af1f 100644
--- a/gnulib/lib/mbtowc-lock.c
+++ b/gnulib/lib/mbtowc-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,9 +18,10 @@
#include <config.h>
+/* The option '--disable-threads' explicitly requests no locking. */
/* When it is known that the gl_get_mbtowc_lock function is defined
by a dependency library, it should not be defined here. */
-#if OMIT_MBTOWC_LOCK
+#if AVOID_ANY_THREADS || OMIT_MBTOWC_LOCK
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
diff --git a/gnulib/lib/mbtowc-lock.h b/gnulib/lib/mbtowc-lock.h
index beb37722f5..10f7dc7c85 100644
--- a/gnulib/lib/mbtowc-lock.h
+++ b/gnulib/lib/mbtowc-lock.h
@@ -1,5 +1,5 @@
/* Use the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -32,7 +32,7 @@ mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
/* Prohibit renaming this symbol. */
#undef gl_get_mbtowc_lock
-#if GNULIB_MBRTOWC_SINGLE_THREAD
+#if AVOID_ANY_THREADS || GNULIB_MBRTOWC_SINGLE_THREAD
/* All uses of this function are in a single thread. No locking needed. */
diff --git a/gnulib/lib/mbtowc.c b/gnulib/lib/mbtowc.c
index 8d9b06d247..31a2d63538 100644
--- a/gnulib/lib/mbtowc.c
+++ b/gnulib/lib/mbtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/mbuiter.c b/gnulib/lib/mbuiter.c
index 58dea24b2e..505654c9cc 100644
--- a/gnulib/lib/mbuiter.c
+++ b/gnulib/lib/mbuiter.c
@@ -1,5 +1,5 @@
/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbuiter.h b/gnulib/lib/mbuiter.h
index 862efa3dbe..1860311d4c 100644
--- a/gnulib/lib/mbuiter.h
+++ b/gnulib/lib/mbuiter.h
@@ -1,5 +1,5 @@
/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2001, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -110,6 +110,11 @@ _GL_INLINE_HEADER_BEGIN
# define MBUITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbuiter_multi
{
#if !GNULIB_MBRTOC32_REGULAR
@@ -262,6 +267,11 @@ typedef struct mbuiter_multi mbui_iterator_t;
/* Copying an iterator. */
#define mbui_copy mbuiter_multi_copy
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBUITER_H */
diff --git a/gnulib/lib/mbuiterf.c b/gnulib/lib/mbuiterf.c
index c87772a051..b345c0d6c7 100644
--- a/gnulib/lib/mbuiterf.c
+++ b/gnulib/lib/mbuiterf.c
@@ -1,5 +1,5 @@
/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mbuiterf.h b/gnulib/lib/mbuiterf.h
index 85c53e73ac..1814e35b9d 100644
--- a/gnulib/lib/mbuiterf.h
+++ b/gnulib/lib/mbuiterf.h
@@ -1,5 +1,5 @@
/* Iterating through multibyte strings, faster: macros for multi-byte
encodings.
- Copyright (C) 2001, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -101,6 +101,11 @@ _GL_INLINE_HEADER_BEGIN
# define MBUITERF_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbuif_state
{
#if !GNULIB_MBRTOC32_REGULAR
@@ -208,6 +213,11 @@ typedef struct mbuif_state mbuif_state_t;
#define mbuif_next(st, iter) \
mbuiterf_next (&(st), (iter))
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBUITERF_H */
diff --git a/gnulib/lib/memchr.c b/gnulib/lib/memchr.c
index 8e9557937e..67687a8f17 100644
--- a/gnulib/lib/memchr.c
+++ b/gnulib/lib/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2023
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2024
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/gnulib/lib/memchr.valgrind b/gnulib/lib/memchr.valgrind
index 97690f2c50..0295d7e62f 100644
--- a/gnulib/lib/memchr.valgrind
+++ b/gnulib/lib/memchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in memchr().
-# Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# Copyright (C) 2009-2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mempcpy.c b/gnulib/lib/mempcpy.c
index 24a3135988..638867782d 100644
--- a/gnulib/lib/mempcpy.c
+++ b/gnulib/lib/mempcpy.c
@@ -1,5 +1,5 @@
/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/memrchr.c b/gnulib/lib/memrchr.c
index c5b1fe8b2e..3df1f479c7 100644
--- a/gnulib/lib/memrchr.c
+++ b/gnulib/lib/memrchr.c
@@ -1,6 +1,6 @@
/* memrchr -- find the last occurrence of a byte in a memory block
- Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2023 Free Software
+ Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2024 Free Software
Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/gnulib/lib/minmax.h b/gnulib/lib/minmax.h
index 0ac40198e2..f3df58b0d7 100644
--- a/gnulib/lib/minmax.h
+++ b/gnulib/lib/minmax.h
@@ -1,5 +1,5 @@
/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2023 Free Software
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/mkdir.c b/gnulib/lib/mkdir.c
index f94aba173b..21d77677ee 100644
--- a/gnulib/lib/mkdir.c
+++ b/gnulib/lib/mkdir.c
@@ -1,7 +1,7 @@
/* On some systems, mkdir ("foo/", 0700) fails because of the trailing
slash. On those systems, this wrapper removes the trailing slash.
- Copyright (C) 2001, 2003, 2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/mkstemp.c b/gnulib/lib/mkstemp.c
index 77aadbbdc2..724638dfaf 100644
--- a/gnulib/lib/mkstemp.c
+++ b/gnulib/lib/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2023 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
This file is derived from the one in the GNU C Library.
diff --git a/gnulib/lib/msvc-inval.c b/gnulib/lib/msvc-inval.c
index c5149a8fd6..da3fc86ad6 100644
--- a/gnulib/lib/msvc-inval.c
+++ b/gnulib/lib/msvc-inval.c
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/msvc-inval.h b/gnulib/lib/msvc-inval.h
index c16d880178..7aee6e5d6a 100644
--- a/gnulib/lib/msvc-inval.h
+++ b/gnulib/lib/msvc-inval.h
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/msvc-nothrow.c b/gnulib/lib/msvc-nothrow.c
index f729fe66f7..06b35a61dc 100644
--- a/gnulib/lib/msvc-nothrow.c
+++ b/gnulib/lib/msvc-nothrow.c
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/msvc-nothrow.h b/gnulib/lib/msvc-nothrow.h
index 0dd229fd66..121773d1a7 100644
--- a/gnulib/lib/msvc-nothrow.h
+++ b/gnulib/lib/msvc-nothrow.h
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -35,6 +35,10 @@
/* Get original declaration of _get_osfhandle. */
# include <io.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
/* Override _get_osfhandle. */
@@ -43,6 +47,10 @@ extern intptr_t _gl_nothrow_get_osfhandle (int fd);
# endif
+# ifdef __cplusplus
+}
+# endif
+
#endif
#endif /* _MSVC_NOTHROW_H */
diff --git a/gnulib/lib/nl_langinfo-lock.c b/gnulib/lib/nl_langinfo-lock.c
index fb12299959..5a248ed8d1 100644
--- a/gnulib/lib/nl_langinfo-lock.c
+++ b/gnulib/lib/nl_langinfo-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by nl_langinfo.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,9 +18,10 @@
#include <config.h>
+/* The option '--disable-threads' explicitly requests no locking. */
/* When it is known that the gl_get_nl_langinfo_lock function is defined
by a dependency library, it should not be defined here. */
-#if OMIT_NL_LANGINFO_LOCK
+#if AVOID_ANY_THREADS || OMIT_NL_LANGINFO_LOCK
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
diff --git a/gnulib/lib/nl_langinfo.c b/gnulib/lib/nl_langinfo.c
index f872c6d5e2..64ff93b0cb 100644
--- a/gnulib/lib/nl_langinfo.c
+++ b/gnulib/lib/nl_langinfo.c
@@ -1,6 +1,6 @@
/* nl_langinfo() replacement: query locale dependent information.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -30,7 +30,12 @@
#endif
#if REPLACE_NL_LANGINFO && !NL_LANGINFO_MTSAFE
-# if defined _WIN32 && !defined __CYGWIN__
+
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+
+# elif defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
@@ -51,6 +56,7 @@
# include <threads.h>
# endif
+
#endif
/* nl_langinfo() must be multithread-safe. To achieve this without using
@@ -186,7 +192,12 @@ nl_langinfo_unlocked (nl_item item)
/* Prohibit renaming this symbol. */
# undef gl_get_nl_langinfo_lock
-# if defined _WIN32 && !defined __CYGWIN__
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+# define nl_langinfo_with_lock nl_langinfo_unlocked
+
+# elif defined _WIN32 && !defined __CYGWIN__
extern __declspec(dllimport) CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
@@ -451,7 +462,7 @@ nl_langinfo (nl_item item)
{
static char const months[][sizeof "September"] = {
"January", "February", "March", "April", "May", "June", "July",
- "September", "October", "November", "December"
+ "August", "September", "October", "November", "December"
};
case MON_1:
case MON_2:
@@ -515,7 +526,7 @@ nl_langinfo (nl_item item)
static char result[12][30];
static char const abmonths[][sizeof "Jan"] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
- "Sep", "Oct", "Nov", "Dec"
+ "Aug", "Sep", "Oct", "Nov", "Dec"
};
tmm.tm_mon = item - ABMON_1;
if (!strftime (buf, sizeof result[0], "%b", &tmm))
diff --git a/gnulib/lib/open.c b/gnulib/lib/open.c
index 7ec8fdc35d..e690c9ea77 100644
--- a/gnulib/lib/open.c
+++ b/gnulib/lib/open.c
@@ -1,5 +1,5 @@
/* Open a descriptor to a file.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -38,9 +38,13 @@ orig_open (const char *filename, int flags, mode_t mode)
}
/* Specification. */
+#ifdef __osf__
/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
this include because of the preliminary #include <fcntl.h> above. */
-#include "fcntl.h"
+# include "fcntl.h"
+#else
+# include <fcntl.h>
+#endif
#include "cloexec.h"
diff --git a/gnulib/lib/pathmax.h b/gnulib/lib/pathmax.h
index 6930283b82..d6512c6f57 100644
--- a/gnulib/lib/pathmax.h
+++ b/gnulib/lib/pathmax.h
@@ -1,5 +1,5 @@
/* Define PATH_MAX somehow. Requires sys/types.h.
- Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2023 Free Software
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/printf-args.c b/gnulib/lib/printf-args.c
index b2b21aeec1..c20225039d 100644
--- a/gnulib/lib/printf-args.c
+++ b/gnulib/lib/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -198,7 +198,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
if (ap->a.a_string == NULL)
ap->a.a_string = "(NULL)";
break;
-#if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
ap->a.a_wide_string = va_arg (args, const wchar_t *);
/* A null pointer is an invalid argument for "%ls", but in practice
@@ -216,7 +215,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
ap->a.a_wide_string = wide_null_string;
}
break;
-#endif
case TYPE_POINTER:
ap->a.a_pointer = va_arg (args, void *);
break;
diff --git a/gnulib/lib/printf-args.h b/gnulib/lib/printf-args.h
index 1101610282..24a86748b1 100644
--- a/gnulib/lib/printf-args.h
+++ b/gnulib/lib/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -28,14 +28,9 @@
# define PRINTF_FETCHARGS printf_fetchargs
#endif
-/* Get size_t. */
+/* Get size_t, wchar_t. */
#include <stddef.h>
-/* Get wchar_t. */
-#if HAVE_WCHAR_T
-# include <stddef.h>
-#endif
-
/* Get wint_t. */
#if HAVE_WINT_T
# include <wchar.h>
@@ -89,9 +84,7 @@ typedef enum
TYPE_WIDE_CHAR,
#endif
TYPE_STRING,
-#if HAVE_WCHAR_T
TYPE_WIDE_STRING,
-#endif
TYPE_POINTER,
TYPE_COUNT_SCHAR_POINTER,
TYPE_COUNT_SHORT_POINTER,
@@ -154,9 +147,7 @@ typedef struct
wint_t a_wide_char;
#endif
const char* a_string;
-#if HAVE_WCHAR_T
const wchar_t* a_wide_string;
-#endif
void* a_pointer;
signed char * a_count_schar_pointer;
short * a_count_short_pointer;
diff --git a/gnulib/lib/printf-parse.c b/gnulib/lib/printf-parse.c
index d3f2c3cb5d..7628cb2335 100644
--- a/gnulib/lib/printf-parse.c
+++ b/gnulib/lib/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -555,9 +555,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d,
arguments *a)
unsigned_type = TYPE_ULONGINT;
pointer_type = TYPE_COUNT_LONGINT_POINTER;
}
- cp++;
+ cp += 3;
}
#endif
+ (void) pointer_type;
/* Read the conversion character. */
c = *cp++;
@@ -599,26 +600,22 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d,
arguments *a)
if (signed_type == TYPE_LONGINT
/* For backward compatibility only. */
|| signed_type == TYPE_LONGLONGINT)
-#if HAVE_WCHAR_T
type = TYPE_WIDE_STRING;
-#else
- goto error;
-#endif
else
type = TYPE_STRING;
break;
-#if HAVE_WCHAR_T
case 'S':
type = TYPE_WIDE_STRING;
c = 's';
break;
-#endif
case 'p':
type = TYPE_POINTER;
break;
+#if NEED_PRINTF_WITH_N_DIRECTIVE
case 'n':
type = pointer_type;
break;
+#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
case 'U':
diff --git a/gnulib/lib/printf-parse.h b/gnulib/lib/printf-parse.h
index 45febac1f0..949b8754cc 100644
--- a/gnulib/lib/printf-parse.h
+++ b/gnulib/lib/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/pthread-once.c b/gnulib/lib/pthread-once.c
new file mode 100644
index 0000000000..4b4a18d2af
--- /dev/null
+++ b/gnulib/lib/pthread-once.c
@@ -0,0 +1,148 @@
+/* POSIX once-only control.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+#include <config.h>
+
+/* Specification. */
+#include <pthread.h>
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# include "windows-once.h"
+#endif
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+/* Use Windows threads. */
+
+int
+pthread_once (pthread_once_t *once_control, void (*initfunction) (void))
+{
+ glwthread_once (once_control, initfunction);
+ return 0;
+}
+
+#elif HAVE_PTHREAD_H
+/* Provide workarounds for POSIX threads. */
+
+# if defined __CYGWIN__
+
+# include <stdlib.h>
+
+int
+pthread_once (pthread_once_t *once_control, void (*initfunction) (void))
+{
+ /* In this implementation, we reuse the type
+ typedef struct { pthread_mutex_t mutex; int state; } pthread_once_t;
+ #define PTHREAD_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, 0 }
+ while assigning the following meaning to the state:
+ state = (<number of waiting threads> << 16) + <1 if done>
+ In other words:
+ state = { unsigned int num_threads : 16; unsigned int done : 16; }
+ */
+ struct actual_state
+ {
+ _Atomic unsigned short num_threads;
+ /* done == 0: initial state
+ done == 1: initfunction executed, lock still active
+ done == 2: initfunction executed, lock no longer usable */
+ _Atomic unsigned short done;
+ };
+ struct actual_state *state_p = (struct actual_state *) &once_control->state;
+ /* This test is not necessary. It's only an optimization, to establish
+ a fast path for the common case that the 'done' word is already > 0. */
+ if (state_p->done == 0)
+ {
+ /* Increment num_threads (atomically), to indicate that this thread will
+ possibly take the lock. */
+ state_p->num_threads += 1;
+ /* Test the 'done' word. */
+ if (state_p->done == 0)
+ {
+ /* The 'done' word is still zero. Now take the lock. */
+ pthread_mutex_lock (&once_control->mutex);
+ /* Test the 'done' word again. */
+ if (state_p->done == 0)
+ {
+ /* Execute the initfunction. */
+ (*initfunction) ();
+ /* Set the 'done' word to 1 (atomically). */
+ state_p->done = 1;
+ }
+ /* Now the 'done' word is 1. Release the lock. */
+ pthread_mutex_unlock (&once_control->mutex);
+ }
+ /* Here, done is > 0. */
+ /* Decrement num_threads (atomically). */
+ if ((state_p->num_threads -= 1) == 0)
+ {
+ /* num_threads is now zero, and done is > 0.
+ No other thread will need to use the lock.
+ We can therefore destroy the lock, to free resources. */
+ if (__sync_bool_compare_and_swap (&state_p->done, 1, 2))
+ pthread_mutex_destroy (&once_control->mutex);
+ }
+ }
+ /* Proof of correctness:
+ * num_threads is incremented and then decremented by some threads.
+ Therefore, num_threads always stays >= 0, and is == 0 at the end.
+ * The 'done' word, once > 0, stays > 0 (since it is never assigned 0).
+ * The 'done' word is changed from == 0 to > 0 only while the lock
+ is taken. Therefore, only the first thread that succeeds in taking
+ the lock executes the initfunction and sets the 'done' word to a
+ value > 0; the other threads that take the lock do no side effects
+ between taking and releasing the lock.
+ * The 'done' word does not change any more once it is 2.
+ Therefore, it can be changed from 1 to 2 only once.
+ * pthread_mutex_destroy gets invoked right after 'done' has been changed
+ from 1 to 2. Therefore, pthread_mutex_destroy gets invoked only once.
+ * After a moment where num_threads was 0 and done was > 0, no thread can
+ reach the pthread_mutex_lock invocation. Proof:
+ - At such a moment, no thread is in the code range between
+ state_p->num_threads += 1
+ and
+ state_p->num_threads -= 1
+ - After such a moment, some thread can increment num_threads, but from
+ there they cannot reach the pthread_mutex_lock invocation, because the
+ if (state_p->done == 0)
+ test prevents that.
+ * From this it follows that:
+ - pthread_mutex_destroy cannot be executed while the lock is taken
+ (because pthread_mutex_destroy is only executed after a moment where
+ num_threads was 0 and done was > 0).
+ - Once pthread_mutex_destroy has been executed, the lock is not used any
+ more.
+ */
+ return 0;
+}
+
+# endif
+
+#else
+/* Provide a dummy implementation for single-threaded applications. */
+
+int
+pthread_once (pthread_once_t *once_control, void (*initfunction) (void))
+{
+ if (*once_control == 0)
+ {
+ *once_control = ~ 0;
+ initfunction ();
+ }
+ return 0;
+}
+
+#endif
diff --git a/gnulib/lib/pthread.in.h b/gnulib/lib/pthread.in.h
new file mode 100644
index 0000000000..4bf35b5051
--- /dev/null
+++ b/gnulib/lib/pthread.in.h
@@ -0,0 +1,2032 @@
+/* Implement the most essential subset of POSIX pthread.h.
+
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_PTHREAD_H
+/* Special invocation convention:
+ On Android, we have a sequence of nested includes
+ <pthread.h> -> <time.h> -> <sys/time.h> -> <sys/select.h> ->
+ <signal.h> -> <pthread.h>.
+ In this situation, PTHREAD_COND_INITIALIZER is not yet defined,
+ therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc. */
+
+#@INCLUDE_NEXT@ @NEXT_PTHREAD_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_PTHREAD_H_
+
+#if @HAVE_PTHREAD_H@
+
+# define _GL_ALREADY_INCLUDING_PTHREAD_H
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_PTHREAD_H@
+
+# undef _GL_ALREADY_INCLUDING_PTHREAD_H
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_PTHREAD_H_
+#define _@GUARD_PREFIX@_PTHREAD_H_
+
+/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
+ HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+#define __need_system_stdlib_h
+#include <stdlib.h>
+#undef __need_system_stdlib_h
+
+
+/* The pthreads-win32 <pthread.h> defines a couple of broken macros. */
+#undef asctime_r
+#undef ctime_r
+#undef gmtime_r
+#undef localtime_r
+#undef rand_r
+#undef strtok_r
+
+#include <errno.h>
+#include <sched.h>
+#include <sys/types.h>
+#include <time.h>
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined
__clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _Noreturn is copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* =========== Thread types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_THREAD@
+# include "windows-thread.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_t rpl_pthread_t
+# define pthread_attr_t rpl_pthread_attr_t
+# endif
+# if !GNULIB_defined_pthread_thread_types
+typedef glwthread_thread_t pthread_t;
+typedef unsigned int pthread_attr_t;
+# define GNULIB_defined_pthread_thread_types 1
+# endif
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_t rpl_pthread_t
+# define pthread_attr_t rpl_pthread_attr_t
+# endif
+# if !GNULIB_defined_pthread_thread_types
+typedef int pthread_t;
+typedef unsigned int pthread_attr_t;
+# define GNULIB_defined_pthread_thread_types 1
+# endif
+# endif
+# undef PTHREAD_CREATE_JOINABLE
+# undef PTHREAD_CREATE_DETACHED
+# define PTHREAD_CREATE_JOINABLE 0
+# define PTHREAD_CREATE_DETACHED 1
+#else
+# if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_thread_types
+typedef int pthread_t;
+typedef unsigned int pthread_attr_t;
+# define GNULIB_defined_pthread_thread_types 1
+# endif
+# endif
+# if !@HAVE_PTHREAD_CREATE_DETACHED@
+# define PTHREAD_CREATE_JOINABLE 0
+# define PTHREAD_CREATE_DETACHED 1
+# endif
+#endif
+
+/* =========== Once-only control (initialization) types and macros ==========
*/
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_ONCE@
+# include "windows-once.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_once_t rpl_pthread_once_t
+# endif
+# if !GNULIB_defined_pthread_once_types
+typedef glwthread_once_t pthread_once_t;
+# define GNULIB_defined_pthread_once_types 1
+# endif
+# undef PTHREAD_ONCE_INIT
+# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_once_t rpl_pthread_once_t
+# endif
+# if !GNULIB_defined_pthread_once_types
+typedef int pthread_once_t;
+# define GNULIB_defined_pthread_once_types 1
+# endif
+# undef PTHREAD_ONCE_INIT
+# define PTHREAD_ONCE_INIT { 0 }
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_once_types
+typedef int pthread_once_t;
+# define GNULIB_defined_pthread_once_types 1
+# endif
+# undef PTHREAD_ONCE_INIT
+# define PTHREAD_ONCE_INIT { 0 }
+# endif
+#endif
+
+/* =========== Mutex types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_MUTEX@
+# include "windows-timedmutex.h"
+# include "windows-timedrecmutex.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_mutex_t rpl_pthread_mutex_t
+# define pthread_mutexattr_t rpl_pthread_mutexattr_t
+# endif
+# if !GNULIB_defined_pthread_mutex_types
+typedef struct
+ {
+ int type;
+ union
+ {
+ glwthread_timedmutex_t u_timedmutex;
+ glwthread_timedrecmutex_t u_timedrecmutex;
+ }
+ u;
+ }
+ pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+# define GNULIB_defined_pthread_mutex_types 1
+# endif
+# undef PTHREAD_MUTEX_INITIALIZER
+# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } }
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_mutex_t rpl_pthread_mutex_t
+# define pthread_mutexattr_t rpl_pthread_mutexattr_t
+# endif
+# if !GNULIB_defined_pthread_mutex_types
+typedef int pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+# define GNULIB_defined_pthread_mutex_types 1
+# endif
+# undef PTHREAD_MUTEX_INITIALIZER
+# define PTHREAD_MUTEX_INITIALIZER { 0 }
+# endif
+# undef PTHREAD_MUTEX_DEFAULT
+# undef PTHREAD_MUTEX_NORMAL
+# undef PTHREAD_MUTEX_ERRORCHECK
+# undef PTHREAD_MUTEX_RECURSIVE
+# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
+# define PTHREAD_MUTEX_NORMAL 0
+# define PTHREAD_MUTEX_ERRORCHECK 1
+# define PTHREAD_MUTEX_RECURSIVE 2
+# undef PTHREAD_MUTEX_STALLED
+# undef PTHREAD_MUTEX_ROBUST
+# define PTHREAD_MUTEX_STALLED 0
+# define PTHREAD_MUTEX_ROBUST 1
+#else
+# if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_mutex_types
+typedef int pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+# define GNULIB_defined_pthread_mutex_types 1
+# endif
+# undef PTHREAD_MUTEX_INITIALIZER
+# define PTHREAD_MUTEX_INITIALIZER { 0 }
+# endif
+# if !@HAVE_PTHREAD_MUTEX_RECURSIVE@
+# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
+# define PTHREAD_MUTEX_NORMAL 0
+# define PTHREAD_MUTEX_ERRORCHECK 1
+# define PTHREAD_MUTEX_RECURSIVE 2
+# endif
+# if !@HAVE_PTHREAD_MUTEX_ROBUST@
+# define PTHREAD_MUTEX_STALLED 0
+# define PTHREAD_MUTEX_ROBUST 1
+# endif
+#endif
+
+/* =========== Read-write lock types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_RWLOCK@
+# include "windows-timedrwlock.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_rwlock_t rpl_pthread_rwlock_t
+# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
+typedef glwthread_timedrwlock_t pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_rwlock_t rpl_pthread_rwlock_t
+# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
+typedef int pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER { 0 }
+# endif
+#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_DESTROY@ /* i.e.
PTHREAD_RWLOCK_UNIMPLEMENTED */
+# if @HAVE_PTHREAD_T@
+# define pthread_rwlock_t rpl_pthread_rwlock_t
+# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
+typedef struct
+ {
+ pthread_mutex_t lock; /* protects the remaining fields */
+ pthread_cond_t waiting_readers; /* waiting readers */
+ pthread_cond_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs
*/
+ }
+ pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER,
PTHREAD_COND_INITIALIZER, 0, 0 }
+#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_INIT@ /* i.e.
PTHREAD_RWLOCK_BAD_WAITQUEUE */
+/* Use rwlocks of kind PREFER_WRITER or PREFER_WRITER_NONRECURSIVE instead of
+ the DEFAULT. */
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+#else
+# if @HAVE_PTHREAD_T@
+# if !defined PTHREAD_RWLOCK_INITIALIZER && defined
PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */
+# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP
+# endif
+# else
+# if !GNULIB_defined_pthread_rwlock_types
+typedef int pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER { 0 }
+# endif
+#endif
+
+/* =========== Condition variable types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_COND@
+# include "windows-cond.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_cond_t rpl_pthread_cond_t
+# define pthread_condattr_t rpl_pthread_condattr_t
+# endif
+# if !GNULIB_defined_pthread_cond_types
+typedef glwthread_cond_t pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+# define GNULIB_defined_pthread_cond_types 1
+# endif
+# undef PTHREAD_COND_INITIALIZER
+# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_cond_t rpl_pthread_cond_t
+# define pthread_condattr_t rpl_pthread_condattr_t
+# endif
+# if !GNULIB_defined_pthread_cond_types
+typedef int pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+# define GNULIB_defined_pthread_cond_types 1
+# endif
+# undef PTHREAD_COND_INITIALIZER
+# define PTHREAD_COND_INITIALIZER { 0 }
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_cond_types
+typedef int pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+# define GNULIB_defined_pthread_cond_types 1
+# endif
+# undef PTHREAD_COND_INITIALIZER
+# define PTHREAD_COND_INITIALIZER { 0 }
+# endif
+#endif
+
+/* =========== Thread-specific storage types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_TSS@
+# include "windows-tls.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_key_t rpl_pthread_key_t
+# endif
+# if !GNULIB_defined_pthread_tss_types
+typedef glwthread_tls_key_t pthread_key_t;
+# define GNULIB_defined_pthread_tss_types 1
+# endif
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_key_t rpl_pthread_key_t
+# endif
+# if !GNULIB_defined_pthread_tss_types
+typedef void ** pthread_key_t;
+# define GNULIB_defined_pthread_tss_types 1
+# endif
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# define PTHREAD_DESTRUCTOR_ITERATIONS 0
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_tss_types
+typedef void ** pthread_key_t;
+# define GNULIB_defined_pthread_tss_types 1
+# endif
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# define PTHREAD_DESTRUCTOR_ITERATIONS 0
+# endif
+#endif
+
+/* =========== Spinlock types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_SPIN@
+# include "windows-spin.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_spinlock_t rpl_pthread_spinlock_t
+# endif
+# if !GNULIB_defined_pthread_spin_types
+typedef glwthread_spinlock_t pthread_spinlock_t;
+# define GNULIB_defined_pthread_spin_types 1
+# endif
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_spinlock_t rpl_pthread_spinlock_t
+# endif
+# if !GNULIB_defined_pthread_spin_types
+typedef pthread_mutex_t pthread_spinlock_t;
+# define GNULIB_defined_pthread_spin_types 1
+# endif
+# endif
+# undef PTHREAD_PROCESS_PRIVATE
+# undef PTHREAD_PROCESS_SHARED
+# define PTHREAD_PROCESS_PRIVATE 0
+# define PTHREAD_PROCESS_SHARED 1
+#else
+# if @HAVE_PTHREAD_SPINLOCK_T@
+/* <pthread.h> exists and defines pthread_spinlock_t. */
+# if !@HAVE_PTHREAD_SPIN_INIT@ || @REPLACE_PTHREAD_SPIN_INIT@
+/* If the 'pthread-spin' module is in use, it defines all the pthread_spin*
+ functions. Prepare for it by overriding pthread_spinlock_t if that might
+ be needed. */
+# if !(((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \
+ || __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__
>= 1)) \
+ || (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
+ && !defined __ANDROID__) \
+ || __clang_major__ >= 3)) \
+ && !defined __ibmxl__)
+/* We can't use GCC built-ins. Approximate spinlocks with mutexes. */
+# if !GNULIB_defined_pthread_spin_types
+# define pthread_spinlock_t pthread_mutex_t
+# define GNULIB_defined_pthread_spin_types 1
+# endif
+# endif
+# endif
+# else
+/* Approximate spinlocks with mutexes. */
+# if !GNULIB_defined_pthread_spin_types
+typedef pthread_mutex_t pthread_spinlock_t;
+# define GNULIB_defined_pthread_spin_types 1
+# endif
+# endif
+# if !@HAVE_PTHREAD_PROCESS_SHARED@
+# define PTHREAD_PROCESS_PRIVATE 0
+# define PTHREAD_PROCESS_SHARED 1
+# endif
+#endif
+
+/* =========== Other types and macros =========== */
+
+#if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_other_pthread_types
+typedef int pthread_barrier_t;
+typedef unsigned int pthread_barrierattr_t;
+# define GNULIB_defined_other_pthread_types 1
+# endif
+#endif
+
+#if !defined PTHREAD_CANCELED
+
+# define PTHREAD_BARRIER_SERIAL_THREAD (-1)
+
+# define PTHREAD_CANCEL_DEFERRED 0
+# define PTHREAD_CANCEL_ASYNCHRONOUS 1
+
+# define PTHREAD_CANCEL_ENABLE 0
+# define PTHREAD_CANCEL_DISABLE 1
+
+# define PTHREAD_CANCELED ((void *) -1)
+
+# define PTHREAD_INHERIT_SCHED 0
+# define PTHREAD_EXPLICIT_SCHED 1
+
+# define PTHREAD_PRIO_NONE 0
+# define PTHREAD_PRIO_INHERIT 1
+# define PTHREAD_PRIO_PROTECT 2
+
+# define PTHREAD_SCOPE_SYSTEM 0
+# define PTHREAD_SCOPE_PROCESS 1
+
+#endif
+
+/* =========== Thread functions =========== */
+
+#if @GNULIB_PTHREAD_THREAD@
+/* The 'restrict' qualifier on ARG is nonsense, but POSIX specifies it this
way.
+ Sigh. */
+# if @REPLACE_PTHREAD_CREATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_create
+# define pthread_create rpl_pthread_create
+# endif
+_GL_FUNCDECL_RPL (pthread_create, int,
+ (pthread_t *restrict threadp,
+ const pthread_attr_t *restrict attr,
+ void * (*mainfunc) (void *), void *restrict arg),
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (pthread_create, int,
+ (pthread_t *restrict threadp,
+ const pthread_attr_t *restrict attr,
+ void * (*mainfunc) (void *), void *restrict arg));
+# else
+# if !@HAVE_PTHREAD_CREATE@
+_GL_FUNCDECL_SYS (pthread_create, int,
+ (pthread_t *restrict threadp,
+ const pthread_attr_t *restrict attr,
+ void * (*mainfunc) (void *), void *restrict arg),
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS_CAST (pthread_create, int,
+ (pthread_t *restrict threadp,
+ const pthread_attr_t *restrict attr,
+ void * (*mainfunc) (void *), void *restrict arg));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_create);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_create
+# if HAVE_RAW_DECL_PTHREAD_CREATE
+_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_attr_init
+# define pthread_attr_init rpl_pthread_attr_init
+# endif
+_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr));
+# else
+# if !@HAVE_PTHREAD_ATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_init
+# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT
+_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_attr_getdetachstate
+# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate
+# endif
+_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int,
+ (const pthread_attr_t *attr, int *detachstatep),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int,
+ (const pthread_attr_t *attr, int *detachstatep));
+# else
+# if !@HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int,
+ (const pthread_attr_t *attr, int *detachstatep),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int,
+ (const pthread_attr_t *attr, int *detachstatep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_getdetachstate);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_getdetachstate
+# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE
+_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is
not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_attr_setdetachstate
+# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate
+# endif
+_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int,
+ (pthread_attr_t *attr, int detachstate),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int,
+ (pthread_attr_t *attr, int detachstate));
+# else
+# if !@HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int,
+ (pthread_attr_t *attr, int detachstate),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int,
+ (pthread_attr_t *attr, int detachstate));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_setdetachstate);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_setdetachstate
+# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE
+_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is
not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_attr_destroy
+# define pthread_attr_destroy rpl_pthread_attr_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr));
+# else
+# if !@HAVE_PTHREAD_ATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_destroy
+# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY
+_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable -
"
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_SELF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_self
+# define pthread_self rpl_pthread_self
+# endif
+_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void));
+# else
+# if !@HAVE_PTHREAD_SELF@
+_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_self);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_self
+# if HAVE_RAW_DECL_PTHREAD_SELF
+_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_EQUAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_equal
+# define pthread_equal rpl_pthread_equal
+# endif
+_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+# else
+# if !@HAVE_PTHREAD_EQUAL@
+_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+# endif
+_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_equal);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_equal
+# if HAVE_RAW_DECL_PTHREAD_EQUAL
+_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_DETACH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_detach
+# define pthread_detach rpl_pthread_detach
+# endif
+_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread));
+_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread));
+# else
+# if !@HAVE_PTHREAD_DETACH@
+_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread));
+# endif
+_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_detach);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_detach
+# if HAVE_RAW_DECL_PTHREAD_DETACH
+_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_JOIN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_join
+# define pthread_join rpl_pthread_join
+# endif
+_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep));
+_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep));
+# else
+# if !@HAVE_PTHREAD_JOIN@
+_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep));
+# endif
+_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_join);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_join
+# if HAVE_RAW_DECL_PTHREAD_JOIN
+_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_EXIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_exit
+# define pthread_exit rpl_pthread_exit
+# endif
+_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value));
+_GL_CXXALIAS_RPL (pthread_exit, void, (void *value));
+# else
+# if !@HAVE_PTHREAD_EXIT@
+_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value));
+# endif
+/* Need to cast because of AIX with xlclang++. */
+_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_exit);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_exit
+# if HAVE_RAW_DECL_PTHREAD_EXIT
+_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - "
+ "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+/* =========== Once-only control (initialization) functions =========== */
+
+#if @GNULIB_PTHREAD_ONCE@
+# if @REPLACE_PTHREAD_ONCE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_once
+# define pthread_once rpl_pthread_once
+# endif
+_GL_FUNCDECL_RPL (pthread_once, int,
+ (pthread_once_t *once_control, void (*initfunction) (void)),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_once, int,
+ (pthread_once_t *once_control, void (*initfunction) (void)));
+# else
+# if !@HAVE_PTHREAD_ONCE@
+_GL_FUNCDECL_SYS (pthread_once, int,
+ (pthread_once_t *once_control, void (*initfunction) (void)),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS_CAST (pthread_once, int,
+ (pthread_once_t *once_control,
+ void (*initfunction) (void)));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_once);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_once
+# if HAVE_RAW_DECL_PTHREAD_ONCE
+_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - "
+ "use gnulib module pthread-once for portability");
+# endif
+#endif
+
+/* =========== Mutex functions =========== */
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_init
+# define pthread_mutex_init rpl_pthread_mutex_init
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_init, int,
+ (pthread_mutex_t *restrict mutex,
+ const pthread_mutexattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_init, int,
+ (pthread_mutex_t *restrict mutex,
+ const pthread_mutexattr_t *restrict attr));
+# else
+# if !@HAVE_PTHREAD_MUTEX_INIT@
+_GL_FUNCDECL_SYS (pthread_mutex_init, int,
+ (pthread_mutex_t *restrict mutex,
+ const pthread_mutexattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_init, int,
+ (pthread_mutex_t *restrict mutex,
+ const pthread_mutexattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_init
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT
+_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_init
+# define pthread_mutexattr_init rpl_pthread_mutexattr_init
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_init
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT
+_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not
portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_gettype
+# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict typep),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict typep));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict typep),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on FreeBSD the first parameter is
+ pthread_mutexattr_t *attr. */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict typep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_gettype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_gettype
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE
+_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not
portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_settype
+# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int,
+ (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL
((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int,
+ (pthread_mutexattr_t *attr, int type));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int,
+ (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL
((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int,
+ (pthread_mutexattr_t *attr, int type));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_settype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_settype
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE
+_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not
portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_getrobust
+# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict robustp),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict robustp));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict robustp),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on FreeBSD the first parameter is
+ pthread_mutexattr_t *attr. */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int,
+ (const pthread_mutexattr_t *restrict attr,
+ int *restrict robustp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_getrobust);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_getrobust
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST
+_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is
not portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_setrobust
+# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int,
+ (pthread_mutexattr_t *attr, int robust),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int,
+ (pthread_mutexattr_t *attr, int robust));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int,
+ (pthread_mutexattr_t *attr, int robust),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int,
+ (pthread_mutexattr_t *attr, int robust));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_setrobust);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_setrobust
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST
+_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is
not portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutexattr_destroy
+# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_MUTEXATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY
+_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not
portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_LOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_lock
+# define pthread_mutex_lock rpl_pthread_mutex_lock
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
+# else
+# if !@HAVE_PTHREAD_MUTEX_LOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_lock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_lock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK
+_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_trylock
+# define pthread_mutex_trylock rpl_pthread_mutex_trylock
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
+# else
+# if !@HAVE_PTHREAD_MUTEX_TRYLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_trylock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_trylock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK
+_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable
- "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+# if @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_timedlock
+# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int,
+ (pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int,
+ (pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime));
+# else
+# if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int,
+ (pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int,
+ (pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_timedlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_timedlock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK
+_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not
portable - "
+ "use gnulib module pthread_mutex_timedlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_UNLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_unlock
+# define pthread_mutex_unlock rpl_pthread_mutex_unlock
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
+# else
+# if !@HAVE_PTHREAD_MUTEX_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_unlock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK
+_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable -
"
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_mutex_destroy
+# define pthread_mutex_destroy rpl_pthread_mutex_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
+# else
+# if !@HAVE_PTHREAD_MUTEX_DESTROY@
+_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_destroy
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY
+_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable
- "
+ "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+/* =========== Read-write lock functions =========== */
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_init
+# define pthread_rwlock_init rpl_pthread_rwlock_init
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_init, int,
+ (pthread_rwlock_t *restrict lock,
+ const pthread_rwlockattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_init, int,
+ (pthread_rwlock_t *restrict lock,
+ const pthread_rwlockattr_t *restrict attr));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_INIT@
+_GL_FUNCDECL_SYS (pthread_rwlock_init, int,
+ (pthread_rwlock_t *restrict lock,
+ const pthread_rwlockattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_init, int,
+ (pthread_rwlock_t *restrict lock,
+ const pthread_rwlockattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_init
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT
+_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlockattr_init
+# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_RWLOCKATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlockattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlockattr_init
+# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT
+_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not
portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlockattr_destroy
+# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int,
+ (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int,
+ (pthread_rwlockattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int,
+ (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int,
+ (pthread_rwlockattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlockattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlockattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY
+_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is
not portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_rdlock
+# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_RDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_rdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_rdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable
- "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_wrlock
+# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_WRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_wrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_wrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable
- "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_tryrdlock
+# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_tryrdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_tryrdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not
portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_trywrlock
+# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_trywrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_trywrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not
portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_timedrdlock
+# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_timedrdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_timedrdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is
not portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_timedwrlock
+# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int,
+ (pthread_rwlock_t *restrict lock,
+ const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_timedwrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_timedwrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is
not portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_unlock
+# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_unlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK
+_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable
- "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_rwlock_destroy
+# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_RWLOCK_DESTROY@
+_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_destroy
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY
+_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not
portable - "
+ "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+/* =========== Condition variable functions =========== */
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_init
+# define pthread_cond_init rpl_pthread_cond_init
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_init, int,
+ (pthread_cond_t *restrict cond,
+ const pthread_condattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_init, int,
+ (pthread_cond_t *restrict cond,
+ const pthread_condattr_t *restrict attr));
+# else
+# if !@HAVE_PTHREAD_COND_INIT@
+_GL_FUNCDECL_SYS (pthread_cond_init, int,
+ (pthread_cond_t *restrict cond,
+ const pthread_condattr_t *restrict attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_init, int,
+ (pthread_cond_t *restrict cond,
+ const pthread_condattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_init
+# if HAVE_RAW_DECL_PTHREAD_COND_INIT
+_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_CONDATTR_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_condattr_init
+# define pthread_condattr_init rpl_pthread_condattr_init
+# endif
+_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_CONDATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_condattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_condattr_init
+# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT
+_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable
- "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_CONDATTR_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_condattr_destroy
+# define pthread_condattr_destroy rpl_pthread_condattr_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
+# else
+# if !@HAVE_PTHREAD_CONDATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_condattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_condattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY
+_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not
portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_WAIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_wait
+# define pthread_cond_wait rpl_pthread_cond_wait
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_wait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex),
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_cond_wait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex));
+# else
+# if !@HAVE_PTHREAD_COND_WAIT@
+_GL_FUNCDECL_SYS (pthread_cond_wait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex),
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_wait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_wait);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_wait
+# if HAVE_RAW_DECL_PTHREAD_COND_WAIT
+_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_TIMEDWAIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_timedwait
+# define pthread_cond_timedwait rpl_pthread_cond_timedwait
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_timedwait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (pthread_cond_timedwait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime));
+# else
+# if !@HAVE_PTHREAD_COND_TIMEDWAIT@
+_GL_FUNCDECL_SYS (pthread_cond_timedwait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime),
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_timedwait, int,
+ (pthread_cond_t *restrict cond,
+ pthread_mutex_t *restrict mutex,
+ const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_timedwait);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_timedwait
+# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT
+_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not
portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_SIGNAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_signal
+# define pthread_cond_signal rpl_pthread_cond_signal
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond));
+# else
+# if !@HAVE_PTHREAD_COND_SIGNAL@
+_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_signal);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_signal
+# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL
+_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_BROADCAST@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_broadcast
+# define pthread_cond_broadcast rpl_pthread_cond_broadcast
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond));
+# else
+# if !@HAVE_PTHREAD_COND_BROADCAST@
+_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_broadcast);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_broadcast
+# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST
+_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not
portable - "
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_cond_destroy
+# define pthread_cond_destroy rpl_pthread_cond_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond));
+# else
+# if !@HAVE_PTHREAD_COND_DESTROY@
+_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_destroy
+# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY
+_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable -
"
+ "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+/* =========== Thread-specific storage functions =========== */
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_KEY_CREATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_key_create
+# define pthread_key_create rpl_pthread_key_create
+# endif
+_GL_FUNCDECL_RPL (pthread_key_create, int,
+ (pthread_key_t *keyp, void (*destructor) (void *)),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_key_create, int,
+ (pthread_key_t *keyp, void (*destructor) (void *)));
+# else
+# if !@HAVE_PTHREAD_KEY_CREATE@
+_GL_FUNCDECL_SYS (pthread_key_create, int,
+ (pthread_key_t *keyp, void (*destructor) (void *)),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS_CAST (pthread_key_create, int,
+ (pthread_key_t *keyp, void (*destructor) (void *)));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_key_create);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_key_create
+# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE
+_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - "
+ "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_SETSPECIFIC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_setspecific
+# define pthread_setspecific rpl_pthread_setspecific
+# endif
+_GL_FUNCDECL_RPL (pthread_setspecific, int,
+ (pthread_key_t key, const void *value));
+_GL_CXXALIAS_RPL (pthread_setspecific, int,
+ (pthread_key_t key, const void *value));
+# else
+# if !@HAVE_PTHREAD_SETSPECIFIC@
+_GL_FUNCDECL_SYS (pthread_setspecific, int,
+ (pthread_key_t key, const void *value));
+# endif
+_GL_CXXALIAS_SYS (pthread_setspecific, int,
+ (pthread_key_t key, const void *value));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_setspecific);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_setspecific
+# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC
+_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - "
+ "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_GETSPECIFIC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_getspecific
+# define pthread_getspecific rpl_pthread_getspecific
+# endif
+_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key));
+_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key));
+# else
+# if !@HAVE_PTHREAD_GETSPECIFIC@
+_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key));
+# endif
+_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_getspecific);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_getspecific
+# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC
+_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - "
+ "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_KEY_DELETE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_key_delete
+# define pthread_key_delete rpl_pthread_key_delete
+# endif
+_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key));
+_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key));
+# else
+# if !@HAVE_PTHREAD_KEY_DELETE@
+_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key));
+# endif
+_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_key_delete);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_key_delete
+# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE
+_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - "
+ "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+/* =========== Spinlock functions =========== */
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_INIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_spin_init
+# define pthread_spin_init rpl_pthread_spin_init
+# endif
+_GL_FUNCDECL_RPL (pthread_spin_init, int,
+ (pthread_spinlock_t *lock, int shared_across_processes),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_init, int,
+ (pthread_spinlock_t *lock, int shared_across_processes));
+# else
+# if !@HAVE_PTHREAD_SPIN_INIT@
+_GL_FUNCDECL_SYS (pthread_spin_init, int,
+ (pthread_spinlock_t *lock, int shared_across_processes),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_spin_init, int,
+ (pthread_spinlock_t *lock, int shared_across_processes));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_init
+# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT
+_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - "
+ "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_LOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_spin_lock
+# define pthread_spin_lock rpl_pthread_spin_lock
+# endif
+_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_SPIN_LOCK@
+_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_lock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_lock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK
+_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - "
+ "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_TRYLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_spin_trylock
+# define pthread_spin_trylock rpl_pthread_spin_trylock
+# endif
+_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_SPIN_TRYLOCK@
+_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_trylock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_trylock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK
+_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable -
"
+ "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_UNLOCK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_spin_unlock
+# define pthread_spin_unlock rpl_pthread_spin_unlock
+# endif
+_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_SPIN_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_unlock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK
+_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - "
+ "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_DESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_spin_destroy
+# define pthread_spin_destroy rpl_pthread_spin_destroy
+# endif
+_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
+# else
+# if !@HAVE_PTHREAD_SPIN_DESTROY@
+_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_destroy
+# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY
+_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable -
"
+ "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+
+#if defined __cplusplus && defined GNULIB_NAMESPACE && !@HAVE_PTHREAD_H@ &&
defined __MINGW32__
+/* Provide the symbols required by mingw's <bits/gthr-default.h>. */
+using GNULIB_NAMESPACE::pthread_create;
+using GNULIB_NAMESPACE::pthread_self;
+using GNULIB_NAMESPACE::pthread_equal;
+using GNULIB_NAMESPACE::pthread_detach;
+using GNULIB_NAMESPACE::pthread_join;
+using GNULIB_NAMESPACE::pthread_once;
+using GNULIB_NAMESPACE::pthread_mutex_init;
+using GNULIB_NAMESPACE::pthread_mutexattr_init;
+using GNULIB_NAMESPACE::pthread_mutexattr_settype;
+using GNULIB_NAMESPACE::pthread_mutexattr_destroy;
+using GNULIB_NAMESPACE::pthread_mutex_lock;
+using GNULIB_NAMESPACE::pthread_mutex_trylock;
+using GNULIB_NAMESPACE::pthread_mutex_timedlock;
+using GNULIB_NAMESPACE::pthread_mutex_unlock;
+using GNULIB_NAMESPACE::pthread_mutex_destroy;
+using GNULIB_NAMESPACE::pthread_cond_wait;
+using GNULIB_NAMESPACE::pthread_cond_timedwait;
+using GNULIB_NAMESPACE::pthread_cond_signal;
+using GNULIB_NAMESPACE::pthread_cond_broadcast;
+using GNULIB_NAMESPACE::pthread_cond_destroy;
+using GNULIB_NAMESPACE::pthread_key_create;
+using GNULIB_NAMESPACE::pthread_setspecific;
+using GNULIB_NAMESPACE::pthread_getspecific;
+using GNULIB_NAMESPACE::pthread_key_delete;
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
+#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
+#endif
diff --git a/gnulib/lib/realloc.c b/gnulib/lib/realloc.c
index 1063eb0987..0573139625 100644
--- a/gnulib/lib/realloc.c
+++ b/gnulib/lib/realloc.c
@@ -1,6 +1,6 @@
/* realloc() function that is glibc compatible.
- Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2023 Free Software
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/reallocarray.c b/gnulib/lib/reallocarray.c
index 8c99250f7f..09711a0ede 100644
--- a/gnulib/lib/reallocarray.c
+++ b/gnulib/lib/reallocarray.c
@@ -1,6 +1,6 @@
/* reallocarray function that is glibc compatible.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/regcomp.c b/gnulib/lib/regcomp.c
index 1f6a131107..696cf813f3 100644
--- a/gnulib/lib/regcomp.c
+++ b/gnulib/lib/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gnulib/lib/regex.c b/gnulib/lib/regex.c
index 3beb0deb98..4b1a6ed68e 100644
--- a/gnulib/lib/regex.c
+++ b/gnulib/lib/regex.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -26,10 +26,6 @@
# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
# pragma GCC diagnostic ignored "-Wvla"
# endif
-# if __GNUC_PREREQ (4, 3)
-# pragma GCC diagnostic ignored "-Wold-style-definition"
-# pragma GCC diagnostic ignored "-Wtype-limits"
-# endif
#endif
/* Make sure no one compiles this code with a C++ compiler. */
diff --git a/gnulib/lib/regex.h b/gnulib/lib/regex.h
index 9ef0252fff..ccf40cebc0 100644
--- a/gnulib/lib/regex.h
+++ b/gnulib/lib/regex.h
@@ -1,6 +1,6 @@
/* Definitions for data structures and routines for the regular
expression library.
- Copyright (C) 1985, 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/gnulib/lib/regex_internal.c b/gnulib/lib/regex_internal.c
index 998a19b724..8cd096ebcf 100644
--- a/gnulib/lib/regex_internal.c
+++ b/gnulib/lib/regex_internal.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gnulib/lib/regex_internal.h b/gnulib/lib/regex_internal.h
index 7e35a112ec..6165cb17c7 100644
--- a/gnulib/lib/regex_internal.h
+++ b/gnulib/lib/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gnulib/lib/regexec.c b/gnulib/lib/regexec.c
index f05f38ae0e..9f065dfa02 100644
--- a/gnulib/lib/regexec.c
+++ b/gnulib/lib/regexec.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gnulib/lib/sched.in.h b/gnulib/lib/sched.in.h
new file mode 100644
index 0000000000..838fb12bdc
--- /dev/null
+++ b/gnulib/lib/sched.in.h
@@ -0,0 +1,111 @@
+/* A GNU-like <sched.h>.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_SCHED_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_SCHED_H@
+# if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+# endif
+# @INCLUDE_NEXT@ @NEXT_SCHED_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SCHED_H
+#define _@GUARD_PREFIX@_SCHED_H
+
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+/* Get pid_t.
+ This is needed on glibc 2.11 (see
+ glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=13198>)
+ and Mac OS X 10.5. */
+#include <sys/types.h>
+
+#ifdef __KLIBC__
+/* On OS/2 kLIBC, struct sched_param is in spawn.h. */
+# include <spawn.h>
+#endif
+
+#ifdef __VMS
+/* On OpenVMS, struct sched_param is in <pthread.h>. */
+# include <pthread.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#if !@HAVE_STRUCT_SCHED_PARAM@
+
+# if !GNULIB_defined_struct_sched_param
+struct sched_param
+{
+ int sched_priority;
+};
+# define GNULIB_defined_struct_sched_param 1
+# endif
+
+#endif
+
+#if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER)
+# define SCHED_FIFO 1
+# define SCHED_RR 2
+# define SCHED_OTHER 0
+#endif
+
+#if @GNULIB_SCHED_YIELD@
+# if @REPLACE_SCHED_YIELD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sched_yield
+# define sched_yield rpl_sched_yield
+# endif
+_GL_FUNCDECL_RPL (sched_yield, int, (void));
+_GL_CXXALIAS_RPL (sched_yield, int, (void));
+# else
+# if !@HAVE_SCHED_YIELD@
+_GL_FUNCDECL_SYS (sched_yield, int, (void));
+# endif
+_GL_CXXALIAS_SYS (sched_yield, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sched_yield);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sched_yield
+# if HAVE_RAW_DECL_SCHED_YIELD
+_GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - "
+ "use gnulib module sched_yield for portability");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_SCHED_H */
+#endif /* _@GUARD_PREFIX@_SCHED_H */
diff --git a/gnulib/lib/setlocale-lock.c b/gnulib/lib/setlocale-lock.c
index 593f63711b..192489c4ab 100644
--- a/gnulib/lib/setlocale-lock.c
+++ b/gnulib/lib/setlocale-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by setlocale_null_r.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,9 +18,10 @@
#include <config.h>
+/* The option '--disable-threads' explicitly requests no locking. */
/* When it is known that the gl_get_setlocale_null_lock function is defined
by a dependency library, it should not be defined here. */
-#if OMIT_SETLOCALE_LOCK
+#if AVOID_ANY_THREADS || OMIT_SETLOCALE_LOCK
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
diff --git a/gnulib/lib/setlocale_null-unlocked.c
b/gnulib/lib/setlocale_null-unlocked.c
new file mode 100644
index 0000000000..0a86f0df78
--- /dev/null
+++ b/gnulib/lib/setlocale_null-unlocked.c
@@ -0,0 +1,149 @@
+/* Query the name of the current global locale, without locking.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+#include <config.h>
+
+/* Specification. */
+#include "setlocale_null.h"
+
+#include <errno.h>
+#include <locale.h>
+#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <wchar.h>
+#endif
+
+/* Use the system's setlocale() function, not the gnulib override, here. */
+#undef setlocale
+
+const char *
+setlocale_null_unlocked (int category)
+{
+ const char *result = setlocale (category, NULL);
+
+#ifdef __ANDROID__
+ if (result == NULL)
+ switch (category)
+ {
+ case LC_CTYPE:
+ case LC_NUMERIC:
+ case LC_TIME:
+ case LC_COLLATE:
+ case LC_MONETARY:
+ case LC_MESSAGES:
+ case LC_ALL:
+ case LC_PAPER:
+ case LC_NAME:
+ case LC_ADDRESS:
+ case LC_TELEPHONE:
+ case LC_MEASUREMENT:
+ result = "C";
+ break;
+ default:
+ break;
+ }
+#endif
+
+ return result;
+}
+
+int
+setlocale_null_r_unlocked (int category, char *buf, size_t bufsize)
+{
+#if defined _WIN32 && !defined __CYGWIN__ && defined _MSC_VER
+ /* On native Windows, nowadays, the setlocale() implementation is based
+ on _wsetlocale() and uses malloc() for the result. We are better off
+ using _wsetlocale() directly. */
+ const wchar_t *result = _wsetlocale (category, NULL);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = wcslen (result);
+ if (length < bufsize)
+ {
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i <= length; i++)
+ buf[i] = result[i];
+
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i < bufsize; i++)
+ buf[i] = result[i];
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#else
+ const char *result = setlocale_null_unlocked (category);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = strlen (result);
+ if (length < bufsize)
+ {
+ memcpy (buf, result, length + 1);
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ memcpy (buf, result, bufsize - 1);
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#endif
+}
diff --git a/gnulib/lib/setlocale_null.c b/gnulib/lib/setlocale_null.c
index 89c8a06598..5ecf413de0 100644
--- a/gnulib/lib/setlocale_null.c
+++ b/gnulib/lib/setlocale_null.c
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,12 +25,14 @@
#include <locale.h>
#include <stdlib.h>
#include <string.h>
-#if defined _WIN32 && !defined __CYGWIN__
-# include <wchar.h>
-#endif
#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE)
-# if defined _WIN32 && !defined __CYGWIN__
+
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+
+# elif defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
@@ -51,148 +53,34 @@
# include <threads.h>
# endif
-#endif
-/* Use the system's setlocale() function, not the gnulib override, here. */
-#undef setlocale
-
-static const char *
-setlocale_null_androidfix (int category)
-{
- const char *result = setlocale (category, NULL);
-
-#ifdef __ANDROID__
- if (result == NULL)
- switch (category)
- {
- case LC_CTYPE:
- case LC_NUMERIC:
- case LC_TIME:
- case LC_COLLATE:
- case LC_MONETARY:
- case LC_MESSAGES:
- case LC_ALL:
- case LC_PAPER:
- case LC_NAME:
- case LC_ADDRESS:
- case LC_TELEPHONE:
- case LC_MEASUREMENT:
- result = "C";
- break;
- default:
- break;
- }
#endif
- return result;
-}
-
-static int
-setlocale_null_unlocked (int category, char *buf, size_t bufsize)
-{
-#if defined _WIN32 && !defined __CYGWIN__ && defined _MSC_VER
- /* On native Windows, nowadays, the setlocale() implementation is based
- on _wsetlocale() and uses malloc() for the result. We are better off
- using _wsetlocale() directly. */
- const wchar_t *result = _wsetlocale (category, NULL);
-
- if (result == NULL)
- {
- /* CATEGORY is invalid. */
- if (bufsize > 0)
- /* Return an empty string in BUF.
- This is a convenience for callers that don't want to write explicit
- code for handling EINVAL. */
- buf[0] = '\0';
- return EINVAL;
- }
- else
- {
- size_t length = wcslen (result);
- if (length < bufsize)
- {
- size_t i;
-
- /* Convert wchar_t[] -> char[], assuming plain ASCII. */
- for (i = 0; i <= length; i++)
- buf[i] = result[i];
-
- return 0;
- }
- else
- {
- if (bufsize > 0)
- {
- /* Return a truncated result in BUF.
- This is a convenience for callers that don't want to write
- explicit code for handling ERANGE. */
- size_t i;
-
- /* Convert wchar_t[] -> char[], assuming plain ASCII. */
- for (i = 0; i < bufsize; i++)
- buf[i] = result[i];
- buf[bufsize - 1] = '\0';
- }
- return ERANGE;
- }
- }
-#else
- const char *result = setlocale_null_androidfix (category);
-
- if (result == NULL)
- {
- /* CATEGORY is invalid. */
- if (bufsize > 0)
- /* Return an empty string in BUF.
- This is a convenience for callers that don't want to write explicit
- code for handling EINVAL. */
- buf[0] = '\0';
- return EINVAL;
- }
- else
- {
- size_t length = strlen (result);
- if (length < bufsize)
- {
- memcpy (buf, result, length + 1);
- return 0;
- }
- else
- {
- if (bufsize > 0)
- {
- /* Return a truncated result in BUF.
- This is a convenience for callers that don't want to write
- explicit code for handling ERANGE. */
- memcpy (buf, result, bufsize - 1);
- buf[bufsize - 1] = '\0';
- }
- return ERANGE;
- }
- }
-#endif
-}
-
#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc,
macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin < 3.4.6 */
-/* Use a lock, so that no two threads can invoke setlocale_null_unlocked
+/* Use a lock, so that no two threads can invoke setlocale_null_r_unlocked
at the same time. */
/* Prohibit renaming this symbol. */
# undef gl_get_setlocale_null_lock
-# if defined _WIN32 && !defined __CYGWIN__
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+# define setlocale_null_r_with_lock setlocale_null_r_unlocked
+
+# elif defined _WIN32 && !defined __CYGWIN__
extern __declspec(dllimport) CRITICAL_SECTION *gl_get_setlocale_null_lock
(void);
static int
-setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+setlocale_null_r_with_lock (int category, char *buf, size_t bufsize)
{
CRITICAL_SECTION *lock = gl_get_setlocale_null_lock ();
int ret;
EnterCriticalSection (lock);
- ret = setlocale_null_unlocked (category, buf, bufsize);
+ ret = setlocale_null_r_unlocked (category, buf, bufsize);
LeaveCriticalSection (lock);
return ret;
@@ -223,7 +111,7 @@ extern
# endif
static int
-setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+setlocale_null_r_with_lock (int category, char *buf, size_t bufsize)
{
if (pthread_in_use())
{
@@ -232,14 +120,14 @@ setlocale_null_with_lock (int category, char *buf, size_t
bufsize)
if (pthread_mutex_lock (lock))
abort ();
- ret = setlocale_null_unlocked (category, buf, bufsize);
+ ret = setlocale_null_r_unlocked (category, buf, bufsize);
if (pthread_mutex_unlock (lock))
abort ();
return ret;
}
else
- return setlocale_null_unlocked (category, buf, bufsize);
+ return setlocale_null_r_unlocked (category, buf, bufsize);
}
# elif HAVE_THREADS_H
@@ -247,14 +135,14 @@ setlocale_null_with_lock (int category, char *buf, size_t
bufsize)
extern mtx_t *gl_get_setlocale_null_lock (void);
static int
-setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+setlocale_null_r_with_lock (int category, char *buf, size_t bufsize)
{
mtx_t *lock = gl_get_setlocale_null_lock ();
int ret;
if (mtx_lock (lock) != thrd_success)
abort ();
- ret = setlocale_null_unlocked (category, buf, bufsize);
+ ret = setlocale_null_r_unlocked (category, buf, bufsize);
if (mtx_unlock (lock) != thrd_success)
abort ();
@@ -271,27 +159,27 @@ setlocale_null_r (int category, char *buf, size_t bufsize)
#if SETLOCALE_NULL_ALL_MTSAFE
# if SETLOCALE_NULL_ONE_MTSAFE
- return setlocale_null_unlocked (category, buf, bufsize);
+ return setlocale_null_r_unlocked (category, buf, bufsize);
# else
if (category == LC_ALL)
- return setlocale_null_unlocked (category, buf, bufsize);
+ return setlocale_null_r_unlocked (category, buf, bufsize);
else
- return setlocale_null_with_lock (category, buf, bufsize);
+ return setlocale_null_r_with_lock (category, buf, bufsize);
# endif
#else
# if SETLOCALE_NULL_ONE_MTSAFE
if (category == LC_ALL)
- return setlocale_null_with_lock (category, buf, bufsize);
+ return setlocale_null_r_with_lock (category, buf, bufsize);
else
- return setlocale_null_unlocked (category, buf, bufsize);
+ return setlocale_null_r_unlocked (category, buf, bufsize);
# else
- return setlocale_null_with_lock (category, buf, bufsize);
+ return setlocale_null_r_with_lock (category, buf, bufsize);
# endif
#endif
@@ -301,7 +189,7 @@ const char *
setlocale_null (int category)
{
#if SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE
- return setlocale_null_androidfix (category);
+ return setlocale_null_unlocked (category);
#else
/* This call must be multithread-safe. To achieve this without using
@@ -317,7 +205,7 @@ setlocale_null (int category)
if (category == LC_ALL)
{
# if SETLOCALE_NULL_ALL_MTSAFE
- return setlocale_null_androidfix (LC_ALL);
+ return setlocale_null_unlocked (LC_ALL);
# else
char buf[SETLOCALE_NULL_ALL_MAX];
static char resultbuf[SETLOCALE_NULL_ALL_MAX];
@@ -331,7 +219,7 @@ setlocale_null (int category)
else
{
# if SETLOCALE_NULL_ONE_MTSAFE
- return setlocale_null_androidfix (category);
+ return setlocale_null_unlocked (category);
# else
enum
{
diff --git a/gnulib/lib/setlocale_null.h b/gnulib/lib/setlocale_null.h
index c740fa0ff6..966c53cfaa 100644
--- a/gnulib/lib/setlocale_null.h
+++ b/gnulib/lib/setlocale_null.h
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -44,6 +44,34 @@ extern "C" {
55+5*58. */
#define SETLOCALE_NULL_ALL_MAX (148+12*256+1)
+/* setlocale_null_r_unlocked (CATEGORY, BUF, BUFSIZE) is like
+ setlocale (CATEGORY, NULL), except that
+ - it returns the resulting locale category name or locale name in the
+ user-supplied buffer BUF, which must be BUFSIZE bytes long.
+ The recommended minimum buffer size is
+ - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and
+ - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL.
+ The return value is an error code: 0 if the call is successful, EINVAL if
+ CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed
+ size (including the trailing NUL byte). In the latter case, a truncated
+ result is returned in BUF, but still NUL-terminated if BUFSIZE > 0.
+ This call is guaranteed to be multithread-safe only if
+ - CATEGORY != LC_ALL and SETLOCALE_NULL_ONE_MTSAFE is true, or
+ - CATEGORY == LC_ALL and SETLOCALE_NULL_ALL_MTSAFE is true,
+ and the other threads must not make other setlocale invocations (since
+ changing the global locale has side effects on all threads). */
+extern int setlocale_null_r_unlocked (int category, char *buf, size_t bufsize)
+ _GL_ARG_NONNULL ((2));
+
+/* setlocale_null_unlocked (CATEGORY) is like setlocale (CATEGORY, NULL).
+ The return value is NULL if CATEGORY is invalid.
+ This call is guaranteed to be multithread-safe only if
+ - CATEGORY != LC_ALL and SETLOCALE_NULL_ONE_MTSAFE is true, or
+ - CATEGORY == LC_ALL and SETLOCALE_NULL_ALL_MTSAFE is true,
+ and the other threads must not make other setlocale invocations (since
+ changing the global locale has side effects on all threads). */
+extern const char *setlocale_null_unlocked (int category);
+
/* setlocale_null_r (CATEGORY, BUF, BUFSIZE) is like setlocale (CATEGORY,
NULL),
except that
- it is guaranteed to be multithread-safe,
diff --git a/gnulib/lib/size_max.h b/gnulib/lib/size_max.h
index 2cfd31a59b..bd2eb43e8d 100644
--- a/gnulib/lib/size_max.h
+++ b/gnulib/lib/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2024 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/stat-time.c b/gnulib/lib/stat-time.c
index bc282232ab..1ab01f532c 100644
--- a/gnulib/lib/stat-time.c
+++ b/gnulib/lib/stat-time.c
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stat-time.h b/gnulib/lib/stat-time.h
index 75eb27e549..3cd8478f31 100644
--- a/gnulib/lib/stat-time.h
+++ b/gnulib/lib/stat-time.h
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -52,11 +52,13 @@ extern "C" {
#if _GL_WINDOWS_STAT_TIMESPEC || defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
# if _GL_WINDOWS_STAT_TIMESPEC || defined
TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# define STAT_TIMESPEC_OFFSETOF(st_xtim) offsetof (struct stat, st_xtim)
# else
# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
# endif
#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
+# define STAT_TIMESPEC_OFFSETOF(st_xtim) offsetof (struct stat, st_xtim##espec)
#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
@@ -194,20 +196,21 @@ get_stat_birthtime (_GL_UNUSED struct stat const *st)
}
/* If a stat-like function returned RESULT, normalize the timestamps
- in *ST, in case this platform suffers from the Solaris 11 bug where
+ in *ST, if this platform suffers from a macOS and Solaris bug where
tv_nsec might be negative. Return the adjusted RESULT, setting
errno to EOVERFLOW if normalization overflowed. This function
is intended to be private to this .h file. */
_GL_STAT_TIME_INLINE int
stat_time_normalize (int result, _GL_UNUSED struct stat *st)
{
-#if defined __sun && defined STAT_TIMESPEC
+#if (((defined __APPLE__ && defined __MACH__) || defined __sun) \
+ && defined STAT_TIMESPEC_OFFSETOF)
if (result == 0)
{
long int timespec_hz = 1000000000;
- short int const ts_off[] = { offsetof (struct stat, st_atim),
- offsetof (struct stat, st_mtim),
- offsetof (struct stat, st_ctim) };
+ short int const ts_off[] = { STAT_TIMESPEC_OFFSETOF (st_atim),
+ STAT_TIMESPEC_OFFSETOF (st_mtim),
+ STAT_TIMESPEC_OFFSETOF (st_ctim) };
int i;
for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
{
diff --git a/gnulib/lib/stat-w32.c b/gnulib/lib/stat-w32.c
index 2f01197584..ddd6f59856 100644
--- a/gnulib/lib/stat-w32.c
+++ b/gnulib/lib/stat-w32.c
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stat-w32.h b/gnulib/lib/stat-w32.h
index c6738749df..392faed168 100644
--- a/gnulib/lib/stat-w32.h
+++ b/gnulib/lib/stat-w32.h
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stat.c b/gnulib/lib/stat.c
index 7987e26583..ecf9f9bbe9 100644
--- a/gnulib/lib/stat.c
+++ b/gnulib/lib/stat.c
@@ -1,5 +1,5 @@
/* Work around platform bugs in stat.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stdarg.in.h b/gnulib/lib/stdarg.in.h
index 8145216e86..65a397759c 100644
--- a/gnulib/lib/stdarg.in.h
+++ b/gnulib/lib/stdarg.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <stdarg.h>.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stdckdint.in.h b/gnulib/lib/stdckdint.in.h
index 71bab5f0c9..91848806d8 100644
--- a/gnulib/lib/stdckdint.in.h
+++ b/gnulib/lib/stdckdint.in.h
@@ -1,6 +1,6 @@
/* stdckdint.h -- checked integer arithmetic
- Copyright 2022-2023 Free Software Foundation, Inc.
+ Copyright 2022-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/gnulib/lib/stddef.in.h b/gnulib/lib/stddef.in.h
index 190fd575d8..e39268c60c 100644
--- a/gnulib/lib/stddef.in.h
+++ b/gnulib/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,13 +27,21 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_wchar_t || defined __need_size_t \
- || defined __need_ptrdiff_t || defined __need_NULL \
- || defined __need_wint_t
+#if (defined __need_wchar_t || defined __need_size_t \
+ || defined __need_ptrdiff_t || defined __need_NULL \
+ || defined __need_wint_t) \
+ /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \
+ in Fedora 40 with gcc 14.0.1. \
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \
+ && !@STDDEF_NOT_IDEMPOTENT@
/* Special invocation convention inside gcc header files. In
- particular, gcc provides a version of <stddef.h> that blindly
- redefines NULL even when __need_wint_t was defined, even though
- wint_t is not normally provided by <stddef.h>. Hence, we must
+ particular, <stddef.h> in some ancient versions of GCC blindly
+ redefined NULL when __need_wint_t was defined, even though wint_t
+ is not normally provided by <stddef.h>.
+ (FIXME: It's not clear what GCC versions those were - perhaps so
+ ancient that we can stop worrying about this?)
+ Although glibc 2.26 (2017) and later do not use __need_wint_t,
+ for portability to macOS, Cygwin, Haiku, and older Glibc + GCC,
remember if special invocation has ever been used to obtain wint_t,
in which case we need to clean up NULL yet again. */
@@ -52,6 +60,13 @@
# endif
#else
+/* For @STDDEF_NOT_IDEMPOTENT@. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
+
/* Normal invocation convention. */
# ifndef _@GUARD_PREFIX@_STDDEF_H
@@ -74,6 +89,12 @@ typedef long max_align_t;
# endif
# endif
+# if !defined _GCC_NULLPTR_T && !@NULLPTR_T_NEEDS_STDDEF@
+ /* Suppress unwanted nullptr_t typedef. See
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869>. */
+# define _GCC_NULLPTR_T
+# endif
+
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
@@ -110,7 +131,7 @@ typedef long max_align_t;
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -128,11 +149,6 @@ typedef long max_align_t;
# endif
#endif
-/* Some platforms lack wchar_t. */
-#if !@HAVE_WCHAR_T@
-# define wchar_t int
-#endif
-
/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is
a hack in case the configure-time test was done with g++ even though
we are currently compiling with gcc.
@@ -178,7 +194,7 @@ typedef union
# ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0
-# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
diff --git a/gnulib/lib/stdint.in.h b/gnulib/lib/stdint.in.h
index 5ddc644b8e..cd3fbdd965 100644
--- a/gnulib/lib/stdint.in.h
+++ b/gnulib/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2024 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
@@ -80,7 +80,7 @@
#define _@GUARD_PREFIX@_STDINT_H
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
- LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */
+ LONG_MIN, LONG_MAX, ULONG_MAX, CHAR_BIT, _GL_INTEGER_WIDTH. */
#include <limits.h>
/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
@@ -189,6 +189,10 @@ typedef __int64 gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# else
+/* Verify that 'long long' has exactly 64 bits. */
+typedef _gl_verify_int64_bits[
+ _STDINT_MAX (1, sizeof (long long) * CHAR_BIT, 0ll) >> 31 >> 31 == 1
+ ? 1 : -1];
# undef int64_t
typedef long long int gl_int64_t;
# define int64_t gl_int64_t
@@ -210,6 +214,11 @@ typedef unsigned __int64 gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# else
+/* Verify that 'unsigned long long' has exactly 64 bits. */
+typedef _gl_verify_uint64_bits[
+ _STDINT_MAX (0, sizeof (unsigned long long) * CHAR_BIT, 0ull)
+ >> 31 >> 31 >> 1 == 1
+ ? 1 : -1];
# undef uint64_t
typedef unsigned long long int gl_uint64_t;
# define uint64_t gl_uint64_t
@@ -306,6 +315,8 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
uintptr_t to avoid conflicting declarations of system functions like
_findclose in <io.h>. */
# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
+ || (defined __INTPTR_WIDTH__ \
+ && __INTPTR_WIDTH__ != (defined _WIN64 ? LLONG_WIDTH : LONG_WIDTH))
\
|| defined __MINGW32__)
# undef intptr_t
# undef uintptr_t
diff --git a/gnulib/lib/stdio-read.c b/gnulib/lib/stdio-read.c
index 6e2984c5ec..253b8aa43f 100644
--- a/gnulib/lib/stdio-read.c
+++ b/gnulib/lib/stdio-read.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream read function.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/stdio-write.c b/gnulib/lib/stdio-write.c
index 9cf36cca4c..ca6aa00cee 100644
--- a/gnulib/lib/stdio-write.c
+++ b/gnulib/lib/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h
index 118874d877..36fd6a72ce 100644
--- a/gnulib/lib/stdio.in.h
+++ b/gnulib/lib/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -38,8 +38,14 @@
/* Suppress macOS deprecation warnings for sprintf and vsprintf. */
#if (defined __APPLE__ && defined __MACH__) && !defined _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-# define _GL_DEFINED__POSIX_C_SOURCE
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# include <AvailabilityMacros.h>
+# endif
+# if (defined MAC_OS_X_VERSION_MIN_REQUIRED \
+ && 130000 <= MAC_OS_X_VERSION_MIN_REQUIRED)
+# define _POSIX_C_SOURCE 200809L
+# define _GL_DEFINED__POSIX_C_SOURCE
+# endif
#endif
#define _GL_ALREADY_INCLUDING_STDIO_H
@@ -58,8 +64,8 @@
#define _@GUARD_PREFIX@_STDIO_H
/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT,
- _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+ _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -71,7 +77,8 @@
/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
and eglibc 2.11.2.
- May also define off_t to a 64-bit type on native Windows. */
+ May also define off_t to a 64-bit type on native Windows.
+ Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
#include <sys/types.h>
/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>.
*/
@@ -113,7 +120,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -148,7 +155,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -171,7 +178,7 @@
standardized by ISO C99 and POSIX.
_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */
/* __gnu_printf__ is supported in GCC >= 4.4. */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#if (__GNUC__ + (__GNUC_MINOR__ >= 4) > 4) && !defined __clang__
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
#else
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
@@ -273,18 +280,37 @@
#endif
+#if @GNULIB_DZPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure codes are ENOMEM
+ and the possible failure codes from write(), excluding EINTR. */
+_GL_FUNCDECL_SYS (dzprintf, off64_t,
+ (int fd, const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (dzprintf, off64_t,
+ (int fd, const char *restrict format, ...));
+#endif
+
#if @GNULIB_DPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns a negative value. */
# if @REPLACE_DPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dprintf rpl_dprintf
# endif
-_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
# else
# if !@HAVE_DPRINTF@
-_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2)));
# endif
@@ -307,7 +333,7 @@ _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fclose rpl_fclose
# endif
-_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
@@ -354,9 +380,10 @@ _GL_CXXALIASWARN (fcloseall);
# define fdopen rpl_fdopen
# endif
_GL_FUNCDECL_RPL (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -365,36 +392,38 @@ _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char
*mode));
# endif
_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
- _GL_ATTRIBUTE_NOTHROW
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
# endif
_GL_CXXALIASWARN (fdopen);
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined
fdopen
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
- _GL_ATTRIBUTE_NOTHROW
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -453,7 +482,7 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX
compliant - "
# undef fgetc
# define fgetc rpl_fgetc
# endif
-_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
@@ -470,8 +499,8 @@ _GL_CXXALIASWARN (fgetc);
# define fgets rpl_fgets
# endif
_GL_FUNCDECL_RPL (fgets, char *,
- (char *restrict s, int n, FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 3)));
+ (char *restrict s, int n, FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fgets, char *,
(char *restrict s, int n, FILE *restrict stream));
# else
@@ -507,17 +536,18 @@ _GL_CXXALIASWARN (fileno);
# define fopen rpl_fopen
# endif
_GL_FUNCDECL_RPL (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
+ (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ (const char *restrict filename, const char *restrict mode),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (fopen, FILE *,
(const char *restrict filename, const char *restrict mode));
@@ -526,10 +556,10 @@ _GL_CXXALIAS_SYS (fopen, FILE *,
_GL_CXXALIASWARN (fopen);
# endif
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined
fopen
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
+ (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
# endif
# if defined GNULIB_POSIXCHECK
@@ -540,7 +570,26 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms
is not POSIX complian
# endif
#endif
+#if @GNULIB_FZPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns -1 with the stream's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (fzprintf, off64_t,
+ (FILE *restrict fp, const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (fzprintf, off64_t,
+ (FILE *restrict fp, const char *restrict format, ...));
+#endif
+
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns a negative value with the stream's error indicator set. */
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
|| (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -549,12 +598,12 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows
platforms is not POSIX complian
# define GNULIB_overrides_fprintf 1
# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (fprintf, int,
- (FILE *restrict fp, const char *restrict format, ...)
+ (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (fprintf, int,
- (FILE *restrict fp, const char *restrict format, ...)
+ (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -589,15 +638,17 @@ _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX
compliant - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fpurge rpl_fpurge
# endif
-_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
# else
# if !@HAVE_DECL_FPURGE@
-_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fpurge);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fpurge
# if HAVE_RAW_DECL_FPURGE
@@ -612,7 +663,7 @@ _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
# undef fputc
# define fputc rpl_fputc
# endif
-_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
@@ -629,7 +680,7 @@ _GL_CXXALIASWARN (fputc);
# define fputs rpl_fputs
# endif
_GL_FUNCDECL_RPL (fputs, int,
- (const char *restrict string, FILE *restrict stream)
+ (const char *restrict string, FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fputs, int,
(const char *restrict string, FILE *restrict stream));
@@ -650,8 +701,8 @@ _GL_CXXALIASWARN (fputs);
# endif
_GL_FUNCDECL_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n,
FILE *restrict stream));
@@ -673,8 +724,8 @@ _GL_CXXALIASWARN (fread);
# endif
_GL_FUNCDECL_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode,
FILE *restrict stream));
@@ -701,9 +752,9 @@ _GL_WARN_ON_USE (freopen,
# define fscanf rpl_fscanf
# endif
_GL_FUNCDECL_RPL (fscanf, int,
- (FILE *restrict stream, const char *restrict format, ...)
+ (FILE *restrict stream, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fscanf, int,
(FILE *restrict stream, const char *restrict format, ...));
# else
@@ -757,7 +808,7 @@ _GL_CXXALIASWARN (fscanf);
# undef fseek
# define fseek rpl_fseek
# endif
-_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
# else
@@ -780,12 +831,12 @@ _GL_CXXALIASWARN (fseek);
# undef fseeko
# define fseeko rpl_fseeko
# endif
-_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else
# if ! @HAVE_DECL_FSEEKO@
-_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
@@ -823,7 +874,8 @@ _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger
than 4 GB "
# undef ftell
# define ftell rpl_ftell
# endif
-_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
# else
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
@@ -843,11 +895,13 @@ _GL_CXXALIASWARN (ftell);
# undef ftello
# define ftello rpl_ftello
# endif
-_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else
# if ! @HAVE_DECL_FTELLO@
-_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
# endif
@@ -880,7 +934,7 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger
than 4 GB "
# endif
_GL_FUNCDECL_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n,
- FILE *restrict stream)
+ FILE *restrict stream),
_GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n,
@@ -895,20 +949,20 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes under certain
versions of gcc and clang, and is not needed for C++. */
-# if (0 < __USE_FORTIFY_LEVEL \
+# if (0 < __USE_FORTIFY_LEVEL \
&& __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
- && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && (3 < __GNUC__ + (4 <= __GNUC_MINOR__) || defined __clang__) \
&& !defined __cplusplus)
# undef fwrite
# undef fwrite_unlocked
-extern size_t __REDIRECT (rpl_fwrite,
- (const void *__restrict, size_t, size_t,
- FILE *__restrict),
- fwrite);
-extern size_t __REDIRECT (rpl_fwrite_unlocked,
- (const void *__restrict, size_t, size_t,
- FILE *__restrict),
- fwrite_unlocked);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
# define fwrite rpl_fwrite
# define fwrite_unlocked rpl_fwrite_unlocked
# endif
@@ -924,7 +978,7 @@ _GL_CXXALIASWARN (fwrite);
# undef getc
# define getc rpl_fgetc
# endif
-_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
@@ -965,8 +1019,8 @@ _GL_CXXALIASWARN (getchar);
_GL_FUNCDECL_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
@@ -976,8 +1030,8 @@ _GL_CXXALIAS_RPL (getdelim, ssize_t,
_GL_FUNCDECL_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
@@ -1009,8 +1063,8 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
# endif
_GL_FUNCDECL_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream));
@@ -1018,8 +1072,8 @@ _GL_CXXALIAS_RPL (getline, ssize_t,
# if !@HAVE_DECL_GETLINE@
_GL_FUNCDECL_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
@@ -1068,19 +1122,45 @@ _GL_CXXALIASWARN (getw);
# endif
#endif
+#if @GNULIB_OBSTACK_ZPRINTF@
+struct obstack;
+/* Grows an obstack with formatted output. Returns the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use.
+ Upon memory allocation error, calls obstack_alloc_failed_handler.
+ Upon other error, returns -1 with errno set.
+
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is through
+ obstack_alloc_failed_handler. */
+_GL_FUNCDECL_SYS (obstack_zprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (obstack_zprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, ...));
+_GL_FUNCDECL_SYS (obstack_vzprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (obstack_vzprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, va_list args));
+#endif
+
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
struct obstack;
-/* Grow an obstack with formatted output. Return the number of
+/* Grows an obstack with formatted output. Returns the number of
bytes added to OBS. No trailing nul byte is added, and the
- object should be closed with obstack_finish before use. Upon
- memory allocation error, call obstack_alloc_failed_handler. Upon
- other error, return -1. */
+ object should be closed with obstack_finish before use.
+ Upon memory allocation error, calls obstack_alloc_failed_handler.
+ Upon other error, returns -1. */
# if @REPLACE_OBSTACK_PRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define obstack_printf rpl_obstack_printf
# endif
_GL_FUNCDECL_RPL (obstack_printf, int,
- (struct obstack *obs, const char *format, ...)
+ (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int,
@@ -1088,7 +1168,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int,
- (struct obstack *obs, const char *format, ...)
+ (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1101,7 +1181,7 @@ _GL_CXXALIASWARN (obstack_printf);
# define obstack_vprintf rpl_obstack_vprintf
# endif
_GL_FUNCDECL_RPL (obstack_vprintf, int,
- (struct obstack *obs, const char *format, va_list args)
+ (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int,
@@ -1109,7 +1189,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int,
- (struct obstack *obs, const char *format, va_list args)
+ (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1121,7 +1201,7 @@ _GL_CXXALIASWARN (obstack_vprintf);
#if @GNULIB_PCLOSE@
# if !@HAVE_PCLOSE@
-_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
_GL_CXXALIASWARN (pclose);
@@ -1163,25 +1243,26 @@ _GL_WARN_ON_USE (perror, "perror is not always POSIX
compliant - "
# define popen rpl_popen
# endif
_GL_FUNCDECL_RPL (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
# else
-# if !@HAVE_POPEN@ || __GNUC__ >= 11
+# if !@HAVE_POPEN@ || (__GNUC__ >= 11 && !defined __clang__)
_GL_FUNCDECL_SYS (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
# endif
_GL_CXXALIASWARN (popen);
#else
-# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
+# if @GNULIB_PCLOSE@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined popen
/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
_GL_FUNCDECL_SYS (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -1194,7 +1275,24 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some
platforms - "
# endif
#endif
+#if @GNULIB_ZPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns -1 with stdout's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
+#endif
+
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns a negative value with stdout's error indicator set. */
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if defined __GNUC__ || defined __clang__
@@ -1206,14 +1304,14 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some
platforms - "
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1)));
# else
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1)));
# endif
@@ -1223,7 +1321,7 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char
*format, ...));
# define printf rpl_printf
# endif
_GL_FUNCDECL_RPL (printf, int,
- (const char *restrict format, ...)
+ (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
@@ -1252,7 +1350,7 @@ _GL_WARN_ON_USE (printf, "printf is not always POSIX
compliant - "
# undef putc
# define putc rpl_fputc
# endif
-_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
@@ -1284,7 +1382,7 @@ _GL_CXXALIASWARN (putchar);
# undef puts
# define puts rpl_puts
# endif
-_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (puts, int, (const char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (puts, int, (const char *string));
# else
_GL_CXXALIAS_SYS (puts, int, (const char *string));
@@ -1324,7 +1422,7 @@ _GL_CXXALIASWARN (putw);
# undef remove
# define remove rpl_remove
# endif
-_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (remove, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (remove, int, (const char *name));
# else
_GL_CXXALIAS_SYS (remove, int, (const char *name));
@@ -1346,7 +1444,7 @@ _GL_WARN_ON_USE (remove, "remove cannot handle
directories on some platforms - "
# define rename rpl_rename
# endif
_GL_FUNCDECL_RPL (rename, int,
- (const char *old_filename, const char *new_filename)
+ (const char *old_filename, const char *new_filename),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (rename, int,
(const char *old_filename, const char *new_filename));
@@ -1371,14 +1469,14 @@ _GL_WARN_ON_USE (rename, "rename is buggy on some
platforms - "
# define renameat rpl_renameat
# endif
_GL_FUNCDECL_RPL (renameat, int,
- (int fd1, char const *file1, int fd2, char const *file2)
+ (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2));
# else
# if !@HAVE_RENAMEAT@
_GL_FUNCDECL_SYS (renameat, int,
- (int fd1, char const *file1, int fd2, char const *file2)
+ (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4)));
# endif
_GL_CXXALIAS_SYS (renameat, int,
@@ -1404,18 +1502,18 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
_GL_FUNCDECL_RPL_1 (__scanf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
# else
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef scanf
# define scanf rpl_scanf
# endif
-_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
+_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
# endif
# else
@@ -1426,7 +1524,31 @@ _GL_CXXALIASWARN (scanf);
# endif
#endif
+#if @GNULIB_SNZPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+#endif
+
#if @GNULIB_SNPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns a negative value. */
# if @REPLACE_SNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define snprintf rpl_snprintf
@@ -1434,7 +1556,7 @@ _GL_CXXALIASWARN (scanf);
# define GNULIB_overrides_snprintf 1
_GL_FUNCDECL_RPL (snprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, ...)
+ const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int,
@@ -1444,7 +1566,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
# if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, ...)
+ const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3)));
# endif
@@ -1463,6 +1585,23 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# endif
#endif
+#if @GNULIB_SZPRINTF@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, ...));
+#endif
+
/* Some people would argue that all sprintf uses should be warned about
(for example, OpenBSD issues a link warning for it),
since it can cause security holes due to buffer overruns.
@@ -1473,13 +1612,16 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
GNULIB_POSIXCHECK is defined. */
#if @GNULIB_SPRINTF_POSIX@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns a negative value. */
# if @REPLACE_SPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define sprintf rpl_sprintf
# endif
# define GNULIB_overrides_sprintf 1
_GL_FUNCDECL_RPL (sprintf, int,
- (char *restrict str, const char *restrict format, ...)
+ (char *restrict str, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int,
@@ -1520,16 +1662,18 @@ _GL_CXXALIASWARN (tempnam);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define tmpfile rpl_tmpfile
# endif
-_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
-_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
# endif
@@ -1537,9 +1681,10 @@ _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
_GL_CXXALIASWARN (tmpfile);
# endif
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
+# if @GNULIB_FCLOSE@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined tmpfile
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
-_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -1552,6 +1697,31 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on
mingw - "
# endif
#endif
+#if @GNULIB_VASZPRINTF@
+/* Prints formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, it stores the address of the string in
+ *RESULT and returns the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, it returns -1
+ with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
+ (char **result, const char *format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
+ (char **result, const char *format, ...));
+_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
+ (char **result, const char *format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
+ (char **result, const char *format, va_list args));
+#endif
+
#if @GNULIB_VASPRINTF@
/* Write formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, store the address of the string in
@@ -1563,17 +1733,19 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on
mingw - "
# endif
# define GNULIB_overrides_asprintf
_GL_FUNCDECL_RPL (asprintf, int,
- (char **result, const char *format, ...)
+ (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int,
- (char **result, const char *format, ...)
+ (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (asprintf, int,
(char **result, const char *format, ...));
@@ -1585,17 +1757,19 @@ _GL_CXXALIASWARN (asprintf);
# endif
# define GNULIB_overrides_vasprintf 1
_GL_FUNCDECL_RPL (vasprintf, int,
- (char **result, const char *format, va_list args)
+ (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int,
- (char **result, const char *format, va_list args)
+ (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (vasprintf, int,
(char **result, const char *format, va_list args));
@@ -1603,13 +1777,32 @@ _GL_CXXALIAS_SYS (vasprintf, int,
_GL_CXXALIASWARN (vasprintf);
#endif
+#if @GNULIB_VDZPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure codes are ENOMEM
+ and the possible failure codes from write(), excluding EINTR. */
+_GL_FUNCDECL_SYS (vdzprintf, off64_t,
+ (int fd, const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (vdzprintf, off64_t,
+ (int fd, const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VDPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns a negative value. */
# if @REPLACE_VDPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vdprintf rpl_vdprintf
# endif
_GL_FUNCDECL_RPL (vdprintf, int,
- (int fd, const char *restrict format, va_list args)
+ (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int,
@@ -1617,7 +1810,7 @@ _GL_CXXALIAS_RPL (vdprintf, int,
# else
# if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int,
- (int fd, const char *restrict format, va_list args)
+ (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2)));
# endif
@@ -1637,7 +1830,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
#endif
+#if @GNULIB_VFZPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns -1 with the stream's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (vfzprintf, off64_t,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (vfzprintf, off64_t,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns a negative value with the stream's error indicator set. */
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
|| (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1647,13 +1861,13 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# if @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1690,9 +1904,9 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX
compliant - "
# endif
_GL_FUNCDECL_RPL (vfscanf, int,
(FILE *restrict stream,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vfscanf, int,
(FILE *restrict stream,
const char *restrict format, va_list args));
@@ -1706,7 +1920,26 @@ _GL_CXXALIASWARN (vfscanf);
# endif
#endif
+#if @GNULIB_VZPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns -1 with stdout's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (vzprintf, off64_t,
+ (const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (vzprintf, off64_t,
+ (const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns a negative value with stdout's error indicator set. */
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
|| (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1714,11 +1947,11 @@ _GL_CXXALIASWARN (vfscanf);
# endif
# define GNULIB_overrides_vprintf 1
# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
-_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
_GL_ARG_NONNULL ((1)));
# else
-_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1)));
# endif
@@ -1750,9 +1983,9 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX
compliant - "
# undef vscanf
# define vscanf rpl_vscanf
# endif
-_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
# else
_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
@@ -1762,7 +1995,31 @@ _GL_CXXALIASWARN (vscanf);
# endif
#endif
+#if @GNULIB_VSNZPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VSNPRINTF@
+/* Prints formatted output to string STR. Similar to vsprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns a negative value. */
# if @REPLACE_VSNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsnprintf rpl_vsnprintf
@@ -1770,7 +2027,7 @@ _GL_CXXALIASWARN (vscanf);
# define GNULIB_overrides_vsnprintf 1
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int,
@@ -1780,7 +2037,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
# if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3)));
# endif
@@ -1799,7 +2056,27 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif
#endif
+#if @GNULIB_VSZPRINTF@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VSPRINTF_POSIX@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns a negative value. */
# if @REPLACE_VSPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsprintf rpl_vsprintf
@@ -1807,7 +2084,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# define GNULIB_overrides_vsprintf 1
_GL_FUNCDECL_RPL (vsprintf, int,
(char *restrict str,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int,
diff --git a/gnulib/lib/stdlib.in.h b/gnulib/lib/stdlib.in.h
index b9838c7d5e..1ec96c8b24 100644
--- a/gnulib/lib/stdlib.in.h
+++ b/gnulib/lib/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,12 +20,25 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined
__need_malloc_and_calloc
/* Special invocation conventions inside some gnulib header files,
- and inside some glibc header files, respectively. */
+ and inside some glibc header files, respectively.
+ Do not recognize this special invocation convention when GCC's
+ c++/11/stdlib.h is being included or has been included. This is needed
+ to support the use of clang+llvm binaries on Ubuntu 22.04 with
+ CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
+ -I/usr/include/x86_64-linux-gnu/c++/11
+ -L/usr/lib/gcc/x86_64-linux-gnu/11
+ -Wl,-rpath,$clangdir/lib"
+ because in this case /usr/include/c++/11/stdlib.h (which does not support
+ the convention) is seen before the gnulib-generated stdlib.h. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+/* Make sure that the macros that indicate the special invocation convention
+ get undefined. This is needed at least on CentOS 7. */
+#undef __need_malloc_and_calloc
+
#else
/* Normal invocation convention. */
@@ -38,8 +51,8 @@
#define _@GUARD_PREFIX@_STDLIB_H
/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
- _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+ _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -104,11 +117,22 @@ struct random_data
# include <unistd.h>
#endif
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ &&
@REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) ||
(@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined
GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
+ below, this may cause compilation errors later in the libstdc++ header files
+ (that are part of GCC), such as:
+ error: 'rpl_strtol' is not a member of 'std'
+ To avoid this, include the relevant header files here, before these symbols
+ get defined as macros. But do so only on Solaris 11 (where it is needed),
+ not on mingw (where it would cause other compilation errors). */
+# include <string>
+#endif
+
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -137,7 +161,7 @@ struct random_data
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -216,6 +240,26 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
#endif
+#if @GNULIB_ABORT_DEBUG@
+/* Terminates the current process with signal SIGABRT.
+ Note: While the original abort() function is safe to call in signal
handlers,
+ the overridden abort() function is not. */
+# if @REPLACE_ABORT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef abort
+# define abort rpl_abort
+# endif
+_GL_FUNCDECL_RPL (abort, _Noreturn void, (void));
+_GL_CXXALIAS_RPL (abort, void, (void));
+# else
+_GL_CXXALIAS_SYS (abort, void, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (abort);
+# endif
+#endif
+
+
#if @GNULIB_FREE_POSIX@
# if @REPLACE_FREE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -223,7 +267,7 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# define free rpl_free
# endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
-_GL_FUNCDECL_RPL (free, void, (void *ptr) _GL_ATTRIBUTE_NOTHROW);
+_GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_RPL (free, void, (void *ptr));
# endif
@@ -250,22 +294,25 @@ _GL_WARN_ON_USE (free, "free is not future POSIX
compliant everywhere - "
# define aligned_alloc rpl_aligned_alloc
# endif
_GL_FUNCDECL_RPL (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
# else
# if @HAVE_ALIGNED_ALLOC@
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
@@ -275,16 +322,17 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t
alignment, size_t size));
_GL_CXXALIASWARN (aligned_alloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
+ (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -301,9 +349,10 @@ _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not
portable - "
/* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */
# if !@HAVE_ATOLL@
-_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
- _GL_ATTRIBUTE_PURE
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (atoll, long long,
+ (const char *string),
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll);
@@ -323,21 +372,24 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
# define calloc rpl_calloc
# endif
_GL_FUNCDECL_RPL (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
@@ -346,16 +398,17 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t
size));
_GL_CXXALIASWARN (calloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
+ (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -373,23 +426,26 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant
everywhere - "
# define canonicalize_file_name rpl_canonicalize_file_name
# endif
_GL_FUNCDECL_RPL (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
# else
-# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+# if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
@@ -400,18 +456,19 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const
char *name));
# endif
_GL_CXXALIASWARN (canonicalize_file_name);
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined
canonicalize_file_name
/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -503,12 +560,12 @@ _GL_CXXALIASWARN (gcvt);
# undef getloadavg
# define getloadavg rpl_getloadavg
# endif
-_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
# else
# if !@HAVE_DECL_GETLOADAVG@
-_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
@@ -533,7 +590,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# define getprogname rpl_getprogname
# endif
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
_GL_FUNCDECL_RPL (getprogname, const char *, (void));
# endif
@@ -541,7 +598,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else
# if !@HAVE_GETPROGNAME@
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
_GL_FUNCDECL_SYS (getprogname, const char *, (void));
# endif
@@ -577,15 +634,15 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable
- "
# define getsubopt rpl_getsubopt
# endif
_GL_FUNCDECL_RPL (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
# else
# if !@HAVE_GETSUBOPT@
_GL_FUNCDECL_SYS (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
@@ -630,21 +687,24 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
# define malloc rpl_malloc
# endif
_GL_FUNCDECL_RPL (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
@@ -653,16 +713,17 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
_GL_CXXALIASWARN (malloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
+ (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -698,7 +759,7 @@ int gl_MB_CUR_MAX (void)
# endif
_GL_FUNCDECL_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
- size_t len)
+ size_t len),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
@@ -756,7 +817,9 @@ _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */
# if !@HAVE_MKDTEMP@
-_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL
((1)));
+_GL_FUNCDECL_SYS (mkdtemp, char *,
+ (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp);
@@ -786,13 +849,13 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
# undef mkostemp
# define mkostemp rpl_mkostemp
# endif
-_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMP@
-_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
# endif
@@ -827,15 +890,15 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
# define mkostemps rpl_mkostemps
# endif
_GL_FUNCDECL_RPL (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMPS@
_GL_FUNCDECL_SYS (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
@@ -865,11 +928,13 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkstemp rpl_mkstemp
# endif
-_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
# else
# if ! @HAVE_MKSTEMP@
-_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif
@@ -894,8 +959,8 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
# if !@HAVE_MKSTEMPS@
-_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps);
@@ -931,8 +996,8 @@ _GL_CXXALIASWARN (mktemp);
# define posix_memalign rpl_posix_memalign
# endif
_GL_FUNCDECL_RPL (posix_memalign, int,
- (void **memptr, size_t alignment, size_t size)
- _GL_ARG_NONNULL ((1)));
+ (void **memptr, size_t alignment, size_t size),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_memalign, int,
(void **memptr, size_t alignment, size_t size));
# else
@@ -960,11 +1025,11 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not
portable - "
# undef posix_openpt
# define posix_openpt rpl_posix_openpt
# endif
-_GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
+_GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
# else
# if !@HAVE_POSIX_OPENPT@
-_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
# endif
@@ -987,11 +1052,11 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not
portable - "
# undef ptsname
# define ptsname rpl_ptsname
# endif
-_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
# else
# if !@HAVE_PTSNAME@
-_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
# endif
@@ -1039,7 +1104,7 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
# undef putenv
# define putenv rpl_putenv
# endif
-_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (putenv, int, (char *string));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1047,6 +1112,10 @@ _GL_CXXALIAS_RPL (putenv, int, (char *string));
# define putenv _putenv
# endif
_GL_CXXALIAS_MDA (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+ const char *string. */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
# else
_GL_CXXALIAS_SYS (putenv, int, (char *string));
# endif
@@ -1063,6 +1132,10 @@ _GL_CXXALIASWARN (putenv);
/* Need to cast, because on mingw, the parameter is either
'const char *string' or 'char *string'. */
_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+ const char *string. */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
# else
_GL_CXXALIAS_SYS (putenv, int, (char *string));
# endif
@@ -1090,7 +1163,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void
const *, void *);
# endif
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
@@ -1098,13 +1172,16 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t
nmemb, size_t size,
# if !@HAVE_QSORT_R@
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
# endif
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (qsort_r);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef qsort_r
# if HAVE_RAW_DECL_QSORT_R
@@ -1114,11 +1191,26 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
#endif
-#if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
-# ifndef RAND_MAX
-# define RAND_MAX 2147483647
+#if @GNULIB_RAND@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@)
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+#endif
+
+
+#if @GNULIB_RAND@
+# if @REPLACE_RAND@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rand
+# define rand rpl_rand
# endif
+_GL_FUNCDECL_RPL (rand, int, (void));
+_GL_CXXALIAS_RPL (rand, int, (void));
+# else
+_GL_CXXALIAS_SYS (rand, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (rand);
# endif
#endif
@@ -1184,14 +1276,14 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
# define initstate rpl_initstate
# endif
_GL_FUNCDECL_RPL (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# else
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on FreeBSD, the first parameter is
@@ -1216,11 +1308,11 @@ _GL_WARN_ON_USE (initstate, "initstate is unportable - "
# undef setstate
# define setstate rpl_setstate
# endif
-_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
# else
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
-_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
is const char *arg_state. */
@@ -1244,12 +1336,12 @@ _GL_WARN_ON_USE (setstate, "setstate is unportable - "
# undef random_r
# define random_r rpl_random_r
# endif
-_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
# else
# if !@HAVE_RANDOM_R@
-_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
@@ -1270,14 +1362,14 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
# define srandom_r rpl_srandom_r
# endif
_GL_FUNCDECL_RPL (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (srandom_r, int,
(unsigned int seed, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (srandom_r, int,
@@ -1300,7 +1392,7 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
# endif
_GL_FUNCDECL_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
@@ -1309,7 +1401,7 @@ _GL_CXXALIAS_RPL (initstate_r, int,
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
# endif
/* Need to cast, because on Haiku, the third parameter is
@@ -1334,14 +1426,14 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is
unportable - "
# define setstate_r rpl_setstate_r
# endif
_GL_FUNCDECL_RPL (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (setstate_r, int,
(char *arg_state, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
# endif
/* Need to cast, because on Haiku, the first parameter is
@@ -1367,21 +1459,22 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable
- "
# undef realloc
# define realloc rpl_realloc
# endif
-_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_FUNCDECL_RPL (realloc, void *,
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
@@ -1390,16 +1483,17 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t
size));
_GL_CXXALIASWARN (realloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
+ (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1419,13 +1513,15 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX
compliant everywhere - "
# define reallocarray rpl_reallocarray
# endif
_GL_FUNCDECL_RPL (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
# else
# if ! @HAVE_REALLOCARRAY@
_GL_FUNCDECL_SYS (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
@@ -1447,15 +1543,15 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not
portable - "
# define realpath rpl_realpath
# endif
_GL_FUNCDECL_RPL (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realpath, char *,
(const char *restrict name, char *restrict resolved));
# else
# if !@HAVE_REALPATH@
_GL_FUNCDECL_SYS (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (realpath, char *,
(const char *restrict name, char *restrict resolved));
@@ -1473,7 +1569,8 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use
gnulib module "
/* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
# if !@HAVE_RPMATCH@
-_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch);
@@ -1489,7 +1586,8 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
/* Look up NAME in the environment, returning 0 in insecure situations. */
# if !@HAVE_SECURE_GETENV@
_GL_FUNCDECL_SYS (secure_getenv, char *,
- (char const *name) _GL_ARG_NONNULL ((1)));
+ (char const *name),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
_GL_CXXALIASWARN (secure_getenv);
@@ -1510,14 +1608,14 @@ _GL_WARN_ON_USE (secure_getenv, "secure_getenv is
unportable - "
# define setenv rpl_setenv
# endif
_GL_FUNCDECL_RPL (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
# if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (setenv, int,
@@ -1534,6 +1632,19 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
#endif
+#if @GNULIB_STACK_TRACE@
+/* Prints a stack trace of the current thread to standard error,
+ if possible. */
+# if @CAN_PRINT_STACK_TRACE@
+_GL_EXTERN_C void print_stack_trace (void);
+# else
+# if !GNULIB_defined_print_stack_trace
+# define print_stack_trace() /* nothing */
+# define GNULIB_defined_print_stack_trace 1
+# endif
+# endif
+#endif
+
#if @GNULIB_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOD@
@@ -1542,14 +1653,14 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
# define GNULIB_defined_strtod_function 1
_GL_FUNCDECL_RPL (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtod, double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOD@
_GL_FUNCDECL_SYS (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtod, double,
@@ -1566,6 +1677,38 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif
#endif
+#if @GNULIB_STRTOF@
+ /* Parse a float from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtof rpl_strtof
+# endif
+# define GNULIB_defined_strtof_function 1
+_GL_FUNCDECL_RPL (strtof, float,
+ (const char *restrict str, char **restrict endp),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtof, float,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOF@
+_GL_FUNCDECL_SYS (strtof, float,
+ (const char *restrict str, char **restrict endp),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtof, float,
+ (const char *restrict str, char **restrict endp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtof);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtof
+# if HAVE_RAW_DECL_STRTOF
+_GL_WARN_ON_USE (strtof, "strtof is unportable - "
+ "use gnulib module strtof for portability");
+# endif
+#endif
+
#if @GNULIB_STRTOLD@
/* Parse a 'long double' from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOLD@
@@ -1574,14 +1717,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif
# define GNULIB_defined_strtold_function 1
_GL_FUNCDECL_RPL (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtold, long double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOLD@
_GL_FUNCDECL_SYS (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtold, long double,
@@ -1612,7 +1755,7 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - "
# define GNULIB_defined_strtol_function 1
_GL_FUNCDECL_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
@@ -1621,7 +1764,7 @@ _GL_CXXALIAS_RPL (strtol, long,
# if !@HAVE_STRTOL@
_GL_FUNCDECL_SYS (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtol, long,
@@ -1655,7 +1798,7 @@ _GL_WARN_ON_USE (strtol, "strtol is unportable - "
# define GNULIB_defined_strtoll_function 1
_GL_FUNCDECL_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
@@ -1664,7 +1807,7 @@ _GL_CXXALIAS_RPL (strtoll, long long,
# if !@HAVE_STRTOLL@
_GL_FUNCDECL_SYS (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoll, long long,
@@ -1695,7 +1838,7 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
# define GNULIB_defined_strtoul_function 1
_GL_FUNCDECL_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
@@ -1704,7 +1847,7 @@ _GL_CXXALIAS_RPL (strtoul, unsigned long,
# if !@HAVE_STRTOUL@
_GL_FUNCDECL_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoul, unsigned long,
@@ -1738,7 +1881,7 @@ _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
# define GNULIB_defined_strtoull_function 1
_GL_FUNCDECL_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
@@ -1747,7 +1890,7 @@ _GL_CXXALIAS_RPL (strtoull, unsigned long long,
# if !@HAVE_STRTOULL@
_GL_FUNCDECL_SYS (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
@@ -1786,11 +1929,11 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
-_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
# if !@HAVE_DECL_UNSETENV@
-_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
diff --git a/gnulib/lib/stpcpy.c b/gnulib/lib/stpcpy.c
index 73c1eb786f..d4510054bf 100644
--- a/gnulib/lib/stpcpy.c
+++ b/gnulib/lib/stpcpy.c
@@ -1,5 +1,5 @@
/* stpcpy.c -- copy a string and return pointer to end of new string
- Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2023 Free Software
+ Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2024 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library.
diff --git a/gnulib/lib/str-kmp.h b/gnulib/lib/str-kmp.h
index b8821f841b..091b921bc1 100644
--- a/gnulib/lib/str-kmp.h
+++ b/gnulib/lib/str-kmp.h
@@ -1,6 +1,6 @@
/* Substring search in a NUL terminated string of UNIT elements,
using the Knuth-Morris-Pratt algorithm.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This file is free software.
diff --git a/gnulib/lib/str-two-way.h b/gnulib/lib/str-two-way.h
index dfe702241c..cf85e26817 100644
--- a/gnulib/lib/str-two-way.h
+++ b/gnulib/lib/str-two-way.h
@@ -1,5 +1,5 @@
/* Byte-wise substring search, using the Two-Way algorithm.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake <ebb9@byu.net>, 2008.
diff --git a/gnulib/lib/strcasecmp.c b/gnulib/lib/strcasecmp.c
index 38a30ce0d7..7939b404c1 100644
--- a/gnulib/lib/strcasecmp.c
+++ b/gnulib/lib/strcasecmp.c
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison function.
- Copyright (C) 1998-1999, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/strcasestr.c b/gnulib/lib/strcasestr.c
index d8e9601239..b8c0479d90 100644
--- a/gnulib/lib/strcasestr.c
+++ b/gnulib/lib/strcasestr.c
@@ -1,5 +1,5 @@
/* Case-insensitive searching in a string.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/strdup.c b/gnulib/lib/strdup.c
index 08c40d57ab..8d9e7c57dd 100644
--- a/gnulib/lib/strdup.c
+++ b/gnulib/lib/strdup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2023 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2024 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gnulib/lib/streq.h b/gnulib/lib/streq.h
index 712948eba7..8593de6dff 100644
--- a/gnulib/lib/streq.h
+++ b/gnulib/lib/streq.h
@@ -1,5 +1,5 @@
/* Optimized string comparison.
- Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -21,6 +21,11 @@
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* STREQ_OPT allows to optimize string comparison with a small literal string.
STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
is semantically equivalent to
@@ -173,4 +178,9 @@ streq0 (const char *s1, const char *s2, char s20, char s21,
char s22, char s23,
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_STREQ_H */
diff --git a/gnulib/lib/strerror-override.c b/gnulib/lib/strerror-override.c
index cddaa4a9d4..2d9560f909 100644
--- a/gnulib/lib/strerror-override.c
+++ b/gnulib/lib/strerror-override.c
@@ -1,6 +1,6 @@
/* strerror-override.c --- POSIX compatible system error routine
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -298,6 +298,11 @@ strerror_override (int errnum)
return "Invalid or incomplete multibyte or wide character";
# endif
+# if GNULIB_defined_ESOCKTNOSUPPORT
+ case ESOCKTNOSUPPORT:
+ return "Socket type not supported";
+# endif
+
default:
return NULL;
}
diff --git a/gnulib/lib/strerror-override.h b/gnulib/lib/strerror-override.h
index c9b3ba8c19..c496000389 100644
--- a/gnulib/lib/strerror-override.h
+++ b/gnulib/lib/strerror-override.h
@@ -1,6 +1,6 @@
/* strerror-override.h --- POSIX compatible system error routine
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -16,47 +16,58 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GL_STRERROR_OVERRIDE_H
-# define _GL_STRERROR_OVERRIDE_H
+#define _GL_STRERROR_OVERRIDE_H
/* This file uses _GL_ATTRIBUTE_CONST. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <errno.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <errno.h>
-# include <stddef.h>
/* Reasonable buffer size that should never trigger ERANGE; if this
proves too small, we intentionally abort(), to remind us to fix
this value. */
-# define STACKBUF_LEN 256
+#define STACKBUF_LEN 256
/* If ERRNUM maps to an errno value defined by gnulib, return a string
describing the error. Otherwise return NULL. */
-# if REPLACE_STRERROR_0 \
- || GNULIB_defined_ESOCK \
- || GNULIB_defined_ESTREAMS \
- || GNULIB_defined_EWINSOCK \
- || GNULIB_defined_ENOMSG \
- || GNULIB_defined_EIDRM \
- || GNULIB_defined_ENOLINK \
- || GNULIB_defined_EPROTO \
- || GNULIB_defined_EMULTIHOP \
- || GNULIB_defined_EBADMSG \
- || GNULIB_defined_EOVERFLOW \
- || GNULIB_defined_ENOTSUP \
- || GNULIB_defined_ENETRESET \
- || GNULIB_defined_ECONNABORTED \
- || GNULIB_defined_ESTALE \
- || GNULIB_defined_EDQUOT \
- || GNULIB_defined_ECANCELED \
- || GNULIB_defined_EOWNERDEAD \
- || GNULIB_defined_ENOTRECOVERABLE \
- || GNULIB_defined_EILSEQ
+#if REPLACE_STRERROR_0 \
+ || GNULIB_defined_ESOCK \
+ || GNULIB_defined_ESTREAMS \
+ || GNULIB_defined_EWINSOCK \
+ || GNULIB_defined_ENOMSG \
+ || GNULIB_defined_EIDRM \
+ || GNULIB_defined_ENOLINK \
+ || GNULIB_defined_EPROTO \
+ || GNULIB_defined_EMULTIHOP \
+ || GNULIB_defined_EBADMSG \
+ || GNULIB_defined_EOVERFLOW \
+ || GNULIB_defined_ENOTSUP \
+ || GNULIB_defined_ENETRESET \
+ || GNULIB_defined_ECONNABORTED \
+ || GNULIB_defined_ESTALE \
+ || GNULIB_defined_EDQUOT \
+ || GNULIB_defined_ECANCELED \
+ || GNULIB_defined_EOWNERDEAD \
+ || GNULIB_defined_ENOTRECOVERABLE \
+ || GNULIB_defined_EILSEQ \
+ || GNULIB_defined_ESOCKTNOSUPPORT
extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
-# else
-# define strerror_override(ignored) NULL
-# define GNULIB_defined_strerror_override_macro 1
-# endif
+#else
+# define strerror_override(ignored) NULL
+# define GNULIB_defined_strerror_override_macro 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _GL_STRERROR_OVERRIDE_H */
diff --git a/gnulib/lib/strerror.c b/gnulib/lib/strerror.c
index d754f601ee..6b760ff45c 100644
--- a/gnulib/lib/strerror.c
+++ b/gnulib/lib/strerror.c
@@ -1,6 +1,6 @@
/* strerror.c --- POSIX compatible system error routine
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/string.in.h b/gnulib/lib/string.in.h
index 8b62ae8fc9..a588e7e2c2 100644
--- a/gnulib/lib/string.in.h
+++ b/gnulib/lib/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -79,7 +79,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -115,7 +115,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -198,7 +198,7 @@ _GL_EXTERN_C void free (void *);
#if @GNULIB_EXPLICIT_BZERO@
# if ! @HAVE_EXPLICIT_BZERO@
_GL_FUNCDECL_SYS (explicit_bzero, void,
- (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
+ (void *__dest, size_t __n), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
_GL_CXXALIASWARN (explicit_bzero);
@@ -274,7 +274,7 @@ _GL_CXXALIASWARN (memccpy);
# undef memchr
# define memchr rpl_memchr
# endif
-_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_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
- "
# endif
_GL_FUNCDECL_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
- void const *__needle, size_t __needle_len)
+ void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *,
@@ -323,7 +323,7 @@ _GL_CXXALIAS_RPL (memmem, void *,
# if ! @HAVE_DECL_MEMMEM@
_GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
- void const *__needle, size_t __needle_len)
+ void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3)));
# endif
@@ -351,7 +351,7 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often
quadratic - "
# endif
_GL_FUNCDECL_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
@@ -360,7 +360,7 @@ _GL_CXXALIAS_RPL (mempcpy, void *,
# if !@HAVE_MEMPCPY@
_GL_FUNCDECL_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (mempcpy, void *,
@@ -381,7 +381,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
/* Search backwards through a block for a byte (specified as an int). */
#if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@
-_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -414,11 +414,21 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
/* Overwrite a block of memory. The compiler will not optimize
effects away, even if the block is dead after the call. */
#if @GNULIB_MEMSET_EXPLICIT@
-# if ! @HAVE_MEMSET_EXPLICIT@
+# if @REPLACE_MEMSET_EXPLICIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memset_explicit
+# define memset_explicit rpl_memset_explicit
+# endif
+_GL_FUNCDECL_RPL (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t
__n));
+# else
+# if !@HAVE_MEMSET_EXPLICIT@
_GL_FUNCDECL_SYS (memset_explicit, void *,
- (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
-# endif
+ (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
+# endif
_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t
__n));
+# endif
_GL_CXXALIASWARN (memset_explicit);
#elif defined GNULIB_POSIXCHECK
# undef memset_explicit
@@ -433,7 +443,7 @@ _GL_WARN_ON_USE (memset_explicit, "memset_explicit is
unportable - "
occur within N bytes. */
#if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@
-_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -471,14 +481,14 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
# define stpcpy rpl_stpcpy
# endif
_GL_FUNCDECL_RPL (stpcpy, char *,
- (char *restrict __dst, char const *restrict __src)
+ (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpcpy, char *,
(char *restrict __dst, char const *restrict __src));
# else
# if !@HAVE_STPCPY@
_GL_FUNCDECL_SYS (stpcpy, char *,
- (char *restrict __dst, char const *restrict __src)
+ (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (stpcpy, char *,
@@ -505,7 +515,7 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
@@ -514,7 +524,7 @@ _GL_CXXALIAS_RPL (stpncpy, char *,
# if ! @HAVE_STPNCPY@
_GL_FUNCDECL_SYS (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (stpncpy, char *,
@@ -550,14 +560,14 @@ _GL_WARN_ON_USE_CXX (strchr,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strchrnul rpl_strchrnul
# endif
-_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strchrnul, char *,
(const char *str, int ch));
# else
# if ! @HAVE_STRCHRNUL@
-_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -596,7 +606,7 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
# define strdup rpl_strdup
# endif
_GL_FUNCDECL_RPL (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
@@ -611,16 +621,17 @@ _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
/* strdup exists as a function and as a macro. Get rid of the macro. */
# undef strdup
# endif
-# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
+# if (!@HAVE_DECL_STRDUP@ || (__GNUC__ >= 11 && !defined __clang__)) \
+ && !defined strdup
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -629,17 +640,17 @@ _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
# endif
_GL_CXXALIASWARN (strdup);
#else
-# if __GNUC__ >= 11 && !defined strdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strdup
/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -678,7 +689,7 @@ _GL_CXXALIASWARN (strdup);
# define strncat rpl_strncat
# endif
_GL_FUNCDECL_RPL (strncat, char *,
- (char *restrict dest, const char *restrict src, size_t n)
+ (char *restrict dest, const char *restrict src, size_t n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strncat, char *,
(char *restrict dest, const char *restrict src, size_t n));
@@ -705,21 +716,22 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
# define strndup rpl_strndup
# endif
_GL_FUNCDECL_RPL (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
# else
-# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
+# if !@HAVE_DECL_STRNDUP@ \
+ || ((__GNUC__ >= 11 && !defined __clang__) && !defined strndup)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -728,17 +740,17 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s,
size_t __n));
# endif
_GL_CXXALIASWARN (strndup);
#else
-# if __GNUC__ >= 11 && !defined strndup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strndup
/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -761,13 +773,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
# undef strnlen
# define strnlen rpl_strnlen
# endif
-_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
# else
# if ! @HAVE_DECL_STRNLEN@
-_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -797,7 +809,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on
character strings "
/* Find the first occurrence in S of any character in ACCEPT. */
#if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@
-_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -882,7 +894,7 @@ _GL_WARN_ON_USE_CXX (strrchr,
#if @GNULIB_STRSEP@
# if ! @HAVE_STRSEP@
_GL_FUNCDECL_SYS (strsep, char *,
- (char **restrict __stringp, char const *restrict __delim)
+ (char **restrict __stringp, char const *restrict __delim),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (strsep, char *,
@@ -907,7 +919,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strstr rpl_strstr
# endif
-_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
@@ -953,7 +965,7 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many
systems, and cannot "
# define strcasestr rpl_strcasestr
# endif
_GL_FUNCDECL_RPL (strcasestr, char *,
- (const char *haystack, const char *needle)
+ (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *,
@@ -961,7 +973,7 @@ _GL_CXXALIAS_RPL (strcasestr, char *,
# else
# if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *,
- (const char *haystack, const char *needle)
+ (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1028,7 +1040,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work
correctly on character "
# endif
_GL_FUNCDECL_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim,
- char **restrict save_ptr)
+ char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim,
@@ -1040,7 +1052,7 @@ _GL_CXXALIAS_RPL (strtok_r, char *,
# if ! @HAVE_DECL_STRTOK_R@
_GL_FUNCDECL_SYS (strtok_r, char *,
(char *restrict s, char const *restrict delim,
- char **restrict save_ptr)
+ char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (strtok_r, char *,
@@ -1075,12 +1087,12 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbslen rpl_mbslen
# endif
-_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
# else
-_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
@@ -1107,12 +1119,12 @@ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t
len)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
# endif
-_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
# else
-_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
@@ -1129,12 +1141,12 @@ _GL_CXXALIASWARN (mbschr);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsrchr rpl_mbsrchr /* avoid collision with system function */
# endif
-_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
# else
-_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
@@ -1224,12 +1236,12 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const
char *accept)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
# endif
-_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
# else
-_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
@@ -1319,12 +1331,12 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - "
# undef strerror_r
# define strerror_r rpl_strerror_r
# endif
-_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
# else
# if !@HAVE_DECL_STRERROR_R@
-_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
@@ -1419,12 +1431,22 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
#endif
#if @GNULIB_STRVERSCMP@
-# if !@HAVE_STRVERSCMP@
-_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+# if @REPLACE_STRVERSCMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strverscmp rpl_strverscmp
+# endif
+_GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
-# endif
+_GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *));
+# else
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *),
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+# endif
_GL_CXXALIASWARN (strverscmp);
#elif defined GNULIB_POSIXCHECK
# undef strverscmp
diff --git a/gnulib/lib/strings.in.h b/gnulib/lib/strings.in.h
index 929329d003..2b3e062a82 100644
--- a/gnulib/lib/strings.in.h
+++ b/gnulib/lib/strings.in.h
@@ -1,6 +1,6 @@
/* A substitute <strings.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/stripslash.c b/gnulib/lib/stripslash.c
index fe46a9c109..c127ce7e63 100644
--- a/gnulib/lib/stripslash.c
+++ b/gnulib/lib/stripslash.c
@@ -1,6 +1,6 @@
/* stripslash.c -- remove redundant trailing slashes from a file name
- Copyright (C) 1990, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/strncasecmp.c b/gnulib/lib/strncasecmp.c
index 825ad5b25d..c79161f334 100644
--- a/gnulib/lib/strncasecmp.c
+++ b/gnulib/lib/strncasecmp.c
@@ -1,5 +1,5 @@
/* strncasecmp.c -- case insensitive string comparator
- Copyright (C) 1998-1999, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/strndup.c b/gnulib/lib/strndup.c
index 5c1f32ff61..abfa017267 100644
--- a/gnulib/lib/strndup.c
+++ b/gnulib/lib/strndup.c
@@ -1,6 +1,6 @@
/* A replacement function, for systems that lack strndup.
- Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2023 Free Software
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/strnlen.c b/gnulib/lib/strnlen.c
index 09c010eac4..5231e4c595 100644
--- a/gnulib/lib/strnlen.c
+++ b/gnulib/lib/strnlen.c
@@ -1,6 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
- Written by Simon Josefsson.
+ Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -19,12 +18,17 @@
#include <string.h>
-/* Find the length of STRING, but scan at most MAXLEN characters.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
+/* Find the length of S, but scan at most MAXLEN bytes.
+ S must be a string if it starts with fewer than MAXLEN initialized bytes.
+ If no '\0' terminator is found in that many bytes, return MAXLEN. */
size_t
-strnlen (const char *string, size_t maxlen)
+strnlen (const char *s, size_t maxlen)
{
- const char *end = memchr (string, '\0', maxlen);
- return end ? (size_t) (end - string) : maxlen;
+ /* Do not use memchr, because on some platforms memchr has
+ undefined behavior if MAXLEN exceeds the number of bytes in S. */
+ size_t i;
+ for (i = 0; i < maxlen && s[i]; i++)
+ continue;
+ return i;
}
diff --git a/gnulib/lib/strnlen1.c b/gnulib/lib/strnlen1.c
index 25866c5e9f..27c832ad7d 100644
--- a/gnulib/lib/strnlen1.c
+++ b/gnulib/lib/strnlen1.c
@@ -1,5 +1,5 @@
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/strnlen1.h b/gnulib/lib/strnlen1.h
index 02dcd4c4ab..8943f3edff 100644
--- a/gnulib/lib/strnlen1.h
+++ b/gnulib/lib/strnlen1.h
@@ -1,5 +1,5 @@
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/strstr.c b/gnulib/lib/strstr.c
index 574f4d5089..7ea2860397 100644
--- a/gnulib/lib/strstr.c
+++ b/gnulib/lib/strstr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2023 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2024 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gnulib/lib/sys_random.in.h b/gnulib/lib/sys_random.in.h
index b240033bcb..279ce62130 100644
--- a/gnulib/lib/sys_random.in.h
+++ b/gnulib/lib/sys_random.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/random.h>.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -45,7 +45,8 @@
#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
#define _@GUARD_PREFIX@_SYS_RANDOM_H
-/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+/* This file uses _GL_ATTRIBUTE_NODISCARD, GNULIB_POSIXCHECK,
+ HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -76,15 +77,15 @@
# define getrandom rpl_getrandom
# endif
_GL_FUNCDECL_RPL (getrandom, ssize_t,
- (void *buffer, size_t length, unsigned int flags)
- _GL_ARG_NONNULL ((1)));
+ (void *buffer, size_t length, unsigned int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags));
# else
# if !@HAVE_GETRANDOM@
_GL_FUNCDECL_SYS (getrandom, ssize_t,
- (void *buffer, size_t length, unsigned int flags)
- _GL_ARG_NONNULL ((1)));
+ (void *buffer, size_t length, unsigned int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags));
diff --git a/gnulib/lib/sys_stat.in.h b/gnulib/lib/sys_stat.in.h
index 25a539f705..d2ecdb9da9 100644
--- a/gnulib/lib/sys_stat.in.h
+++ b/gnulib/lib/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat.h header file.
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -55,7 +55,8 @@
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
#define _@GUARD_PREFIX@_SYS_STAT_H
-/* This file uses _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*.
*/
+/* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -65,7 +66,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -122,9 +123,11 @@
# if @GNULIB_STAT@
# define stat rpl_stat
# else
- /* Provoke a clear link error if stat() is used as a function and
- module 'stat' is not in use. */
-# define stat stat_used_without_requesting_gnulib_module_stat
+# if !GNULIB_STAT
+ /* Provoke a clear link error if stat() is used as a function and
+ module 'stat' is not in use. */
+# define stat stat_used_without_requesting_gnulib_module_stat
+# endif
# endif
# if !GNULIB_defined_struct_stat
@@ -433,7 +436,7 @@ struct stat
# undef chmod
# define chmod rpl_chmod
# endif
-_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode)
+_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -478,15 +481,15 @@ _GL_CXXALIASWARN (chmod);
# define fchmodat rpl_fchmodat
# endif
_GL_FUNCDECL_RPL (fchmodat, int,
- (int fd, char const *file, mode_t mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *file, mode_t mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag));
# else
# if !@HAVE_FCHMODAT@
_GL_FUNCDECL_SYS (fchmodat, int,
- (int fd, char const *file, mode_t mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *file, mode_t mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag));
@@ -507,7 +510,8 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
# undef fstat
# define fstat rpl_fstat
# endif
-_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL
((2)));
+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf),
+ _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
# else
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
@@ -516,8 +520,10 @@ _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
_GL_CXXALIASWARN (fstat);
# endif
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
-# undef fstat
-# define fstat fstat_used_without_requesting_gnulib_module_fstat
+# if !GNULIB_FSTAT
+# undef fstat
+# define fstat fstat_used_without_requesting_gnulib_module_fstat
+# endif
#elif @WINDOWS_64_BIT_ST_SIZE@
/* Above, we define stat to _stati64. */
# define fstat _fstati64
@@ -538,7 +544,7 @@ _GL_WARN_ON_USE (fstat, "fstat has portability problems - "
# endif
_GL_FUNCDECL_RPL (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st,
- int flags)
+ int flags),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st,
@@ -547,7 +553,7 @@ _GL_CXXALIAS_RPL (fstatat, int,
# if !@HAVE_FSTATAT@
_GL_FUNCDECL_SYS (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st,
- int flags)
+ int flags),
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (fstatat, int,
@@ -556,8 +562,10 @@ _GL_CXXALIAS_SYS (fstatat, int,
# endif
_GL_CXXALIASWARN (fstatat);
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
-# undef fstatat
-# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
+# if !GNULIB_FSTATAT
+# undef fstatat
+# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fstatat
# if HAVE_RAW_DECL_FSTATAT
@@ -600,7 +608,7 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
#if @GNULIB_GETUMASK@
# if !@HAVE_GETUMASK@
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
-_GL_FUNCDECL_SYS (getumask, mode_t, (void) _GL_ATTRIBUTE_NOTHROW);
+_GL_FUNCDECL_SYS (getumask, mode_t, (void)) _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (getumask, mode_t, (void));
# endif
@@ -622,7 +630,7 @@ _GL_WARN_ON_USE (getumask, "getumask is not portable - "
/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
denotes a symbolic link. */
# if !@HAVE_LCHMOD@ || defined __hpux
-_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
@@ -642,7 +650,7 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
# undef mkdir
# define mkdir rpl_mkdir
# endif
-_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -667,12 +675,6 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t
mode));
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
# endif
_GL_CXXALIASWARN (mkdir);
-#elif defined GNULIB_POSIXCHECK
-# undef mkdir
-# if HAVE_RAW_DECL_MKDIR
-_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
- "use gnulib module mkdir for portability");
-# endif
#elif @GNULIB_MDA_MKDIR@
/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
@@ -695,12 +697,18 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t
mode));
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
# endif
_GL_CXXALIASWARN (mkdir);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdir
+# if HAVE_RAW_DECL_MKDIR
+_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
+ "use gnulib module mkdir for portability");
+# endif
#endif
#if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@
-_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
@@ -720,12 +728,12 @@ _GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
# undef mkfifo
# define mkfifo rpl_mkfifo
# endif
-_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
# else
# if !@HAVE_MKFIFO@
-_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
@@ -746,12 +754,12 @@ _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
# undef mkfifoat
# define mkfifoat rpl_mkfifoat
# endif
-_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)
+_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode));
# else
# if !@HAVE_MKFIFOAT@
-_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
@@ -774,12 +782,12 @@ _GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
# undef mknod
# define mknod rpl_mknod
# endif
-_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
# else
# if !@HAVE_MKNOD@
-_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
@@ -802,14 +810,14 @@ _GL_WARN_ON_USE (mknod, "mknod is not portable - "
# define mknodat rpl_mknodat
# endif
_GL_FUNCDECL_RPL (mknodat, int,
- (int fd, char const *file, mode_t mode, dev_t dev)
+ (int fd, char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev));
# else
# if !@HAVE_MKNODAT@
_GL_FUNCDECL_SYS (mknodat, int,
- (int fd, char const *file, mode_t mode, dev_t dev)
+ (int fd, char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mknodat, int,
@@ -916,7 +924,7 @@ _GL_CXXALIAS_RPL_1 (lstat, stat, int,
# define lstat rpl_lstat
# endif
_GL_FUNCDECL_RPL (lstat, int,
- (const char *restrict name, struct stat *restrict buf)
+ (const char *restrict name, struct stat *restrict buf),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (lstat, int,
(const char *restrict name, struct stat *restrict buf));
@@ -928,8 +936,10 @@ _GL_CXXALIAS_SYS (lstat, int,
_GL_CXXALIASWARN (lstat);
# endif
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
-# undef lstat
-# define lstat lstat_used_without_requesting_gnulib_module_lstat
+# if !GNULIB_LSTAT
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
+# endif
#elif defined GNULIB_POSIXCHECK
# undef lstat
# if HAVE_RAW_DECL_LSTAT
@@ -968,14 +978,14 @@ _GL_CXXALIASWARN (umask);
# define utimensat rpl_utimensat
# endif
_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
- struct timespec const times[2], int flag)
+ struct timespec const times[2], int flag),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# else
# if !@HAVE_UTIMENSAT@
_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
- struct timespec const times[2], int flag)
+ struct timespec const times[2], int flag),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
diff --git a/gnulib/lib/sys_types.in.h b/gnulib/lib/sys_types.in.h
index ea77e140be..4eb2e92696 100644
--- a/gnulib/lib/sys_types.in.h
+++ b/gnulib/lib/sys_types.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -60,6 +60,15 @@
# define _GL_WINDOWS_64_BIT_OFF_T 1
#endif
+/* Define the off64_t type. */
+#if !@HAVE_OFF64_T@
+# if !GNULIB_defined_off64_t
+/* Define off64_t to int64_t always. */
+typedef long long off64_t;
+# define GNULIB_defined_off64_t 1
+# endif
+#endif
+
/* Override dev_t and ino_t if distinguishable inodes support is requested
on native Windows. */
#if @WINDOWS_STAT_INODES@
diff --git a/gnulib/lib/tempname.c b/gnulib/lib/tempname.c
index bf362db6e1..446ddeaef1 100644
--- a/gnulib/lib/tempname.c
+++ b/gnulib/lib/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -193,7 +193,7 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
char *XXXXXX;
unsigned int count;
int fd = -1;
- int save_errno = errno;
+ int saved_errno = errno;
/* A lower bound on the number of temporary files to attempt to
generate. The maximum total number of temporary file names that
@@ -258,7 +258,7 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
fd = tryfunc (tmpl, args);
if (fd >= 0)
{
- __set_errno (save_errno);
+ __set_errno (saved_errno);
return fd;
}
else if (errno != EEXIST)
diff --git a/gnulib/lib/tempname.h b/gnulib/lib/tempname.h
index 36a5138154..7cbdac95de 100644
--- a/gnulib/lib/tempname.h
+++ b/gnulib/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/time.in.h b/gnulib/lib/time.in.h
index 06824da9d3..eebc60d42c 100644
--- a/gnulib/lib/time.in.h
+++ b/gnulib/lib/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -122,6 +122,23 @@ struct __time_t_must_be_integral {
# endif
# endif
+# if @GNULIB_TZNAME@
+/* tzname[0..1]: Abbreviated time zone names, set by the tzset() function. */
+# if NEED_DECL_TZNAME
+extern
+# ifdef __cplusplus
+ "C"
+# endif
+ char *tzname[];
+# endif
+# if defined _WIN32 && !defined __CYGWIN__
+/* On native Windows, map 'tzname' to '_tzname' etc., so that -loldnames is not
+ required. */
+# undef tzname
+# define tzname _tzname
+# endif
+# endif
+
/* Set *TS to the current time, and return BASE.
Upon failure, return 0. */
# if @GNULIB_TIMESPEC_GET@
@@ -130,12 +147,12 @@ struct __time_t_must_be_integral {
# undef timespec_get
# define timespec_get rpl_timespec_get
# endif
-_GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base)
+_GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base));
# else
# if !@HAVE_TIMESPEC_GET@
-_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base)
+_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
@@ -154,11 +171,21 @@ _GL_WARN_ON_USE (timespec_get, "timespec_get is
unportable - "
/* Set *TS to the current time resolution, and return BASE.
Upon failure, return 0. */
# if @GNULIB_TIMESPEC_GETRES@
-# if ! @HAVE_TIMESPEC_GETRES@
-_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
+# if @REPLACE_TIMESPEC_GETRES@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef timespec_getres
+# define timespec_getres rpl_timespec_getres
+# endif
+_GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1)));
-# endif
+_GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base));
+# else
+# if !@HAVE_TIMESPEC_GETRES@
+_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base),
+ _GL_ARG_NONNULL ((1)));
+# endif
_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
+# endif
_GL_CXXALIASWARN (timespec_getres);
# elif defined GNULIB_POSIXCHECK
# undef timespec_getres
@@ -199,14 +226,14 @@ _GL_WARN_ON_USE (time, "time has consistency problems - "
# define nanosleep rpl_nanosleep
# endif
_GL_FUNCDECL_RPL (nanosleep, int,
- (struct timespec const *__rqtp, struct timespec *__rmtp)
+ (struct timespec const *__rqtp, struct timespec *__rmtp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp));
# else
# if ! @HAVE_NANOSLEEP@
_GL_FUNCDECL_SYS (nanosleep, int,
- (struct timespec const *__rqtp, struct timespec *__rmtp)
+ (struct timespec const *__rqtp, struct timespec *__rmtp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (nanosleep, int,
@@ -268,7 +295,7 @@ _GL_WARN_ON_USE (tzset, "tzset has portability problems - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mktime rpl_mktime
# endif
-_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
# else
_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
@@ -294,14 +321,14 @@ _GL_WARN_ON_USE (mktime, "mktime has portability problems
- "
# define localtime_r rpl_localtime_r
# endif
_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
- struct tm *restrict __result)
+ struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
- struct tm *restrict __result)
+ struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
@@ -316,14 +343,14 @@ _GL_CXXALIASWARN (localtime_r);
# define gmtime_r rpl_gmtime_r
# endif
_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
- struct tm *restrict __result)
+ struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
- struct tm *restrict __result)
+ struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
@@ -354,7 +381,7 @@ _GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - "
# undef localtime
# define localtime rpl_localtime
# endif
-_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
# else
@@ -377,7 +404,7 @@ _GL_WARN_ON_USE (localtime, "localtime has portability
problems - "
# undef gmtime
# define gmtime rpl_gmtime
# endif
-_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
# else
@@ -393,7 +420,7 @@ _GL_CXXALIASWARN (gmtime);
# if ! @HAVE_STRPTIME@
_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
char const *restrict __format,
- struct tm *restrict __tm)
+ struct tm *restrict __tm),
_GL_ARG_NONNULL ((1, 2, 3)));
# endif
_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
@@ -418,7 +445,7 @@ _GL_WARN_ON_USE (strptime, "strptime is unportable - "
# ifndef __cplusplus
_GL_ATTRIBUTE_DEPRECATED
# endif
-_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
+_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
# else
@@ -428,11 +455,7 @@ _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
_GL_CXXALIASWARN (ctime);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef ctime
-# if HAVE_RAW_DECL_CTIME
-_GL_WARN_ON_USE (ctime, "ctime has portability problems - "
- "use gnulib module ctime for portability");
-# endif
+/* No need to warn about portability, as a more serious warning is below. */
# endif
/* Convert *TP to a date and time string. See
@@ -444,7 +467,7 @@ _GL_WARN_ON_USE (ctime, "ctime has portability problems - "
# endif
_GL_FUNCDECL_RPL (strftime, size_t,
(char *restrict __buf, size_t __bufsize,
- const char *restrict __fmt, const struct tm *restrict __tp)
+ const char *restrict __fmt, const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4)));
_GL_CXXALIAS_RPL (strftime, size_t,
(char *restrict __buf, size_t __bufsize,
@@ -498,7 +521,8 @@ _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
of an implicit global time zone. */
_GL_FUNCDECL_SYS (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer,
- struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
+ struct tm *restrict __result),
+ _GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_SYS (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer,
struct tm *restrict __result));
@@ -509,7 +533,7 @@ _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
This function is like 'mktime', but relies on the argument TZ instead
of an implicit global time zone. */
_GL_FUNCDECL_SYS (mktime_z, time_t,
- (timezone_t __tz, struct tm *restrict __tm)
+ (timezone_t __tz, struct tm *restrict __tm),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_SYS (mktime_z, time_t,
(timezone_t __tz, struct tm *restrict __tm));
@@ -529,11 +553,11 @@ _GL_CXXALIAS_SYS (mktime_z, time_t,
# undef timegm
# define timegm rpl_timegm
# endif
-_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
# else
# if ! @HAVE_TIMEGM@
-_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# endif
diff --git a/gnulib/lib/uchar.in.h b/gnulib/lib/uchar.in.h
index 1856aec823..9f2360471e 100644
--- a/gnulib/lib/uchar.in.h
+++ b/gnulib/lib/uchar.in.h
@@ -1,5 +1,5 @@
/* <uchar.h> substitute - 16-bit and 32-bit wide character types.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -170,7 +170,7 @@ btoc32 (int c)
}
_GL_END_C_LINKAGE
# else
-_GL_FUNCDECL_SYS (btoc32, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (btoc32, wint_t, (int c), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (btoc32, wint_t, (int c));
_GL_CXXALIASWARN (btoc32);
@@ -516,7 +516,7 @@ _GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (c32snrtombs, size_t,
(char *dest, const char32_t **srcp, size_t srclen, size_t
len,
- mbstate_t *ps)
+ mbstate_t *ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (c32snrtombs, size_t,
@@ -542,7 +542,8 @@ c32srtombs (char *dest, const char32_t **srcp, size_t len,
mbstate_t *ps)
_GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (c32srtombs, size_t,
- (char *dest, const char32_t **srcp, size_t len, mbstate_t
*ps)
+ (char *dest, const char32_t **srcp, size_t len,
+ mbstate_t *ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (c32srtombs, size_t,
@@ -567,7 +568,7 @@ c32stombs (char *dest, const char32_t *src, size_t len)
_GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (c32stombs, size_t,
- (char *dest, const char32_t *src, size_t len)
+ (char *dest, const char32_t *src, size_t len),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (c32stombs, size_t,
@@ -591,7 +592,7 @@ c32swidth (const char32_t *s, size_t n)
}
_GL_END_C_LINKAGE
# else
-_GL_FUNCDECL_SYS (c32swidth, int, (const char32_t *s, size_t n)
+_GL_FUNCDECL_SYS (c32swidth, int, (const char32_t *s, size_t n),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (c32swidth, int, (const char32_t *s, size_t n));
@@ -667,7 +668,7 @@ _GL_FUNCDECL_RPL (mbrtoc16, size_t,
_GL_CXXALIAS_RPL (mbrtoc16, size_t,
(char16_t *pc, const char *s, size_t n, mbstate_t *ps));
# else
-# if !@HAVE_MBRTOC32@
+# if !@HAVE_MBRTOC16@
_GL_FUNCDECL_SYS (mbrtoc16, size_t,
(char16_t *pc, const char *s, size_t n, mbstate_t *ps));
# endif
@@ -704,7 +705,7 @@ _GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (mbsnrtoc32s, size_t,
(char32_t *dest, const char **srcp, size_t srclen, size_t
len,
- mbstate_t *ps)
+ mbstate_t *ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsnrtoc32s, size_t,
@@ -730,7 +731,8 @@ mbsrtoc32s (char32_t *dest, const char **srcp, size_t len,
mbstate_t *ps)
_GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (mbsrtoc32s, size_t,
- (char32_t *dest, const char **srcp, size_t len, mbstate_t
*ps)
+ (char32_t *dest, const char **srcp, size_t len,
+ mbstate_t *ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsrtoc32s, size_t,
@@ -755,7 +757,7 @@ mbstoc32s (char32_t *dest, const char *src, size_t len)
_GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (mbstoc32s, size_t,
- (char32_t *dest, const char *src, size_t len)
+ (char32_t *dest, const char *src, size_t len),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbstoc32s, size_t,
@@ -796,7 +798,7 @@ c32_get_type_test (const char *name)
}
_GL_END_C_LINKAGE
# else
-_GL_FUNCDECL_SYS (c32_get_type_test, c32_type_test_t, (const char *name)
+_GL_FUNCDECL_SYS (c32_get_type_test, c32_type_test_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (c32_get_type_test, c32_type_test_t, (const char *name));
@@ -828,7 +830,7 @@ _GL_FUNCDECL_SYS (c32_apply_type_test, int,
# endif
# else
_GL_FUNCDECL_SYS (c32_apply_type_test, int,
- (wint_t wc, c32_type_test_t property)
+ (wint_t wc, c32_type_test_t property),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (c32_apply_type_test, int,
@@ -868,7 +870,7 @@ c32_get_mapping (const char *name)
}
_GL_END_C_LINKAGE
# else
-_GL_FUNCDECL_SYS (c32_get_mapping, c32_mapping_t, (const char *name)
+_GL_FUNCDECL_SYS (c32_get_mapping, c32_mapping_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (c32_get_mapping, c32_mapping_t, (const char *name));
@@ -895,7 +897,7 @@ c32_apply_mapping (wint_t wc, c32_mapping_t mapping)
_GL_END_C_LINKAGE
# else
_GL_FUNCDECL_SYS (c32_apply_mapping, wint_t,
- (wint_t wc, c32_mapping_t mapping)
+ (wint_t wc, c32_mapping_t mapping),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (c32_apply_mapping, wint_t,
diff --git a/gnulib/lib/unicase.in.h b/gnulib/lib/unicase.in.h
index 64ab3745c3..bd705baf01 100644
--- a/gnulib/lib/unicase.in.h
+++ b/gnulib/lib/unicase.in.h
@@ -1,5 +1,5 @@
/* Unicode character case mappings.
- Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unicase/simple-mapping.h
b/gnulib/lib/unicase/simple-mapping.h
index 6b44fc2e87..6102b76843 100644
--- a/gnulib/lib/unicase/simple-mapping.h
+++ b/gnulib/lib/unicase/simple-mapping.h
@@ -1,5 +1,5 @@
/* Simple case mapping for Unicode characters.
- Copyright (C) 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unicase/tolower.c b/gnulib/lib/unicase/tolower.c
index 8c8efa55e6..0a62cd5066 100644
--- a/gnulib/lib/unicase/tolower.c
+++ b/gnulib/lib/unicase/tolower.c
@@ -1,5 +1,5 @@
/* Lowercase mapping for Unicode characters (locale and context independent).
- Copyright (C) 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unicase/tolower.h b/gnulib/lib/unicase/tolower.h
index 6fa031c911..9c125f5054 100644
--- a/gnulib/lib/unicase/tolower.h
+++ b/gnulib/lib/unicase/tolower.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Simple character mapping of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype.in.h b/gnulib/lib/unictype.in.h
index bab2aaf97a..fdd2cd1cec 100644
--- a/gnulib/lib/unictype.in.h
+++ b/gnulib/lib/unictype.in.h
@@ -1,5 +1,5 @@
/* Unicode character classification and properties.
- Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -640,6 +640,8 @@ extern @GNULIB_UNICTYPE_PROPERTY_ID_CONTINUE_DLL_VARIABLE@
const uc_property_t U
extern @GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_OTHER_ID_CONTINUE;
extern @GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_XID_START;
extern @GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_XID_CONTINUE;
+extern @GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_ID_COMPAT_MATH_START;
+extern @GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_ID_COMPAT_MATH_CONTINUE;
extern @GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_PATTERN_WHITE_SPACE;
extern @GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_PATTERN_SYNTAX;
/* Shaping and rendering. */
@@ -673,6 +675,7 @@ extern
@GNULIB_UNICTYPE_PROPERTY_ASCII_HEX_DIGIT_DLL_VARIABLE@ const uc_property
extern @GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_IDEOGRAPHIC;
extern @GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_UNIFIED_IDEOGRAPH;
extern @GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_RADICAL;
+extern @GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_IDS_UNARY_OPERATOR;
extern @GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_IDS_BINARY_OPERATOR;
extern @GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_IDS_TRINARY_OPERATOR;
/* Emoji. */
@@ -688,6 +691,7 @@ extern @GNULIB_UNICTYPE_PROPERTY_SPACE_DLL_VARIABLE@ const
uc_property_t UC_PROP
extern @GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_NON_BREAK;
extern @GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_ISO_CONTROL;
extern @GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE@ const
uc_property_t UC_PROPERTY_FORMAT_CONTROL;
+extern @GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE@
const uc_property_t UC_PROPERTY_PREPENDED_CONCATENATION_MARK;
extern @GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_DASH;
extern @GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_HYPHEN;
extern @GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE@ const uc_property_t
UC_PROPERTY_PUNCTUATION;
@@ -780,6 +784,10 @@ extern bool uc_is_property_xid_start (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_xid_continue (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
+extern bool uc_is_property_id_compat_math_start (ucs4_t uc)
+ _UC_ATTRIBUTE_CONST;
+extern bool uc_is_property_id_compat_math_continue (ucs4_t uc)
+ _UC_ATTRIBUTE_CONST;
extern bool uc_is_property_pattern_white_space (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_pattern_syntax (ucs4_t uc)
@@ -838,6 +846,8 @@ extern bool uc_is_property_unified_ideograph (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_radical (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
+extern bool uc_is_property_ids_unary_operator (ucs4_t uc)
+ _UC_ATTRIBUTE_CONST;
extern bool uc_is_property_ids_binary_operator (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_ids_trinary_operator (ucs4_t uc)
@@ -864,6 +874,8 @@ extern bool uc_is_property_iso_control (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_format_control (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
+extern bool uc_is_property_prepended_concatenation_mark (ucs4_t uc)
+ _UC_ATTRIBUTE_CONST;
extern bool uc_is_property_dash (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
extern bool uc_is_property_hyphen (ucs4_t uc)
@@ -909,6 +921,40 @@ extern bool uc_is_property_regional_indicator (ucs4_t uc)
/* ========================================================================= */
+/* Other attributes. */
+
+/* ------------------------------------------------------------------------- */
+
+/* Indic_Conjunct_Break (InCB): from the file DerivedCoreProperties.txt
+ in the Unicode Character Database. */
+
+/* Possible values of the Indic_Conjunct_Break attribute.
+ This enumeration may be extended in the future. */
+enum
+{
+ UC_INDIC_CONJUNCT_BREAK_NONE, /* None */
+ UC_INDIC_CONJUNCT_BREAK_CONSONANT, /* Consonant */
+ UC_INDIC_CONJUNCT_BREAK_LINKER, /* Linker */
+ UC_INDIC_CONJUNCT_BREAK_EXTEND /* Extend */
+};
+
+/* Return the name of an Indic_Conjunct_Break value. */
+extern const char *
+ uc_indic_conjunct_break_name (int indic_conjunct_break)
+ _UC_ATTRIBUTE_CONST;
+
+/* Return the Indic_Conjunct_Break value given by name, e.g. "Consonant". */
+extern int
+ uc_indic_conjunct_break_byname (const char *indic_conjunct_break_name)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the Indic_Conjunct_Break attribute of a Unicode character. */
+extern int
+ uc_indic_conjunct_break (ucs4_t uc)
+ _UC_ATTRIBUTE_CONST;
+
+/* ========================================================================= */
+
/* Subdivision of the Unicode characters into scripts. */
typedef struct
diff --git a/gnulib/lib/unictype/bitmap.h b/gnulib/lib/unictype/bitmap.h
index 9da85c1126..dba2365516 100644
--- a/gnulib/lib/unictype/bitmap.h
+++ b/gnulib/lib/unictype/bitmap.h
@@ -1,5 +1,5 @@
/* Three-level bitmap lookup.
- Copyright (C) 2000-2002, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002, 2005-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2000-2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_alnum.c
b/gnulib/lib/unictype/ctype_alnum.c
index ec11ba3948..1f69c14ada 100644
--- a/gnulib/lib/unictype/ctype_alnum.c
+++ b/gnulib/lib/unictype/ctype_alnum.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_alnum.h
b/gnulib/lib/unictype/ctype_alnum.h
index 4629789862..9e28bb67dc 100644
--- a/gnulib/lib/unictype/ctype_alnum.h
+++ b/gnulib/lib/unictype/ctype_alnum.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,7 +27,7 @@ struct
int header[1];
int level1[4];
short level2[4 << 7];
- unsigned int level3[80 << 4];
+ unsigned int level3[81 << 4];
}
u_is_alnum =
{
@@ -413,14 +413,14 @@ u_is_alnum =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 1216,
- -1,
- -1,
+ 5 + 512 * sizeof (short) / sizeof (int) + 336,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1232,
-1,
-1,
-1,
-1,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1232,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1248,
-1,
-1,
5 + 512 * sizeof (short) / sizeof (int) + 336,
@@ -432,7 +432,7 @@ u_is_alnum =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1248,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1264,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
@@ -440,7 +440,7 @@ u_is_alnum =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1264,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1280,
-1,
-1,
-1,
@@ -860,7 +860,11 @@ u_is_alnum =
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x3FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
diff --git a/gnulib/lib/unictype/ctype_alpha.c
b/gnulib/lib/unictype/ctype_alpha.c
index cd3629ba5e..16cddc9204 100644
--- a/gnulib/lib/unictype/ctype_alpha.c
+++ b/gnulib/lib/unictype/ctype_alpha.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_alpha.h
b/gnulib/lib/unictype/ctype_alpha.h
index 91a5e82257..7709886b17 100644
--- a/gnulib/lib/unictype/ctype_alpha.h
+++ b/gnulib/lib/unictype/ctype_alpha.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,7 +27,7 @@ struct
int header[1];
int level1[4];
short level2[4 << 7];
- unsigned int level3[80 << 4];
+ unsigned int level3[81 << 4];
}
u_is_alpha =
{
@@ -413,14 +413,14 @@ u_is_alpha =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 1216,
- -1,
- -1,
+ 5 + 512 * sizeof (short) / sizeof (int) + 336,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1232,
-1,
-1,
-1,
-1,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1232,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1248,
-1,
-1,
5 + 512 * sizeof (short) / sizeof (int) + 336,
@@ -432,7 +432,7 @@ u_is_alpha =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1248,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1264,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
@@ -440,7 +440,7 @@ u_is_alpha =
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
5 + 512 * sizeof (short) / sizeof (int) + 336,
- 5 + 512 * sizeof (short) / sizeof (int) + 1264,
+ 5 + 512 * sizeof (short) / sizeof (int) + 1280,
-1,
-1,
-1,
@@ -860,7 +860,11 @@ u_is_alpha =
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x3FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
diff --git a/gnulib/lib/unictype/ctype_blank.c
b/gnulib/lib/unictype/ctype_blank.c
index 29931929b8..cec8e023ca 100644
--- a/gnulib/lib/unictype/ctype_blank.c
+++ b/gnulib/lib/unictype/ctype_blank.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_blank.h
b/gnulib/lib/unictype/ctype_blank.h
index 5ed5fbbed8..5ba76c72d6 100644
--- a/gnulib/lib/unictype/ctype_blank.h
+++ b/gnulib/lib/unictype/ctype_blank.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_cntrl.c
b/gnulib/lib/unictype/ctype_cntrl.c
index a847a55f81..6ed527399c 100644
--- a/gnulib/lib/unictype/ctype_cntrl.c
+++ b/gnulib/lib/unictype/ctype_cntrl.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_cntrl.h
b/gnulib/lib/unictype/ctype_cntrl.h
index c1c179418c..8eb1651362 100644
--- a/gnulib/lib/unictype/ctype_cntrl.h
+++ b/gnulib/lib/unictype/ctype_cntrl.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_digit.c
b/gnulib/lib/unictype/ctype_digit.c
index 18956a51dd..906e73756b 100644
--- a/gnulib/lib/unictype/ctype_digit.c
+++ b/gnulib/lib/unictype/ctype_digit.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_digit.h
b/gnulib/lib/unictype/ctype_digit.h
index 3111b9ade1..4421f6f4b6 100644
--- a/gnulib/lib/unictype/ctype_digit.h
+++ b/gnulib/lib/unictype/ctype_digit.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_graph.c
b/gnulib/lib/unictype/ctype_graph.c
index a3674c95ce..e58f69e4d0 100644
--- a/gnulib/lib/unictype/ctype_graph.c
+++ b/gnulib/lib/unictype/ctype_graph.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_graph.h
b/gnulib/lib/unictype/ctype_graph.h
index d95722e1a3..bb5281b962 100644
--- a/gnulib/lib/unictype/ctype_graph.h
+++ b/gnulib/lib/unictype/ctype_graph.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,7 +27,7 @@ struct
int header[1];
int level1[17];
short level2[6 << 7];
- unsigned int level3[89 << 4];
+ unsigned int level3[90 << 4];
}
u_is_graph =
{
@@ -426,14 +426,14 @@ u_is_graph =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 1328,
- -1,
- -1,
+ 18 + 768 * sizeof (short) / sizeof (int) + 160,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1344,
-1,
-1,
-1,
-1,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1344,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1360,
-1,
-1,
18 + 768 * sizeof (short) / sizeof (int) + 160,
@@ -445,7 +445,7 @@ u_is_graph =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1360,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1376,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
@@ -453,7 +453,7 @@ u_is_graph =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1376,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1392,
-1,
-1,
-1,
@@ -564,7 +564,7 @@ u_is_graph =
-1,
-1,
-1,
- 18 + 768 * sizeof (short) / sizeof (int) + 1392,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1408,
-1,
-1,
-1,
@@ -819,7 +819,7 @@ u_is_graph =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1408
+ 18 + 768 * sizeof (short) / sizeof (int) + 1424
},
{
0x00000000U, 0xFFFFFFFEU, 0xFFFFFFFFU, 0x7FFFFFFFU,
@@ -905,11 +905,11 @@ u_is_graph =
0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
0xFBFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x0FFF0000U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0xFFFF0000U,
0xFFFFFFFEU, 0xFFFFFFFFU, 0xFFFFFFFEU, 0xFFFFFFFFU,
0xFE7FFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFE0U, 0xFFFEFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFF7FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF000FU,
+ 0xFFFF7FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF800FU,
0x7FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
@@ -1157,7 +1157,11 @@ u_is_graph =
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x3FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
diff --git a/gnulib/lib/unictype/ctype_lower.c
b/gnulib/lib/unictype/ctype_lower.c
index 750b7db0fd..76c67635df 100644
--- a/gnulib/lib/unictype/ctype_lower.c
+++ b/gnulib/lib/unictype/ctype_lower.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_lower.h
b/gnulib/lib/unictype/ctype_lower.h
index c487a16922..6bde4107d2 100644
--- a/gnulib/lib/unictype/ctype_lower.h
+++ b/gnulib/lib/unictype/ctype_lower.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_print.c
b/gnulib/lib/unictype/ctype_print.c
index aa657666d7..5e73e42db5 100644
--- a/gnulib/lib/unictype/ctype_print.c
+++ b/gnulib/lib/unictype/ctype_print.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_print.h
b/gnulib/lib/unictype/ctype_print.h
index 7dce963ef5..d5d6a2a7a8 100644
--- a/gnulib/lib/unictype/ctype_print.h
+++ b/gnulib/lib/unictype/ctype_print.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,7 +27,7 @@ struct
int header[1];
int level1[17];
short level2[6 << 7];
- unsigned int level3[89 << 4];
+ unsigned int level3[90 << 4];
}
u_is_print =
{
@@ -426,14 +426,14 @@ u_is_print =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 1328,
- -1,
- -1,
+ 18 + 768 * sizeof (short) / sizeof (int) + 160,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1344,
-1,
-1,
-1,
-1,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1344,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1360,
-1,
-1,
18 + 768 * sizeof (short) / sizeof (int) + 160,
@@ -445,7 +445,7 @@ u_is_print =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1360,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1376,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
@@ -453,7 +453,7 @@ u_is_print =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1376,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1392,
-1,
-1,
-1,
@@ -564,7 +564,7 @@ u_is_print =
-1,
-1,
-1,
- 18 + 768 * sizeof (short) / sizeof (int) + 1392,
+ 18 + 768 * sizeof (short) / sizeof (int) + 1408,
-1,
-1,
-1,
@@ -819,7 +819,7 @@ u_is_print =
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
18 + 768 * sizeof (short) / sizeof (int) + 160,
- 18 + 768 * sizeof (short) / sizeof (int) + 1408
+ 18 + 768 * sizeof (short) / sizeof (int) + 1424
},
{
0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU,
@@ -905,11 +905,11 @@ u_is_print =
0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
0xFBFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x0FFF0000U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0xFFFF0000U,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFEU, 0xFFFFFFFFU,
0xFE7FFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFE0U, 0xFFFEFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFF7FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF000FU,
+ 0xFFFF7FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF800FU,
0x7FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
@@ -1157,7 +1157,11 @@ u_is_print =
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0001U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
+ 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x3FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
diff --git a/gnulib/lib/unictype/ctype_punct.c
b/gnulib/lib/unictype/ctype_punct.c
index 76e4594bc3..3991feed31 100644
--- a/gnulib/lib/unictype/ctype_punct.c
+++ b/gnulib/lib/unictype/ctype_punct.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_punct.h
b/gnulib/lib/unictype/ctype_punct.h
index 22f66f0139..6a0f287884 100644
--- a/gnulib/lib/unictype/ctype_punct.h
+++ b/gnulib/lib/unictype/ctype_punct.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -653,11 +653,11 @@ u_is_punct =
0xFFFFFFFFU, 0xFFFF7FFFU, 0x3FFFFFFFU, 0x00000000U,
0xFBFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
- 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x0FFF0000U,
+ 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0xFFFF0000U,
0xFFFFFF1EU, 0xE0C1FC01U, 0x00000000U, 0x00000000U,
0x1E000000U, 0x00000001U, 0x00000000U, 0x08000000U,
0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U,
- 0xFFFF0000U, 0x00000000U, 0xFFFFFFFFU, 0x0000000FU,
+ 0xFFFF0000U, 0x00000000U, 0xFFFFFFFFU, 0x0000800FU,
0x7FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU,
diff --git a/gnulib/lib/unictype/ctype_space.c
b/gnulib/lib/unictype/ctype_space.c
index 39cfe4ed5f..cdfe54d99a 100644
--- a/gnulib/lib/unictype/ctype_space.c
+++ b/gnulib/lib/unictype/ctype_space.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_space.h
b/gnulib/lib/unictype/ctype_space.h
index 69521a5a0c..89e3a329e6 100644
--- a/gnulib/lib/unictype/ctype_space.h
+++ b/gnulib/lib/unictype/ctype_space.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_upper.c
b/gnulib/lib/unictype/ctype_upper.c
index b74486171f..02110cc6af 100644
--- a/gnulib/lib/unictype/ctype_upper.c
+++ b/gnulib/lib/unictype/ctype_upper.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_upper.h
b/gnulib/lib/unictype/ctype_upper.h
index dbe1da4d54..d9259bf80d 100644
--- a/gnulib/lib/unictype/ctype_upper.h
+++ b/gnulib/lib/unictype/ctype_upper.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/unictype/ctype_xdigit.c
b/gnulib/lib/unictype/ctype_xdigit.c
index cd067269b2..1e5a162704 100644
--- a/gnulib/lib/unictype/ctype_xdigit.c
+++ b/gnulib/lib/unictype/ctype_xdigit.c
@@ -1,5 +1,5 @@
/* ISO C <ctype.h> like properties of Unicode characters.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unictype/ctype_xdigit.h
b/gnulib/lib/unictype/ctype_xdigit.h
index 1438f94f8b..02d9c2dfc4 100644
--- a/gnulib/lib/unictype/ctype_xdigit.h
+++ b/gnulib/lib/unictype/ctype_xdigit.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ISO C <ctype.h> like properties of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/uninorm.in.h b/gnulib/lib/uninorm.in.h
index 0698246ac7..a7f6ec3a76 100644
--- a/gnulib/lib/uninorm.in.h
+++ b/gnulib/lib/uninorm.in.h
@@ -1,5 +1,5 @@
/* Normalization forms (composition and decomposition) of Unicode strings.
- Copyright (C) 2001-2002, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/unistd.c b/gnulib/lib/unistd.c
index be7a825503..f3b3f7bd2f 100644
--- a/gnulib/lib/unistd.c
+++ b/gnulib/lib/unistd.c
@@ -1,6 +1,6 @@
/* Inline functions for <unistd.h>.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,5 +18,5 @@
#include <config.h>
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
-#include "unistd.h"
+#include <unistd.h>
typedef int dummy;
diff --git a/gnulib/lib/unistd.in.h b/gnulib/lib/unistd.in.h
index 2ae040a76b..3222f5a568 100644
--- a/gnulib/lib/unistd.in.h
+++ b/gnulib/lib/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -69,8 +69,8 @@
#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
#define _@GUARD_PREFIX@_UNISTD_H
-/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+/* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -159,8 +159,9 @@
#endif
/* MSVC defines off_t in <sys/types.h>.
- May also define off_t to a 64-bit type on native Windows. */
-/* Get off_t, ssize_t, mode_t. */
+ May also define off_t to a 64-bit type on native Windows.
+ Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
+/* Get off_t, off64_t, ssize_t, mode_t. */
#include <sys/types.h>
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -286,7 +287,7 @@ _GL_INLINE_HEADER_BEGIN
# undef access
# define access rpl_access
# endif
-_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
+_GL_FUNCDECL_RPL (access, int, (const char *file, int mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -339,7 +340,7 @@ _GL_CXXALIASWARN (chdir);
#elif defined GNULIB_POSIXCHECK
# undef chdir
# if HAVE_RAW_DECL_CHDIR
-_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+_GL_WARN_ON_USE (chdir, "chdir is not always in <unistd.h> - "
"use gnulib module chdir for portability");
# endif
#elif @GNULIB_MDA_CHDIR@
@@ -370,13 +371,13 @@ _GL_CXXALIASWARN (chdir);
# undef chown
# define chown rpl_chown
# endif
-_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
# else
# if !@HAVE_CHOWN@
-_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
# endif
@@ -411,8 +412,10 @@ _GL_CXXALIAS_SYS (close, int, (int fd));
# endif
_GL_CXXALIASWARN (close);
#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
-# undef close
-# define close close_used_without_requesting_gnulib_module_close
+# if !GNULIB_CLOSE
+# undef close
+# define close close_used_without_requesting_gnulib_module_close
+# endif
#elif defined GNULIB_POSIXCHECK
# undef close
/* Assume close is always declared. */
@@ -473,7 +476,7 @@ _GL_WARN_ON_USE (copy_file_range,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup rpl_dup
# endif
-_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_FUNCDECL_RPL (dup, int, (int oldfd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (dup, int, (int oldfd));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -636,7 +639,7 @@ rpl_environ (void)
/* Like access(), except that it uses the effective user id and group id of
the current process. */
# if !@HAVE_EUIDACCESS@
-_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
@@ -661,7 +664,7 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
# undef execl
# define execl rpl_execl
# endif
-_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
# else
@@ -696,7 +699,7 @@ _GL_CXXALIASWARN (execl);
# undef execle
# define execle rpl_execle
# endif
-_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
# else
@@ -732,7 +735,7 @@ _GL_CXXALIASWARN (execle);
# undef execlp
# define execlp rpl_execlp
# endif
-_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
# else
@@ -769,7 +772,7 @@ _GL_CXXALIASWARN (execlp);
# undef execv
# define execv rpl_execv
# endif
-_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
# else
@@ -806,7 +809,7 @@ _GL_CXXALIASWARN (execv);
# define execve rpl_execve
# endif
_GL_FUNCDECL_RPL (execve, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execve, int,
(const char *program, char * const *argv, char * const
*env));
@@ -846,7 +849,7 @@ _GL_CXXALIASWARN (execve);
# undef execvp
# define execvp rpl_execvp
# endif
-_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
# else
@@ -883,14 +886,14 @@ _GL_CXXALIASWARN (execvp);
# define execvpe rpl_execvpe
# endif
_GL_FUNCDECL_RPL (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvpe, int,
(const char *program, char * const *argv, char * const
*env));
# else
# if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (execvpe, int,
@@ -921,7 +924,7 @@ _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
# elif @HAVE_EXECVPE@
# if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (execvpe, int,
@@ -940,15 +943,15 @@ _GL_CXXALIASWARN (execvpe);
# define faccessat rpl_faccessat
# endif
_GL_FUNCDECL_RPL (faccessat, int,
- (int fd, char const *name, int mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *name, int mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (faccessat, int,
(int fd, char const *name, int mode, int flag));
# else
# if !@HAVE_FACCESSAT@
_GL_FUNCDECL_SYS (faccessat, int,
- (int fd, char const *file, int mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *file, int mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (faccessat, int,
(int fd, char const *file, int mode, int flag));
@@ -971,23 +974,28 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
Return 0 if successful, otherwise -1 and errno set.
See the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.
*/
-# if ! @HAVE_FCHDIR@
-_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
-
+# if @REPLACE_FCHDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchdir
+# define fchdir rpl_fchdir
+# endif
+_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/));
+# else
+# if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
+# endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+# endif
+_GL_CXXALIASWARN (fchdir);
+# if @REPLACE_FCHDIR@ || !@HAVE_FCHDIR@
/* Gnulib internal hooks needed to maintain the fchdir metadata. */
_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
_GL_ARG_NONNULL ((2));
_GL_EXTERN_C void _gl_unregister_fd (int fd);
_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
_GL_EXTERN_C const char *_gl_directory_name (int fd);
-
-# else
-# if !@HAVE_DECL_FCHDIR@
-_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
-# endif
# endif
-_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
-_GL_CXXALIASWARN (fchdir);
#elif defined GNULIB_POSIXCHECK
# undef fchdir
# if HAVE_RAW_DECL_FCHDIR
@@ -1004,15 +1012,15 @@ _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
# define fchownat rpl_fchownat
# endif
_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
- uid_t owner, gid_t group, int flag)
- _GL_ARG_NONNULL ((2)));
+ uid_t owner, gid_t group, int flag),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag));
# else
# if !@HAVE_FCHOWNAT@
_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
- uid_t owner, gid_t group, int flag)
- _GL_ARG_NONNULL ((2)));
+ uid_t owner, gid_t group, int flag),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag));
@@ -1086,13 +1094,17 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
# undef ftruncate
# define ftruncate rpl_ftruncate
# endif
-_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
-_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+_GL_FUNCDECL_RPL (ftruncate, int,
+ (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (ftruncate, int,
+ (int fd, off_t length));
# else
# if !@HAVE_FTRUNCATE@
-_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
+_GL_FUNCDECL_SYS (ftruncate, int,
+ (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_SYS (ftruncate, int,
+ (int fd, off_t length));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ftruncate);
@@ -1113,15 +1125,16 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
or SIZE was too small.
See the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
- Additionally, the gnulib module 'getcwd' guarantees the following GNU
- extension: If BUF is NULL, an array is allocated with 'malloc'; the array
- is SIZE bytes long, unless SIZE == 0, in which case it is as big as
- necessary. */
+ Additionally, the gnulib module 'getcwd' or 'getcwd-lgpl' guarantees the
+ following GNU extension: If BUF is NULL, an array is allocated with
+ 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case
+ it is as big as necessary. */
# if @REPLACE_GETCWD@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getcwd rpl_getcwd
# endif
-_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1176,15 +1189,19 @@ _GL_CXXALIASWARN (getcwd);
# undef getdomainname
# define getdomainname rpl_getdomainname
# endif
-_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+_GL_FUNCDECL_RPL (getdomainname, int,
+ (char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getdomainname, int,
+ (char *name, size_t len));
# else
# if !@HAVE_DECL_GETDOMAINNAME@
-_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (getdomainname, int,
+ (char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
+_GL_CXXALIAS_SYS (getdomainname, int,
+ (char *name, size_t len));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdomainname);
@@ -1233,13 +1250,17 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is
unportable - "
# undef getentropy
# define getentropy rpl_getentropy
# endif
-_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length));
-_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length));
+_GL_FUNCDECL_RPL (getentropy, int,
+ (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getentropy, int,
+ (void *buffer, size_t length));
# else
# if !@HAVE_GETENTROPY@
-_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_FUNCDECL_SYS (getentropy, int,
+ (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIAS_SYS (getentropy, int,
+ (void *buffer, size_t length));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getentropy);
@@ -1264,13 +1285,17 @@ _GL_WARN_ON_USE (getentropy, "getentropy is unportable
- "
# undef getgroups
# define getgroups rpl_getgroups
# endif
-_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
-_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_FUNCDECL_RPL (getgroups, int,
+ (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getgroups, int,
+ (int n, gid_t *groups));
# else
# if !@HAVE_GETGROUPS@
-_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+_GL_FUNCDECL_SYS (getgroups, int,
+ (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_SYS (getgroups, int,
+ (int n, gid_t *groups));
# endif
_GL_CXXALIASWARN (getgroups);
#elif defined GNULIB_POSIXCHECK
@@ -1295,12 +1320,12 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
# undef gethostname
# define gethostname rpl_gethostname
# endif
-_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
# else
# if !@HAVE_GETHOSTNAME@
-_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
@@ -1310,8 +1335,10 @@ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name,
size_t len));
# endif
_GL_CXXALIASWARN (gethostname);
#elif @UNISTD_H_HAVE_WINSOCK2_H@
-# undef gethostname
-# define gethostname
gethostname_used_without_requesting_gnulib_module_gethostname
+# if !GNULIB_GETHOSTNAME
+# undef gethostname
+# define gethostname
gethostname_used_without_requesting_gnulib_module_gethostname
+# endif
#elif defined GNULIB_POSIXCHECK
# undef gethostname
# if HAVE_RAW_DECL_GETHOSTNAME
@@ -1365,12 +1392,12 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getlogin_r rpl_getlogin_r
# endif
-_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
# else
# if !@HAVE_DECL_GETLOGIN_R@
-_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Solaris 10 systems, the second argument is
@@ -1487,12 +1514,12 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is
unportable - "
# undef getpass
# define getpass rpl_getpass
# endif
-_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
# else
# if !@HAVE_GETPASS@
-_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
@@ -1525,12 +1552,21 @@ _GL_CXXALIASWARN (getpid);
#if @GNULIB_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
/* Return the next valid login shell on the system, or NULL when the end of
the list has been reached. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getusershell
+# define getusershell rpl_getusershell
+# endif
+_GL_FUNCDECL_RPL (getusershell, char *, (void));
+_GL_CXXALIAS_RPL (getusershell, char *, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (getusershell, char *, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (getusershell, char *, (void));
+# endif
_GL_CXXALIASWARN (getusershell);
#elif defined GNULIB_POSIXCHECK
# undef getusershell
@@ -1542,10 +1578,19 @@ _GL_WARN_ON_USE (getusershell, "getusershell is
unportable - "
#if @GNULIB_GETUSERSHELL@
/* Rewind to pointer that is advanced at each getusershell() call. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setusershell
+# define setusershell rpl_setusershell
+# endif
+_GL_FUNCDECL_RPL (setusershell, void, (void));
+_GL_CXXALIAS_RPL (setusershell, void, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (setusershell, void, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (setusershell, void, (void));
+# endif
_GL_CXXALIASWARN (setusershell);
#elif defined GNULIB_POSIXCHECK
# undef setusershell
@@ -1558,10 +1603,19 @@ _GL_WARN_ON_USE (setusershell, "setusershell is
unportable - "
#if @GNULIB_GETUSERSHELL@
/* Free the pointer that is advanced at each getusershell() call and
associated resources. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef endusershell
+# define endusershell rpl_endusershell
+# endif
+_GL_FUNCDECL_RPL (endusershell, void, (void));
+_GL_CXXALIAS_RPL (endusershell, void, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (endusershell, void, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (endusershell, void, (void));
+# endif
_GL_CXXALIASWARN (endusershell);
#elif defined GNULIB_POSIXCHECK
# undef endusershell
@@ -1641,13 +1695,13 @@ _GL_CXXALIASWARN (isatty);
# undef lchown
# define lchown rpl_lchown
# endif
-_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
# else
# if !@HAVE_LCHOWN@
-_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
# endif
@@ -1670,13 +1724,13 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to
pre-POSIX.1-2001 systems - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define link rpl_link
# endif
-_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
# else
# if !@HAVE_LINK@
-_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
# endif
@@ -1701,8 +1755,8 @@ _GL_WARN_ON_USE (link, "link is unportable - "
# endif
_GL_FUNCDECL_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
- int flag)
- _GL_ARG_NONNULL ((2, 4)));
+ int flag),
+ _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
int flag));
@@ -1710,8 +1764,8 @@ _GL_CXXALIAS_RPL (linkat, int,
# if !@HAVE_LINKAT@
_GL_FUNCDECL_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
- int flag)
- _GL_ARG_NONNULL ((2, 4)));
+ int flag),
+ _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
@@ -1778,7 +1832,8 @@ _GL_CXXALIASWARN (lseek);
Store the read-end as fd[0] and the write-end as fd[1].
Return 0 upon success, or -1 with errno set upon failure. */
# if !@HAVE_PIPE@
-_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
_GL_CXXALIASWARN (pipe);
@@ -1805,10 +1860,12 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
# undef pipe2
# define pipe2 rpl_pipe2
# endif
-_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
# else
-_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
# endif
# if __GLIBC__ >= 2
@@ -1835,15 +1892,15 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
# define pread rpl_pread
# endif
_GL_FUNCDECL_RPL (pread, ssize_t,
- (int fd, void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset));
# else
# if !@HAVE_PREAD@
_GL_FUNCDECL_SYS (pread, ssize_t,
- (int fd, void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset));
@@ -1872,15 +1929,15 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
# define pwrite rpl_pwrite
# endif
_GL_FUNCDECL_RPL (pwrite, ssize_t,
- (int fd, const void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, const void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset));
# else
# if !@HAVE_PWRITE@
_GL_FUNCDECL_SYS (pwrite, ssize_t,
- (int fd, const void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, const void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset));
@@ -1906,8 +1963,9 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
# undef read
# define read rpl_read
# endif
-_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
- _GL_ARG_NONNULL ((2)));
+
+_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1928,11 +1986,7 @@ _GL_CXXALIASWARN (read);
# undef read
# define read _read
# endif
-# ifdef __MINGW32__
-_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
-# else
-_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
-# endif
+_GL_CXXALIAS_MDA_CAST (read, ssize_t, (int fd, void *buf, unsigned int count));
# else
_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
# endif
@@ -1952,8 +2006,8 @@ _GL_CXXALIASWARN (read);
# endif
_GL_FUNCDECL_RPL (readlink, ssize_t,
(const char *restrict file,
- char *restrict buf, size_t bufsize)
- _GL_ARG_NONNULL ((1, 2)));
+ char *restrict buf, size_t bufsize),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlink, ssize_t,
(const char *restrict file,
char *restrict buf, size_t bufsize));
@@ -1961,8 +2015,8 @@ _GL_CXXALIAS_RPL (readlink, ssize_t,
# if !@HAVE_READLINK@
_GL_FUNCDECL_SYS (readlink, ssize_t,
(const char *restrict file,
- char *restrict buf, size_t bufsize)
- _GL_ARG_NONNULL ((1, 2)));
+ char *restrict buf, size_t bufsize),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (readlink, ssize_t,
(const char *restrict file,
@@ -1985,8 +2039,8 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
# endif
_GL_FUNCDECL_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file,
- char *restrict buf, size_t len)
- _GL_ARG_NONNULL ((2, 3)));
+ char *restrict buf, size_t len),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file,
char *restrict buf, size_t len));
@@ -1994,8 +2048,8 @@ _GL_CXXALIAS_RPL (readlinkat, ssize_t,
# if !@HAVE_READLINKAT@
_GL_FUNCDECL_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file,
- char *restrict buf, size_t len)
- _GL_ARG_NONNULL ((2, 3)));
+ char *restrict buf, size_t len),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file,
@@ -2019,7 +2073,7 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable
- "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define rmdir rpl_rmdir
# endif
-_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2068,18 +2122,22 @@ _GL_CXXALIASWARN (rmdir);
# undef sethostname
# define sethostname rpl_sethostname
# endif
-_GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len));
+_GL_FUNCDECL_RPL (sethostname, int,
+ (const char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (sethostname, int,
+ (const char *name, size_t len));
# else
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
-_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (sethostname, int,
+ (const char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
and FreeBSD 6.4 the second parameter is int. On Solaris 11
2011-10, the first parameter is not const. */
-_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIAS_SYS_CAST (sethostname, int,
+ (const char *name, size_t len));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sethostname);
@@ -2152,15 +2210,19 @@ _GL_CXXALIASWARN (swab);
# undef symlink
# define symlink rpl_symlink
# endif
-_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
- _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+_GL_FUNCDECL_RPL (symlink, int,
+ (char const *contents, char const *file),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (symlink, int,
+ (char const *contents, char const *file));
# else
# if !@HAVE_SYMLINK@
-_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_SYS (symlink, int,
+ (char const *contents, char const *file),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
+_GL_CXXALIAS_SYS (symlink, int,
+ (char const *contents, char const *file));
# endif
_GL_CXXALIASWARN (symlink);
#elif defined GNULIB_POSIXCHECK
@@ -2179,15 +2241,15 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - "
# define symlinkat rpl_symlinkat
# endif
_GL_FUNCDECL_RPL (symlinkat, int,
- (char const *contents, int fd, char const *file)
- _GL_ARG_NONNULL ((1, 3)));
+ (char const *contents, int fd, char const *file),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (symlinkat, int,
(char const *contents, int fd, char const *file));
# else
# if !@HAVE_SYMLINKAT@
_GL_FUNCDECL_SYS (symlinkat, int,
- (char const *contents, int fd, char const *file)
- _GL_ARG_NONNULL ((1, 3)));
+ (char const *contents, int fd, char const *file),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (symlinkat, int,
(char const *contents, int fd, char const *file));
@@ -2214,13 +2276,13 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable
- "
# undef truncate
# define truncate rpl_truncate
# endif
-_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
# else
# if !@HAVE_DECL_TRUNCATE@
-_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
# endif
@@ -2245,13 +2307,15 @@ _GL_WARN_ON_USE (truncate, "truncate is unportable - "
# define ttyname_r rpl_ttyname_r
# endif
_GL_FUNCDECL_RPL (ttyname_r, int,
- (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+ (int fd, char *buf, size_t buflen),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen));
# else
# if !@HAVE_DECL_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int,
- (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+ (int fd, char *buf, size_t buflen),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen));
@@ -2274,7 +2338,7 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
# undef unlink
# define unlink rpl_unlink
# endif
-_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (unlink, int, (char const *file), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unlink, int, (char const *file));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2315,12 +2379,12 @@ _GL_CXXALIASWARN (unlink);
# undef unlinkat
# define unlinkat rpl_unlinkat
# endif
-_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
# else
# if !@HAVE_UNLINKAT@
-_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
@@ -2374,17 +2438,21 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
# undef write
# define write rpl_write
# endif
-_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_FUNCDECL_RPL (write, ssize_t,
+ (int fd, const void *buf, size_t count),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef write
# define write _write
# endif
-_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_MDA (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# else
-_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_SYS (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# endif
_GL_CXXALIASWARN (write);
#elif @GNULIB_MDA_WRITE@
@@ -2396,13 +2464,11 @@ _GL_CXXALIASWARN (write);
# undef write
# define write _write
# endif
-# ifdef __MINGW32__
-_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
-# else
-_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int
count));
-# endif
+_GL_CXXALIAS_MDA_CAST (write, ssize_t,
+ (int fd, const void *buf, unsigned int count));
# else
-_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_SYS (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# endif
_GL_CXXALIASWARN (write);
#endif
diff --git a/gnulib/lib/unitypes.in.h b/gnulib/lib/unitypes.in.h
index d3a4c67a19..16010d3796 100644
--- a/gnulib/lib/unitypes.in.h
+++ b/gnulib/lib/unitypes.in.h
@@ -1,5 +1,5 @@
/* Elementary types and macros for the GNU UniString library.
- Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,6 +20,11 @@
/* Get uint8_t, uint16_t, uint32_t. */
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Type representing a Unicode character. */
typedef uint32_t ucs4_t;
@@ -58,4 +63,9 @@ typedef uint32_t ucs4_t;
# endif
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _UNITYPES_H */
diff --git a/gnulib/lib/uniwidth.in.h b/gnulib/lib/uniwidth.in.h
index 66829e459d..58bfe9c1ea 100644
--- a/gnulib/lib/uniwidth.in.h
+++ b/gnulib/lib/uniwidth.in.h
@@ -1,5 +1,5 @@
/* Display width functions.
- Copyright (C) 2001-2002, 2005, 2007, 2009-2023 Free Software Foundation,
+ Copyright (C) 2001-2002, 2005, 2007, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/uniwidth/cjk.h b/gnulib/lib/uniwidth/cjk.h
index 98f7e92669..5fab365f97 100644
--- a/gnulib/lib/uniwidth/cjk.h
+++ b/gnulib/lib/uniwidth/cjk.h
@@ -1,5 +1,5 @@
/* Test for CJK encoding.
- Copyright (C) 2001-2002, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2005-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/uniwidth/width.c b/gnulib/lib/uniwidth/width.c
index c9d4d1dfe6..4942aa1e78 100644
--- a/gnulib/lib/uniwidth/width.c
+++ b/gnulib/lib/uniwidth/width.c
@@ -1,5 +1,5 @@
/* Determine display width of Unicode character.
- Copyright (C) 2001-2002, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/uniwidth/width0.h b/gnulib/lib/uniwidth/width0.h
index 0c1713ac52..6cc35536ad 100644
--- a/gnulib/lib/uniwidth/width0.h
+++ b/gnulib/lib/uniwidth/width0.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Table of non-spacing or control characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -46,19 +46,19 @@ static const unsigned char nonspacing_table_data[48*64] = {
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */
0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */
/* 0x0600-0x07ff */
- 0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
+ 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */
- 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
- 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
+ 0x00, 0x00, 0xc0, 0x9f, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x20, /* 0x07c0-0x07ff */
/* 0x0800-0x09ff */
0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */
0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */
- 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
- 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
+ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
+ 0x00, 0xfc, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */
0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */
@@ -273,8 +273,8 @@ static const unsigned char nonspacing_table_data[48*64] = {
/* 0x11000-0x111ff */
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x80, /* 0x11040-0x1107f */
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */
- 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x06, /* 0x11080-0x110bf */
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */
diff --git a/gnulib/lib/uniwidth/width2.h b/gnulib/lib/uniwidth/width2.h
index 19c8c02a51..47979b5d7e 100644
--- a/gnulib/lib/uniwidth/width2.h
+++ b/gnulib/lib/uniwidth/width2.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Width 2 property of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c
index 2d9aa977ec..6ae95ca5dd 100644
--- a/gnulib/lib/vasnprintf.c
+++ b/gnulib/lib/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -64,7 +64,7 @@
/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that main's
use of CHECK macros expands to code that is too complicated for gcc
-fanalyzer. Suppress the resulting bogus warnings. */
-#if 10 <= __GNUC__
+#if _GL_GNUC_PREREQ (10, 0)
# pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
#endif
@@ -80,13 +80,14 @@
#endif
#include <locale.h> /* localeconv() */
+#include <stdint.h> /* PTRDIFF_MAX */
#include <stdio.h> /* snprintf(), sprintf() */
#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
#include <string.h> /* memcpy(), strlen() */
#include <wchar.h> /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb(),
mbszero() */
#include <errno.h> /* errno */
-#include <limits.h> /* CHAR_BIT, INT_WIDTH, LONG_WIDTH */
-#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#include <limits.h> /* CHAR_BIT, INT_MAX, INT_WIDTH, LONG_WIDTH */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP, LDBL_MANT_DIG */
#if HAVE_NL_LANGINFO
# include <langinfo.h>
#endif
@@ -231,7 +232,7 @@
#undef remainder
#define remainder rem
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) &&
!WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
(PTRDIFF_MAX > INT_MAX)) && !WIDE_CHAR_VERSION
# if (HAVE_STRNLEN && !defined _AIX)
# define local_strnlen strnlen
# else
@@ -247,7 +248,7 @@ local_strnlen (const char *string, size_t maxlen)
# endif
#endif
-#if (((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) ||
((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) &&
HAVE_WCHAR_T
+#if ((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || (PTRDIFF_MAX > INT_MAX) || !DCHAR_IS_TCHAR ||
NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF ||
(PTRDIFF_MAX > INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)
# if HAVE_WCSLEN
# define local_wcslen wcslen
# else
@@ -270,7 +271,7 @@ local_wcslen (const wchar_t *s)
# endif
#endif
-#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T &&
WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION
# if HAVE_WCSNLEN && HAVE_DECL_WCSNLEN
# define local_wcsnlen wcsnlen
# else
@@ -289,12 +290,12 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
# endif
#endif
-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) &&
!WIDE_CHAR_VERSION
+#if ((!USE_SNPRINTF || (PTRDIFF_MAX > INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) &&
!WIDE_CHAR_VERSION
# if ENABLE_WCHAR_FALLBACK
static size_t
wctomb_fallback (char *s, wchar_t wc)
{
- static char hex[16] = "0123456789ABCDEF";
+ static char const hex[16] = "0123456789ABCDEF";
s[0] = '\\';
if (sizeof (wchar_t) > 2 && wc > 0xffff)
@@ -406,8 +407,45 @@ is_infinite_or_zerol (long double x)
#endif
+#if NEED_PRINTF_LONG_DOUBLE
+
+/* Like frexpl, except that it supports even "unsupported" numbers. */
+# if (LDBL_MANT_DIG == 64 && (defined __ia64 || (defined __x86_64__ || defined
__amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined
_M_IX86 || defined _X86_))) && (defined __APPLE__ && defined __MACH__)
+/* Don't assume that frexpl can handle pseudo-denormals; it does not on
+ macOS 12/x86_64. Therefore test for a pseudo-denormal explicitly. */
+
+static
+long double safe_frexpl (long double x, int *exp)
+{
+ union
+ {
+ long double value;
+ struct { unsigned int mant_word[2]; unsigned short sign_exp_word; } r;
+ }
+ u;
+ u.value = x;
+ if (u.r.sign_exp_word == 0 && (u.r.mant_word[1] & 0x80000000u) != 0)
+ {
+ /* Pseudo-Denormal. */
+ *exp = LDBL_MIN_EXP;
+ u.r.sign_exp_word = 1 - LDBL_MIN_EXP;
+ return u.value;
+ }
+ else
+ return frexpl (x, exp);
+}
+
+# else
+# define safe_frexpl frexpl
+# endif
+
+#endif
+
#if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE
+/* An indicator for a failed memory allocation. */
+# define NOMEM_PTR ((void *) (-1))
+
/* Converting 'long double' to decimal without rare rounding bugs requires
real bignums. We use the naming conventions of GNU gmp, but vastly simpler
(and slower) algorithms. */
@@ -428,8 +466,8 @@ typedef struct
} mpn_t;
/* Compute the product of two bignums >= 0.
- Return the allocated memory in case of success, NULL in case of memory
- allocation failure. */
+ Return the allocated memory (possibly NULL) in case of success, NOMEM_PTR
+ in case of memory allocation failure. */
static void *
multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
{
@@ -457,7 +495,7 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
{
/* src1 or src2 is zero. */
dest->nlimbs = 0;
- dest->limbs = (mp_limb_t *) malloc (1);
+ dest->limbs = NULL;
}
else
{
@@ -469,7 +507,7 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
dlen = len1 + len2;
dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
if (dp == NULL)
- return NULL;
+ return NOMEM_PTR;
for (k = len2; k > 0; )
dp[--k] = 0;
for (i = 0; i < len1; i++)
@@ -500,8 +538,8 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
the remainder.
Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
q is incremented.
- Return the allocated memory in case of success, NULL in case of memory
- allocation failure. */
+ Return the allocated memory (possibly NULL) in case of success, NOMEM_PTR
+ in case of memory allocation failure. */
static void *
divide (mpn_t a, mpn_t b, mpn_t *q)
{
@@ -572,7 +610,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
final rounding of q.) */
roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
if (roomptr == NULL)
- return NULL;
+ return NOMEM_PTR;
/* Normalise a. */
while (a_len > 0 && a_ptr[a_len - 1] == 0)
@@ -708,7 +746,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
if (tmp_roomptr == NULL)
{
free (roomptr);
- return NULL;
+ return NOMEM_PTR;
}
{
const mp_limb_t *sourceptr = b_ptr;
@@ -930,7 +968,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
/* Avoid pointless GCC warning "argument 1 value '18446744073709551615' exceeds
maximum object size 9223372036854775807", triggered by the use of xsum as
argument of malloc. */
-# if __GNUC__ >= 7
+# if _GL_GNUC_PREREQ (7, 0)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Walloc-size-larger-than="
# endif
@@ -991,7 +1029,7 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
return c_ptr;
}
-# if __GNUC__ >= 7
+# if _GL_GNUC_PREREQ (7, 0)
# pragma GCC diagnostic pop
# endif
@@ -1015,7 +1053,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
if (m.limbs == NULL)
return NULL;
/* Split into exponential part and mantissa. */
- y = frexpl (x, &exp);
+ y = safe_frexpl (x, &exp);
if (!(y >= 0.0L && y < 1.0L))
abort ();
/* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
@@ -1306,7 +1344,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void
*memory, int n)
mpn_t denominator;
void *tmp_memory;
tmp_memory = multiply (m, pow5, &numerator);
- if (tmp_memory == NULL)
+ if (tmp_memory == NOMEM_PTR)
{
free (pow5_ptr);
free (memory);
@@ -1379,7 +1417,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void
*memory, int n)
/* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
- if (z_memory == NULL)
+ if (z_memory == NOMEM_PTR)
return NULL;
digits = convert_to_decimal (z, extra_zeroes);
free (z_memory);
@@ -1442,7 +1480,7 @@ floorlog10l (long double x)
double l;
/* Split into exponential part and mantissa. */
- y = frexpl (x, &exp);
+ y = safe_frexpl (x, &exp);
if (!(y >= 0.0L && y < 1.0L))
abort ();
if (y == 0.0L)
@@ -2111,10 +2149,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
break;
case 's':
-# if HAVE_WCHAR_T
if (type == TYPE_WIDE_STRING)
{
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
/* ISO C says about %ls in fwprintf:
"If the precision is not specified or is greater than the size
of the array, the array shall contain a null wide character."
@@ -2125,7 +2162,7 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
tmp_length = local_wcsnlen (arg, precision);
else
tmp_length = local_wcslen (arg);
-# else
+# else
/* ISO C says about %ls in fprintf:
"If a precision is specified, no more than that many bytes are
written (including shift sequences, if any), and the array
@@ -2136,10 +2173,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
So if there is a precision, we must not use wcslen. */
/* This case has already been handled separately in VASNPRINTF. */
abort ();
-# endif
+# endif
}
else
-# endif
{
# if WIDE_CHAR_VERSION
/* ISO C says about %s in fwprintf:
@@ -2335,6 +2371,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (dp->conversion == 'n')
{
+#if NEED_PRINTF_WITH_N_DIRECTIVE
switch (a.arg[dp->arg_index].type)
{
case TYPE_COUNT_SCHAR_POINTER:
@@ -2379,6 +2416,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
default:
abort ();
}
+#else
+ abort ();
+#endif
}
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
@@ -2419,6 +2459,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -2497,7 +2539,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u8_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2538,7 +2581,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2599,7 +2642,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u16_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2640,7 +2684,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2701,7 +2745,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u32_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2742,7 +2787,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2765,7 +2810,190 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if WIDE_CHAR_VERSION && (!DCHAR_IS_TCHAR || NEED_WPRINTF_DIRECTIVE_LC)
+#if !WIDE_CHAR_VERSION && (PTRDIFF_MAX > INT_MAX)
+ else if (dp->conversion == 's'
+ && a.arg[dp->arg_index].type != TYPE_WIDE_STRING)
+ {
+ /* %s in vasnprintf. See the specification of fprintf.
+ We handle it ourselves here, because the string may be
longer
+ than INT_MAX characters, whence snprintf or sprintf would
+ fail to process it. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++
- '0');
+ has_precision = 1;
+ }
+ }
+
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ size_t characters;
+# endif
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ static_assert (sizeof (TCHAR_T) == 1);
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+ if (has_precision)
+ {
+ /* Use only at most PRECISION bytes, from the left. */
+ bytes = local_strnlen (arg, precision);
+ }
+ else
+ {
+ /* Use the entire string, and count the number of
+ bytes. */
+ bytes = strlen (arg);
+ }
+
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ if (has_width)
+ characters = mbsnlen (arg, bytes);
+ else
+ {
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ arg, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = bytes;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ {
+# if DCHAR_IS_TCHAR
+ size_t total = bytes + (w < width ? width - w : 0);
+ ENSURE_ALLOCATION (xsum (length, total));
+# else
+ size_t total = tmpdst_len + (w < width ? width - w : 0);
+ ENSURE_ALLOCATION_ELSE (xsum (length, total),
+ { free (tmpdst); goto out_of_memory; });
+# endif
+
+ if (w < width && !(flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ memcpy (result + length, arg, bytes);
+ length += bytes;
+# else
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+ }
+#endif
+#if WIDE_CHAR_VERSION && ((PTRDIFF_MAX > INT_MAX) || !DCHAR_IS_TCHAR ||
NEED_WPRINTF_DIRECTIVE_LC)
else if ((dp->conversion == 's'
&& a.arg[dp->arg_index].type == TYPE_WIDE_STRING)
|| (dp->conversion == 'c'
@@ -2806,6 +3034,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
{
@@ -2908,7 +3138,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if (!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) &&
HAVE_WCHAR_T
+#if WIDE_CHAR_VERSION || !USE_SNPRINTF || (PTRDIFF_MAX > INT_MAX) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS ||
ENABLE_WCHAR_FALLBACK
else if (dp->conversion == 's'
# if WIDE_CHAR_VERSION
&& a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2961,6 +3191,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -3141,11 +3373,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
const wchar_t *arg_end;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
size_t characters;
+# endif
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
static_assert (sizeof (TCHAR_T) == 1);
- TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
# endif
@@ -3160,7 +3394,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbszero (&state);
# endif
arg_end = arg;
+ bytes = 0;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
characters = 0;
+# endif
while (precision > 0)
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
@@ -3176,7 +3413,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (precision < (unsigned int) count)
break;
arg_end++;
- characters += count;
+ bytes += count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters += mbsnlen (cbuf, count);
+# endif
precision -= count;
}
}
@@ -3193,7 +3433,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbszero (&state);
# endif
arg_end = arg;
+ bytes = 0;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
characters = 0;
+# endif
for (;;)
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
@@ -3207,7 +3450,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Cannot convert. */
goto fail_with_EILSEQ;
arg_end++;
- characters += count;
+ bytes += count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters += mbsnlen (cbuf, count);
+# endif
}
}
# if DCHAR_IS_TCHAR
@@ -3215,56 +3461,64 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + local_wcslen (arg);
- /* The number of bytes doesn't matter. */
+ /* The number of bytes and characters doesn't matter,
+ because !has_width and therefore width==0. */
+ bytes = 0;
+# if ENABLE_UNISTDIO
characters = 0;
+# endif
}
# endif
# if !DCHAR_IS_TCHAR
- /* Convert the string into a piece of temporary memory. */
- tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
- if (tmpsrc == NULL)
- goto out_of_memory;
{
- TCHAR_T *tmpptr = tmpsrc;
- size_t remaining;
+ TCHAR_T *tmpsrc;
+
+ /* Convert the string into a piece of temporary memory. */
+ tmpsrc = (TCHAR_T *) malloc (bytes * sizeof (TCHAR_T));
+ if (tmpsrc == NULL)
+ goto out_of_memory;
+ {
+ TCHAR_T *tmpptr = tmpsrc;
+ size_t remaining;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- for (remaining = characters; remaining > 0; )
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ for (remaining = bytes; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
- if (*arg == 0)
- abort ();
- count = local_wcrtomb (cbuf, *arg, &state);
- if (count <= 0)
- /* Inconsistency. */
- abort ();
- memcpy (tmpptr, cbuf, count);
- tmpptr += count;
- arg++;
- remaining -= count;
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpptr, cbuf, count);
+ tmpptr += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ free (tmpsrc);
+ goto fail_with_errno;
}
- if (!(arg == arg_end))
- abort ();
+ free (tmpsrc);
}
-
- /* Convert from TCHAR_T[] to DCHAR_T[]. */
- tmpdst =
- DCHAR_CONV_FROM_ENCODING (locale_charset (),
- iconveh_question_mark,
- tmpsrc, characters,
- NULL,
- NULL, &tmpdst_len);
- if (tmpdst == NULL)
- {
- free (tmpsrc);
- goto fail_with_errno;
- }
- free (tmpsrc);
# endif
if (has_width)
@@ -3273,11 +3527,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted
value. */
- w = DCHAR_MBSNLEN (result + length, characters);
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
# else
/* The width is compared against the number of _bytes_
of the converted value, says POSIX. */
- w = characters;
+ w = bytes;
# endif
}
else
@@ -3287,7 +3545,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
@@ -3301,8 +3564,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbstate_t state;
mbszero (&state);
# endif
- ENSURE_ALLOCATION (xsum (length, characters));
- for (remaining = characters; remaining > 0; )
+ ENSURE_ALLOCATION (xsum (length, bytes));
+ for (remaining = bytes; remaining > 0; )
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
@@ -3346,7 +3609,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory;
});
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
@@ -3402,17 +3665,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
/* %lc in vasnprintf. See the specification of fprintf. */
{
wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
size_t characters;
+# endif
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
static_assert (sizeof (TCHAR_T) == 1);
- TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
DCHAR_T *tmpdst;
size_t tmpdst_len;
# endif
@@ -3423,58 +3690,65 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
{
/* Count the number of bytes. */
- characters = 0;
- if (arg != 0)
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count < 0)
- /* Cannot convert. */
- goto fail_with_EILSEQ;
- characters = count;
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ bytes = count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters = mbsnlen (cbuf, count);
+# endif
}
# if DCHAR_IS_TCHAR
else
{
- /* The number of bytes doesn't matter. */
+ /* The number of bytes and characters doesn't matter,
+ because !has_width and therefore width==0. */
+ bytes = 0;
+# if ENABLE_UNISTDIO
characters = 0;
+# endif
}
# endif
# if !DCHAR_IS_TCHAR
- /* Convert the string into a piece of temporary memory. */
- if (characters > 0) /* implies arg != 0 */
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ {
+ TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
+
+ /* Convert the string into a piece of temporary memory. */
+ if (bytes > 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count <= 0)
- /* Inconsistency. */
- abort ();
- memcpy (tmpsrc, cbuf, count);
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpsrc, cbuf, count);
+ }
- /* Convert from TCHAR_T[] to DCHAR_T[]. */
- tmpdst =
- DCHAR_CONV_FROM_ENCODING (locale_charset (),
- iconveh_question_mark,
- tmpsrc, characters,
- NULL,
- NULL, &tmpdst_len);
- if (tmpdst == NULL)
- goto fail_with_errno;
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+ }
# endif
if (has_width)
@@ -3483,11 +3757,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted
value. */
- w = DCHAR_MBSNLEN (result + length, characters);
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
# else
/* The width is compared against the number of _bytes_
of the converted value, says POSIX. */
- w = characters;
+ w = bytes;
# endif
}
else
@@ -3497,7 +3775,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
@@ -3506,8 +3789,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (has_width)
{
/* We know the number of bytes in advance. */
- ENSURE_ALLOCATION (xsum (length, characters));
- if (characters > 0) /* implies arg != 0 */
+ ENSURE_ALLOCATION (xsum (length, bytes));
+ if (bytes > 0)
{
int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
@@ -3524,27 +3807,24 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
else
{
- if (arg != 0)
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count < 0)
- /* Cannot convert. */
- goto fail_with_EILSEQ;
- ENSURE_ALLOCATION (xsum (length, count));
- memcpy (result + length, cbuf, count);
- length += count;
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory;
});
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
@@ -3596,6 +3876,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
/* %c in vasnwprintf. See the specification of fwprintf. */
@@ -3610,24 +3892,26 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Invalid or incomplete multibyte character. */
goto fail_with_EILSEQ;
- if (1 < width && !(flags & FLAG_LEFT))
- {
- size_t n = width - 1;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ {
+ size_t total = (1 < width ? width : 1);
+ ENSURE_ALLOCATION (xsum (length, total));
- ENSURE_ALLOCATION (xsum (length, 1));
- result[length++] = wc;
+ if (1 < width && !(flags & FLAG_LEFT))
+ {
+ size_t n = width - 1;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
- if (1 < width && (flags & FLAG_LEFT))
- {
- size_t n = width - 1;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ result[length++] = wc;
+
+ if (1 < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - 1;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
}
}
#endif
@@ -3684,6 +3968,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -3935,7 +4221,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -3998,6 +4285,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
has_precision = 0;
@@ -4425,7 +4714,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -4503,6 +4793,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
has_precision = 0;
@@ -5608,7 +5900,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -5622,24 +5915,24 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags;
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int has_width;
#endif
-#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
size_t width;
#endif
-#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
int has_precision;
size_t precision;
#endif
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int prec_ourselves;
#else
# define prec_ourselves 0
#endif
#if (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST
# define pad_ourselves 1
-#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int pad_ourselves;
#else
# define pad_ourselves 0
@@ -5654,10 +5947,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
TCHAR_T *tmp;
#endif
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 0;
#endif
-#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
width = 0;
if (dp->width_start != dp->width_end)
{
@@ -5685,13 +5978,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
-# if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+# define WIDTH_IS_CHECKED 1
+# if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 1;
# endif
}
#endif
-#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
has_precision = 0;
precision = 6;
if (dp->precision_start != dp->precision_end)
@@ -5724,9 +6020,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to handle the precision ourselves. */
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
switch (dp->conversion)
{
+# if NEED_PRINTF_UNBOUNDED_PRECISION
case 'd': case 'i': case 'u':
case 'b':
#if SUPPORT_GNU_PRINTF_DIRECTIVES \
@@ -5734,9 +6031,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
case 'B':
#endif
case 'o':
- case 'x': case 'X': case 'p':
prec_ourselves = has_precision && (precision > 0);
break;
+# endif
+ case 'x': case 'X': case 'p':
+ prec_ourselves =
+ has_precision
+ && (0
+# if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO
+ || (precision == 0)
+# endif
+# if NEED_PRINTF_UNBOUNDED_PRECISION
+ || (precision > 0)
+# endif
+ );
+ break;
default:
prec_ourselves = 0;
break;
@@ -5744,7 +6053,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to perform the padding ourselves. */
-#if !((WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST) &&
(!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION)
+#if !((WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST) &&
(!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
switch (dp->conversion)
{
# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
@@ -5821,6 +6130,43 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (dp->width_start != dp->width_end)
{
size_t n = dp->width_end - dp->width_start;
+#if !WIDTH_IS_CHECKED
+ size_t width;
+ /* Reject an out-of-range width.
+ The underlying SNPRINTF already does this on some
+ platforms (glibc, musl, macOS, FreeBSD, NetBSD,
+ OpenBSD, Cygwin, Solaris, MSVC). However, on others
+ (AIX, mingw), it doesn't; thus this vasnprintf
+ invocation would succeed and produce a wrong result.
+ So, this is redundant on some platforms, but it's a
+ quick check anyway. */
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-'
flag
+ followed by a positive field width." */
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ width = 0;
+ do
+ width = xsum (xtimes (width, 10), *digitp++ -
'0');
+ while (digitp != dp->width_end);
+ }
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+#endif
/* The width specification is known to consist only
of standard ASCII characters. */
if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
@@ -5973,9 +6319,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#if HAVE_WINT_T
case TYPE_WIDE_CHAR:
#endif
- #if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
- #endif
*fbp++ = 'l';
break;
case TYPE_LONGDOUBLE:
@@ -6347,14 +6691,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
SNPRINTF_BUF (arg);
}
break;
-#if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
{
const wchar_t *arg =
a.arg[dp->arg_index].a.a_wide_string;
SNPRINTF_BUF (arg);
}
break;
-#endif
case TYPE_POINTER:
{
void *arg = a.arg[dp->arg_index].a.a_pointer;
@@ -6508,7 +6850,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
#endif
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
if (prec_ourselves)
{
/* Handle the precision. */
@@ -6568,6 +6910,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
count += insert;
}
+# if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO
+ else if (precision == 0
+ && move == 1
+ && prec_ptr[prefix_count] == '0')
+ {
+ /* Replace the "0" result with an empty string. */
+ count = prefix_count;
+ }
+# endif
}
#endif
@@ -6657,7 +7008,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
goto fail_with_errno;
# endif
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto
out_of_memory; });
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
count = tmpdst_len;
@@ -6722,7 +7073,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Here count <= allocated - length. */
/* Perform padding. */
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
if (pad_ourselves && has_width)
{
size_t w;
@@ -6909,17 +7260,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
not have this limitation. */
return result;
-#if USE_SNPRINTF
overflow:
errno = EOVERFLOW;
goto fail_with_errno;
-#endif
out_of_memory:
errno = ENOMEM;
goto fail_with_errno;
-#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || WIDE_CHAR_VERSION ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS ||
ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || ((NEED_PRINTF_DIRECTIVE_LC ||
ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T && !WIDE_CHAR_VERSION) ||
(NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
+#if ENABLE_UNISTDIO || (WIDE_CHAR_VERSION || !USE_SNPRINTF || (PTRDIFF_MAX >
INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T &&
!WIDE_CHAR_VERSION) || (NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
fail_with_EILSEQ:
errno = EILSEQ;
goto fail_with_errno;
diff --git a/gnulib/lib/vasnprintf.h b/gnulib/lib/vasnprintf.h
index 2d13407079..7ed9145c03 100644
--- a/gnulib/lib/vasnprintf.h
+++ b/gnulib/lib/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/vasprintf.c b/gnulib/lib/vasprintf.c
index d2878cd91d..757d1c740a 100644
--- a/gnulib/lib/vasprintf.c
+++ b/gnulib/lib/vasprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,6 +25,7 @@
#include <errno.h>
#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include "vasnprintf.h"
@@ -37,12 +38,21 @@ vasprintf (char **resultp, const char *format, va_list args)
if (result == NULL)
return -1;
+#if PTRDIFF_MAX > INT_MAX
if (length > INT_MAX)
{
free (result);
- errno = EOVERFLOW;
+ errno = (length > PTRDIFF_MAX ? ENOMEM : EOVERFLOW);
return -1;
}
+#else
+ if (length > PTRDIFF_MAX)
+ {
+ free (result);
+ errno = ENOMEM;
+ return -1;
+ }
+#endif
*resultp = result;
/* Return the number of resulting bytes, excluding the trailing NUL. */
diff --git a/gnulib/lib/verify.h b/gnulib/lib/verify.h
index 181dc6c292..49a73c0508 100644
--- a/gnulib/lib/verify.h
+++ b/gnulib/lib/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -34,11 +34,12 @@
#ifndef __cplusplus
# if (201112 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ \
- && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
+ && ((4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__) \
+ || 5 <= __clang_major__)))
# define _GL_HAVE__STATIC_ASSERT 1
# endif
# if (202311 <= __STDC_VERSION__ \
- || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+ || (!defined __STRICT_ANSI__ && 9 <= __GNUC__ && !defined __clang__))
# define _GL_HAVE__STATIC_ASSERT1 1
# endif
#endif
@@ -215,7 +216,7 @@ template <int w>
# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
-# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wnested-externs"
# endif
#endif
@@ -259,11 +260,22 @@ template <int w>
&& (!defined __cplusplus \
|| (__cpp_static_assert < 201411 \
&& __GNUG__ < 6 && __clang_major__ < 6 && _MSC_VER < 1910)))
-# if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
+# if (defined __cplusplus && defined __GNUG__ && __GNUG__ < 6 \
+ && __cplusplus == 201103L && !defined __clang__)
+/* g++ >= 4.7, < 6 with option -std=c++11 or -std=gnu++11 supports the
+ two-arguments static_assert but not the one-argument static_assert, and
+ it does not support _Static_assert.
+ We have to play preprocessor tricks to distinguish the two cases. */
+# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
+# define _GL_SA2 static_assert
+# define _GL_SA3 static_assert
+# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
+# define static_assert(...) _GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)
(__VA_ARGS__)
+# elif defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
the one-argument static_assert, and it does not support _Static_assert.
We have to play preprocessor tricks to distinguish the two cases.
- Since the MSVC preprocessor is not ISO C compliant (see above),.
+ Since the MSVC preprocessor is not ISO C compliant (see above),
the solution is specific to MSVC. */
# define _GL_EXPAND(x) x
# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
@@ -294,7 +306,7 @@ template <int w>
#ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0
-# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
diff --git a/gnulib/lib/warn-on-use.h b/gnulib/lib/warn-on-use.h
index 30756034af..73c439714a 100644
--- a/gnulib/lib/warn-on-use.h
+++ b/gnulib/lib/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -32,6 +32,10 @@
_GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
linkage.
+ _GL_WARN_ON_USE should not be used more than once for a given function
+ in a given compilation unit (because this may generate a warning even
+ if the function is never called).
+
However, one of the reasons that a function is a portability trap is
if it has the wrong signature. Declaring FUNCTION with a different
signature in C is a compilation error, so this macro must use the
@@ -81,7 +85,7 @@
*/
#ifndef _GL_WARN_ON_USE
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined
__clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__
(message)))
@@ -94,7 +98,7 @@ _GL_WARN_EXTERN_C __typeof__ (function) function \
__attribute__ ((__diagnose_if__ (1, message, "warning")))
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
__attribute__ ((__diagnose_if__ (1, message, "warning")))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function
@@ -117,7 +121,7 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
_GL_WARN_ON_USE (function, msg)
# else
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined
__clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_gcc function parameters_and_attributes \
@@ -127,7 +131,7 @@ extern rettype_gcc function parameters_and_attributes \
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_clang function parameters_and_attributes \
__attribute__ ((__diagnose_if__ (1, msg, "warning")))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_gcc function parameters_and_attributes
diff --git a/gnulib/lib/wchar.in.h b/gnulib/lib/wchar.in.h
index f1bbff6b94..ac7cb00fc7 100644
--- a/gnulib/lib/wchar.in.h
+++ b/gnulib/lib/wchar.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -95,7 +95,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -141,7 +141,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -269,11 +269,11 @@ _GL_EXTERN_C void free (void *);
# undef btowc
# define btowc rpl_btowc
# endif
-_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
# else
# if !@HAVE_BTOWC@
-_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
# endif
/* Need to cast, because on mingw, the return type is 'unsigned short'. */
_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
@@ -297,12 +297,12 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
# undef wctob
# define wctob rpl_wctob
# endif
-_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
# else
# if !defined wctob && !@HAVE_DECL_WCTOB@
/* wctob is provided by gnulib, or wctob exists but is not declared. */
-_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
# endif
@@ -623,7 +623,7 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
(wchar_t *restrict dest,
@@ -634,7 +634,7 @@ _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
@@ -664,7 +664,7 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t srclen, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
@@ -675,7 +675,7 @@ _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t srclen, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
@@ -736,7 +736,7 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
_GL_FUNCDECL_RPL (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
@@ -747,7 +747,7 @@ _GL_CXXALIAS_RPL (wcsrtombs, size_t,
_GL_FUNCDECL_SYS (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsrtombs, size_t,
@@ -778,7 +778,7 @@ _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
(char *restrict dest,
const wchar_t **restrict srcp, size_t srclen,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
(char *restrict dest,
@@ -791,7 +791,7 @@ _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
(char *restrict dest,
const wchar_t **restrict srcp, size_t srclen,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
@@ -819,12 +819,12 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
# undef wcwidth
# define wcwidth rpl_wcwidth
# endif
-_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
# else
# if !@HAVE_DECL_WCWIDTH@
/* wcwidth exists but is not declared. */
-_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
# endif
@@ -843,7 +843,7 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
/* Search N wide characters of S for C. */
#if @GNULIB_WMEMCHR@
# if !@HAVE_WMEMCHR@
-_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -855,11 +855,12 @@ _GL_CXXALIAS_SYS_CAST2 (wmemchr,
wchar_t *, (const wchar_t *, wchar_t, size_t),
const wchar_t *, (const wchar_t *, wchar_t, size_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
(const wchar_t *s, wchar_t c, size_t n));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wmemchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -879,14 +880,14 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
# define wmemcmp rpl_wmemcmp
# endif
_GL_FUNCDECL_RPL (wmemcmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wmemcmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
# else
# if !@HAVE_WMEMCMP@
_GL_FUNCDECL_SYS (wmemcmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wmemcmp, int,
@@ -1004,7 +1005,7 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
/* Return the number of wide characters in S. */
#if @GNULIB_WCSLEN@
# if !@HAVE_WCSLEN@
-_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
# if __GLIBC__ >= 2
@@ -1025,7 +1026,7 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
-_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
@@ -1175,12 +1176,12 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
# undef wcscmp
# define wcscmp rpl_wcscmp
# endif
-_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
# else
# if !@HAVE_WCSCMP@
-_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1205,14 +1206,14 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
# define wcsncmp rpl_wcsncmp
# endif
_GL_FUNCDECL_RPL (wcsncmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcsncmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
# else
# if !@HAVE_WCSNCMP@
_GL_FUNCDECL_SYS (wcsncmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsncmp, int,
@@ -1236,7 +1237,7 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
-_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1257,7 +1258,7 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
the global namespace. */
# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsncasecmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsncasecmp, int,
@@ -1325,15 +1326,16 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t
*s));
/* On Solaris 11.3, the header files declare the function in the std::
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
-# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >=
11
+# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) \
+ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1341,16 +1343,16 @@ _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t
*s));
# endif
_GL_CXXALIASWARN (wcsdup);
#else
-# if __GNUC__ >= 11 && !defined wcsdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined wcsdup
/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1373,12 +1375,12 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t
*s));
# else
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# if @HAVE_DECL_WCSDUP@
@@ -1395,7 +1397,7 @@ _GL_CXXALIASWARN (wcsdup);
/* Find the first occurrence of WC in WCS. */
#if @GNULIB_WCSCHR@
# if !@HAVE_WCSCHR@
-_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1407,10 +1409,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcschr,
wchar_t *, (const wchar_t *, wchar_t),
const wchar_t *, (const wchar_t *, wchar_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcschr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1425,7 +1428,7 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
/* Find the last occurrence of WC in WCS. */
#if @GNULIB_WCSRCHR@
# if !@HAVE_WCSRCHR@
-_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1437,10 +1440,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
wchar_t *, (const wchar_t *, wchar_t),
const wchar_t *, (const wchar_t *, wchar_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcsrchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1456,7 +1460,7 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
of wide characters not in REJECT. */
#if @GNULIB_WCSCSPN@
# if !@HAVE_WCSCSPN@
-_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t
*reject));
@@ -1476,7 +1480,7 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
of wide characters in ACCEPT. */
#if @GNULIB_WCSSPN@
# if !@HAVE_WCSSPN@
-_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
@@ -1496,7 +1500,7 @@ _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
#if @GNULIB_WCSPBRK@
# if !@HAVE_WCSPBRK@
_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
- (const wchar_t *wcs, const wchar_t *accept)
+ (const wchar_t *wcs, const wchar_t *accept),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1508,12 +1512,13 @@ _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
wchar_t *, (const wchar_t *, const wchar_t *),
const wchar_t *, (const wchar_t *, const wchar_t *));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
(wchar_t *wcs, const wchar_t *accept));
_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
(const wchar_t *wcs, const wchar_t *accept));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcspbrk);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1534,7 +1539,7 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
# endif
_GL_FUNCDECL_RPL (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
- const wchar_t *restrict needle)
+ const wchar_t *restrict needle),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
@@ -1543,7 +1548,7 @@ _GL_CXXALIAS_RPL (wcsstr, wchar_t *,
# if !@HAVE_WCSSTR@
_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
- const wchar_t *restrict needle)
+ const wchar_t *restrict needle),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1558,14 +1563,15 @@ _GL_CXXALIAS_SYS_CAST2 (wcsstr,
(const wchar_t *restrict, const wchar_t *restrict));
# endif
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
(wchar_t *restrict haystack,
const wchar_t *restrict needle));
_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
(const wchar_t *restrict haystack,
const wchar_t *restrict needle));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcsstr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1620,12 +1626,12 @@ _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
# undef wcswidth
# define wcswidth rpl_wcswidth
# endif
-_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
# else
# if !@HAVE_WCSWIDTH@
-_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
@@ -1653,7 +1659,7 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
_GL_FUNCDECL_RPL (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
const wchar_t *restrict __fmt,
- const struct tm *restrict __tp)
+ const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4)));
_GL_CXXALIAS_RPL (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
@@ -1664,7 +1670,7 @@ _GL_CXXALIAS_RPL (wcsftime, size_t,
_GL_FUNCDECL_SYS (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
const wchar_t *restrict __fmt,
- const struct tm *restrict __tp)
+ const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4)));
# endif
_GL_CXXALIAS_SYS (wcsftime, size_t,
@@ -1684,6 +1690,24 @@ _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
#endif
+#if @GNULIB_WGETCWD@ && (defined _WIN32 && !defined __CYGWIN__)
+/* Gets the name of the current working directory.
+ (a) If BUF is non-NULL, it is assumed to have room for SIZE wide characters.
+ This function stores the working directory (NUL-terminated) in BUF and
+ returns BUF.
+ (b) If BUF is NULL, an array is allocated with 'malloc'. The array is SIZE
+ wide characters long, unless SIZE == 0, in which case it is as big as
+ necessary.
+ If the directory couldn't be determined or SIZE was too small, this function
+ returns NULL and sets errno. For a directory of length LEN, SIZE should be
+ >= LEN + 3 in case (a) or >= LEN + 1 in case (b).
+ Possible errno values include:
+ - ERANGE if SIZE is too small.
+ - ENOMEM if the memory could no be allocated. */
+_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size));
+#endif
+
+
#endif /* _@GUARD_PREFIX@_WCHAR_H */
#endif /* _@GUARD_PREFIX@_WCHAR_H */
#endif
diff --git a/gnulib/lib/wcrtomb.c b/gnulib/lib/wcrtomb.c
index 389d699e5f..197b020e28 100644
--- a/gnulib/lib/wcrtomb.c
+++ b/gnulib/lib/wcrtomb.c
@@ -1,5 +1,5 @@
/* Convert wide character to multibyte character.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/wctype-h.c b/gnulib/lib/wctype-h.c
index 7d3e14a6b5..7e4ff13a71 100644
--- a/gnulib/lib/wctype-h.c
+++ b/gnulib/lib/wctype-h.c
@@ -1,6 +1,6 @@
/* Inline functions for <wctype.h>.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,4 +20,4 @@
#include <config.h>
#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE
-#include "wctype.h"
+#include <wctype.h>
diff --git a/gnulib/lib/wctype-impl.h b/gnulib/lib/wctype-impl.h
index 996af42a59..26d68b41b9 100644
--- a/gnulib/lib/wctype-impl.h
+++ b/gnulib/lib/wctype-impl.h
@@ -1,5 +1,5 @@
/* Get descriptor for a wide character property.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/wctype.c b/gnulib/lib/wctype.c
index af41b0554c..914f6847d9 100644
--- a/gnulib/lib/wctype.c
+++ b/gnulib/lib/wctype.c
@@ -1,5 +1,5 @@
/* Get descriptor for a wide character property.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/wctype.in.h b/gnulib/lib/wctype.in.h
index 6f1e7ef149..efa77594d5 100644
--- a/gnulib/lib/wctype.in.h
+++ b/gnulib/lib/wctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
- Copyright (C) 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -659,12 +659,12 @@ typedef void *rpl_wctype_t;
# undef wctype
# define wctype rpl_wctype
# endif
-_GL_FUNCDECL_RPL (wctype, wctype_t, (const char *name)
+_GL_FUNCDECL_RPL (wctype, wctype_t, (const char *name),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (wctype, wctype_t, (const char *name));
# else
# if !@HAVE_WCTYPE_T@
-_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name)
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
@@ -741,12 +741,12 @@ typedef void *rpl_wctrans_t;
# undef wctrans
# define wctrans rpl_wctrans
# endif
-_GL_FUNCDECL_RPL (wctrans, wctrans_t, (const char *name)
+_GL_FUNCDECL_RPL (wctrans, wctrans_t, (const char *name),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (wctrans, wctrans_t, (const char *name));
# else
# if !@HAVE_WCTRANS_T@
-_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name)
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
diff --git a/gnulib/lib/wcwidth.c b/gnulib/lib/wcwidth.c
index 1d03665496..328a89306c 100644
--- a/gnulib/lib/wcwidth.c
+++ b/gnulib/lib/wcwidth.c
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a character.
- Copyright (C) 2006-2007, 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2010-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/windows-initguard.h b/gnulib/lib/windows-initguard.h
index 9d36f53c82..6bace3f047 100644
--- a/gnulib/lib/windows-initguard.h
+++ b/gnulib/lib/windows-initguard.h
@@ -1,5 +1,5 @@
/* Init guards, somewhat like spinlocks (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/windows-mutex.c b/gnulib/lib/windows-mutex.c
index ab7258c9f0..2ac73a0728 100644
--- a/gnulib/lib/windows-mutex.c
+++ b/gnulib/lib/windows-mutex.c
@@ -1,5 +1,5 @@
/* Plain mutexes (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -23,10 +23,12 @@
#include "windows-mutex.h"
#include <errno.h>
+#include <stdlib.h>
void
glwthread_mutex_init (glwthread_mutex_t *mutex)
{
+ mutex->owner = 0;
InitializeCriticalSection (&mutex->lock);
mutex->guard.done = 1;
}
@@ -49,7 +51,13 @@ glwthread_mutex_lock (glwthread_mutex_t *mutex)
Sleep (0);
}
}
+ /* If this thread already owns the mutex, POSIX pthread_mutex_lock() is
+ required to deadlock here. But let's not do that on purpose. */
EnterCriticalSection (&mutex->lock);
+ {
+ DWORD self = GetCurrentThreadId ();
+ mutex->owner = self;
+ }
return 0;
}
@@ -72,6 +80,21 @@ glwthread_mutex_trylock (glwthread_mutex_t *mutex)
}
if (!TryEnterCriticalSection (&mutex->lock))
return EBUSY;
+ {
+ DWORD self = GetCurrentThreadId ();
+ /* TryEnterCriticalSection succeeded. This means that the mutex was either
+ previously unlocked (and thus mutex->owner == 0) or previously locked by
+ this thread (and thus mutex->owner == self). Since the mutex is meant
to
+ be plain, we need to fail in the latter case. */
+ if (mutex->owner == self)
+ {
+ LeaveCriticalSection (&mutex->lock);
+ return EBUSY;
+ }
+ if (mutex->owner != 0)
+ abort ();
+ mutex->owner = self;
+ }
return 0;
}
@@ -80,6 +103,7 @@ glwthread_mutex_unlock (glwthread_mutex_t *mutex)
{
if (!mutex->guard.done)
return EINVAL;
+ mutex->owner = 0;
LeaveCriticalSection (&mutex->lock);
return 0;
}
diff --git a/gnulib/lib/windows-mutex.h b/gnulib/lib/windows-mutex.h
index 039eb7075a..cb676c1b90 100644
--- a/gnulib/lib/windows-mutex.h
+++ b/gnulib/lib/windows-mutex.h
@@ -1,5 +1,5 @@
/* Plain mutexes (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -28,6 +28,7 @@
typedef struct
{
glwthread_initguard_t guard; /* protects the initialization */
+ DWORD owner;
CRITICAL_SECTION lock;
}
glwthread_mutex_t;
diff --git a/gnulib/lib/windows-once.c b/gnulib/lib/windows-once.c
index 0d28281ffd..a8b9e0f3ae 100644
--- a/gnulib/lib/windows-once.c
+++ b/gnulib/lib/windows-once.c
@@ -1,5 +1,5 @@
/* Once-only control (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -29,7 +29,9 @@ glwthread_once (glwthread_once_t *once_control, void
(*initfunction) (void))
{
if (once_control->inited <= 0)
{
- if (InterlockedIncrement (&once_control->started) == 0)
+ InterlockedIncrement (&once_control->num_threads);
+ /* If once_control->started is == -1, set it to 0. */
+ if (InterlockedCompareExchange (&once_control->started, 0, -1) < 0)
{
/* This thread is the first one to come to this once_control. */
InitializeCriticalSection (&once_control->lock);
@@ -41,8 +43,6 @@ glwthread_once (glwthread_once_t *once_control, void
(*initfunction) (void))
}
else
{
- /* Don't let once_control->started grow and wrap around. */
- InterlockedDecrement (&once_control->started);
/* Some other thread has already started the initialization.
Yield the CPU while waiting for the other thread to finish
initializing and taking the lock. */
@@ -58,5 +58,48 @@ glwthread_once (glwthread_once_t *once_control, void
(*initfunction) (void))
abort ();
}
}
+ /* Here once_control->started == 0 and once_control->inited > 0. */
+ if (InterlockedDecrement (&once_control->num_threads) == 0)
+ /* once_control->num_threads is now zero, and
+ once_control->started == 0 and once_control->inited > 0.
+ No other thread will need to use the lock.
+ We can therefore destroy the lock, to free resources. */
+ /* If once_control->inited is == 1, set it to 2. */
+ if (InterlockedCompareExchange (&once_control->inited, 2, 1) == 1)
+ DeleteCriticalSection (&once_control->lock);
}
+ /* Proof of correctness:
+ * num_threads is incremented and then decremented by some threads.
+ Therefore, num_threads always stays >= 0, and is == 0 at the end.
+ * The first thread to go through the once_control->started fence
+ initializes the lock and moves inited from <= 0 to > 0. The other
+ threads don't move inited from <= 0 to > 0.
+ * started, once == 0, stays == 0.
+ * inited, once > 0, stays > 0 (since at the place where it is assigned 0,
+ it cannot be > 0).
+ * inited does not change any more once it is 2.
+ Therefore, it can be changed from 1 to 2 only once.
+ * DeleteCriticalSection gets invoked right after inited has been changed
+ from 1 to 2. Therefore, DeleteCriticalSection gets invoked only once.
+ * After a moment where num_threads was 0 and started was 0 and
+ inited was > 0, no thread can reach an InitializeCriticalSection or
+ EnterCriticalSection invocation. Proof:
+ - At such a moment, no thread is in the code range between
+ InterlockedIncrement (&once_control->num_threads)
+ and
+ InterlockedDecrement (&once_control->num_threads)
+ - After such a moment, some thread can increment num_threads, but from
+ there they cannot reach the InitializeCriticalSection invocation,
+ because the once_control->started test prevents that, and they cannot
+ reach the EnterCriticalSection invocation in the other branch because
+ the
+ if (once_control->inited <= 0)
+ test prevents that.
+ * From this it follows that:
+ - DeleteCriticalSection cannot be executed while the lock is taken
+ (because DeleteCriticalSection is only executed after a moment where
+ num_threads was 0 and started was 0 and inited was > 0).
+ - Once DeleteCriticalSection has been executed, the lock is not used any
+ more.
+ */
}
diff --git a/gnulib/lib/windows-once.h b/gnulib/lib/windows-once.h
index 54885680e2..18ed8d878a 100644
--- a/gnulib/lib/windows-once.h
+++ b/gnulib/lib/windows-once.h
@@ -1,5 +1,5 @@
/* Once-only control (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,13 +25,14 @@
typedef struct
{
- volatile int inited;
+ volatile LONG inited;
+ volatile LONG num_threads;
volatile LONG started;
CRITICAL_SECTION lock;
}
glwthread_once_t;
-#define GLWTHREAD_ONCE_INIT { -1, -1 }
+#define GLWTHREAD_ONCE_INIT { -1, 0, -1 }
#ifdef __cplusplus
extern "C" {
diff --git a/gnulib/lib/windows-recmutex.c b/gnulib/lib/windows-recmutex.c
index a8ce9a0481..e5672baf6e 100644
--- a/gnulib/lib/windows-recmutex.c
+++ b/gnulib/lib/windows-recmutex.c
@@ -1,5 +1,5 @@
/* Plain recursive mutexes (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/windows-recmutex.h b/gnulib/lib/windows-recmutex.h
index 08ff459769..9fa445b3d8 100644
--- a/gnulib/lib/windows-recmutex.h
+++ b/gnulib/lib/windows-recmutex.h
@@ -1,5 +1,5 @@
/* Plain recursive mutexes (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/windows-rwlock.c b/gnulib/lib/windows-rwlock.c
index 7cbd7bb1dd..e60c4efcee 100644
--- a/gnulib/lib/windows-rwlock.c
+++ b/gnulib/lib/windows-rwlock.c
@@ -1,5 +1,5 @@
/* Read-write locks (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/windows-rwlock.h b/gnulib/lib/windows-rwlock.h
index fe8381e870..08d677501c 100644
--- a/gnulib/lib/windows-rwlock.h
+++ b/gnulib/lib/windows-rwlock.h
@@ -1,5 +1,5 @@
/* Read-write locks (native Windows implementation).
- Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/xalloc-die.c b/gnulib/lib/xalloc-die.c
index 7605eee151..c053c7a8db 100644
--- a/gnulib/lib/xalloc-die.c
+++ b/gnulib/lib/xalloc-die.c
@@ -1,6 +1,6 @@
/* Report a memory allocation failure and exit.
- Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2023 Free Software
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2024 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@
#include <stdlib.h>
-#include "error.h"
+#include <error.h>
#include "exitfail.h"
#include "gettext.h"
diff --git a/gnulib/lib/xalloc-oversized.h b/gnulib/lib/xalloc-oversized.h
index 483bd11796..cfa527d38c 100644
--- a/gnulib/lib/xalloc-oversized.h
+++ b/gnulib/lib/xalloc-oversized.h
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -29,8 +29,7 @@
is SIZE_MAX - 1. */
#define __xalloc_oversized(n, s) \
((s) != 0 \
- && ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
- < (n)))
+ && (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
/* Return 1 if and only if an array of N objects, each of size S,
cannot exist reliably because its total size in bytes would exceed
@@ -48,7 +47,8 @@
#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && PTRDIFF_MAX < SIZE_MAX
+#elif 5 <= __GNUC__ && !defined __clang__ && !defined __ICC \
+ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
diff --git a/gnulib/lib/xalloc.h b/gnulib/lib/xalloc.h
index fb44f420db..75a5db30bb 100644
--- a/gnulib/lib/xalloc.h
+++ b/gnulib/lib/xalloc.h
@@ -1,6 +1,6 @@
/* xalloc.h -- malloc with out-of-memory checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gnulib/lib/xmalloc.c b/gnulib/lib/xmalloc.c
index 289cbd05fc..5befdab77c 100644
--- a/gnulib/lib/xmalloc.c
+++ b/gnulib/lib/xmalloc.c
@@ -1,6 +1,6 @@
/* xmalloc.c -- malloc with out of memory checking
- Copyright (C) 1990-2000, 2002-2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2002-2006, 2008-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include <string.h>
static void * _GL_ATTRIBUTE_PURE
-nonnull (void *p)
+check_nonnull (void *p)
{
if (!p)
xalloc_die ();
@@ -42,13 +42,13 @@ nonnull (void *p)
void *
xmalloc (size_t s)
{
- return nonnull (malloc (s));
+ return check_nonnull (malloc (s));
}
void *
ximalloc (idx_t s)
{
- return nonnull (imalloc (s));
+ return check_nonnull (imalloc (s));
}
char *
@@ -72,7 +72,7 @@ xrealloc (void *p, size_t s)
void *
xirealloc (void *p, idx_t s)
{
- return nonnull (irealloc (p, s));
+ return check_nonnull (irealloc (p, s));
}
/* Change the size of an allocated block of memory P to an array of N
@@ -90,7 +90,7 @@ xreallocarray (void *p, size_t n, size_t s)
void *
xireallocarray (void *p, idx_t n, idx_t s)
{
- return nonnull (ireallocarray (p, n, s));
+ return check_nonnull (ireallocarray (p, n, s));
}
/* Allocate an array of N objects, each with S bytes of memory,
@@ -295,13 +295,13 @@ xizalloc (idx_t s)
void *
xcalloc (size_t n, size_t s)
{
- return nonnull (calloc (n, s));
+ return check_nonnull (calloc (n, s));
}
void *
xicalloc (idx_t n, idx_t s)
{
- return nonnull (icalloc (n, s));
+ return check_nonnull (icalloc (n, s));
}
/* Clone an object P of size S, with error checking. There's no need
diff --git a/gnulib/lib/xsize.c b/gnulib/lib/xsize.c
index 279ae824f8..8774467536 100644
--- a/gnulib/lib/xsize.c
+++ b/gnulib/lib/xsize.c
@@ -1,6 +1,6 @@
/* Checked size_t computations.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/gnulib/lib/xsize.h b/gnulib/lib/xsize.h
index 5b08d61f2f..5ae86006d9 100644
--- a/gnulib/lib/xsize.h
+++ b/gnulib/lib/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -26,7 +26,7 @@
/* Get size_t. */
#include <stddef.h>
-/* Get SIZE_MAX. */
+/* Get INT_MAX, SIZE_MAX. */
#include <limits.h>
#if HAVE_STDINT_H
# include <stdint.h>
@@ -40,6 +40,11 @@ _GL_INLINE_HEADER_BEGIN
# define XSIZE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* The size of memory objects is often computed through expressions of
type size_t. Example:
void* p = malloc (header_size + n * element_size).
@@ -56,7 +61,8 @@ _GL_INLINE_HEADER_BEGIN
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
*/
-/* Convert an arbitrary value >= 0 to type size_t. */
+/* Convert an arbitrary N >= 0 to type size_t.
+ N should not have side effects. */
#define xcast_size_t(N) \
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
@@ -64,8 +70,15 @@ _GL_INLINE_HEADER_BEGIN
XSIZE_INLINE size_t ATTRIBUTE_PURE
xsum (size_t size1, size_t size2)
{
- size_t sum = size1 + size2;
- return (sum >= size1 ? sum : SIZE_MAX);
+ if (INT_MAX < SIZE_MAX)
+ {
+ /* Optimize for the common case where size_t arithmetic wraps
+ around without undefined behavior. */
+ size_t sum = size1 + size2;
+ return size1 <= sum ? sum : SIZE_MAX;
+ }
+
+ return size1 <= SIZE_MAX - size2 ? size1 + size2 : SIZE_MAX;
}
/* Sum of three sizes, with overflow check. */
@@ -93,6 +106,8 @@ xmax (size_t size1, size_t size2)
/* Multiplication of a count with an element size, with overflow check.
The count must be >= 0 and the element size must be > 0.
+ Arguments should not have side effects.
+ The element size's type should be no wider than size_t.
This is a macro, not a function, so that it works correctly even
when N is of a wider type and N > SIZE_MAX. */
#define xtimes(N, ELSIZE) \
@@ -105,6 +120,11 @@ xmax (size_t size1, size_t size2)
#define size_in_bounds_p(SIZE) \
((SIZE) != SIZE_MAX)
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _XSIZE_H */
diff --git a/gnulib/m4/00gnulib.m4 b/gnulib/m4/00gnulib.m4
index 7fe03e0b9c..cd16771848 100644
--- a/gnulib/m4/00gnulib.m4
+++ b/gnulib/m4/00gnulib.m4
@@ -1,5 +1,6 @@
-# 00gnulib.m4 serial 8
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# 00gnulib.m4
+# serial 9
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -49,14 +50,14 @@ dnl AC_REQUIRE([gl_COMPILER_CLANG])
[if test $gl_cv_compiler_clang = yes; then
dnl Test whether the compiler supports the option
dnl '-Werror=implicit-function-declaration'.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile -Werror=implicit-function-declaration"
dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
dnl warning "AC_COMPILE_IFELSE was called before
AC_USE_SYSTEM_EXTENSIONS".
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
[gl_cv_compiler_check_decl_option=none])
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
else
gl_cv_compiler_check_decl_option=none
fi
@@ -71,11 +72,11 @@ dnl Redefine _AC_CHECK_DECL_BODY so that it references
ac_compile_for_check_decl
dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
m4_define([_AC_CHECK_DECL_BODY],
-[ ac_save_ac_compile="$ac_compile"
+[ ac_saved_ac_compile="$ac_compile"
if test -n "$ac_compile_for_check_decl"; then
ac_compile="$ac_compile_for_check_decl"
fi]
-m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile"
])
# gl_00GNULIB
diff --git a/gnulib/m4/__inline.m4 b/gnulib/m4/__inline.m4
index acf8668bc5..20baf16437 100644
--- a/gnulib/m4/__inline.m4
+++ b/gnulib/m4/__inline.m4
@@ -1,9 +1,12 @@
-# Test for __inline keyword
-dnl Copyright 2017-2023 Free Software Foundation, Inc.
+# __inline.m4
+# serial 1
+dnl Copyright 2017-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Test for __inline keyword
+
AC_DEFUN([gl___INLINE],
[
AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
diff --git a/gnulib/m4/absolute-header.m4 b/gnulib/m4/absolute-header.m4
index 0cab36454d..0abd6d9002 100644
--- a/gnulib/m4/absolute-header.m4
+++ b/gnulib/m4/absolute-header.m4
@@ -1,5 +1,6 @@
-# absolute-header.m4 serial 18
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# absolute-header.m4
+# serial 18
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/alloca.m4 b/gnulib/m4/alloca.m4
index c685fac918..dc78dc19a8 100644
--- a/gnulib/m4/alloca.m4
+++ b/gnulib/m4/alloca.m4
@@ -1,5 +1,6 @@
-# alloca.m4 serial 21
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# alloca.m4
+# serial 21
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/argz.m4 b/gnulib/m4/argz.m4
index ed432322c1..51a358d55a 100644
--- a/gnulib/m4/argz.m4
+++ b/gnulib/m4/argz.m4
@@ -1,13 +1,13 @@
+# argz.m4
+# serial 15
+dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
# Portability macros for glibc argz. -*- Autoconf -*-
-#
-# Copyright (C) 2004-2023 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan <gary@gnu.org>
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-# serial 14 argz.m4
+# Written by Gary V. Vaughan <gary@gnu.org>
AC_DEFUN([gl_FUNC_ARGZ],
[gl_PREREQ_ARGZ
@@ -50,10 +50,10 @@ AS_IF([! $GL_GENERATE_ARGZ_H],
lt_cv_sys_argz_works="$gl_cross_guess_normal"
else
lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
- save_IFS=$IFS
+ saved_IFS=$IFS
IFS=-.
set x `uname -r | sed -e "$lt_sed_extract_leading_digits"`
- IFS=$save_IFS
+ IFS=$saved_IFS
lt_os_major=${2-0}
lt_os_minor=${3-0}
lt_os_micro=${4-0}
diff --git a/gnulib/m4/assert_h.m4 b/gnulib/m4/assert_h.m4
index d255855d31..b90d0f1939 100644
--- a/gnulib/m4/assert_h.m4
+++ b/gnulib/m4/assert_h.m4
@@ -1,5 +1,6 @@
-# assert-h.m4
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# assert_h.m4
+# serial 1
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,10 +10,10 @@ dnl From Paul Eggert.
AC_DEFUN([gl_ASSERT_H],
[
AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
- [gl_save_CFLAGS=$CFLAGS
+ [gl_saved_CFLAGS=$CFLAGS
for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
AS_CASE([$gl_working],
- [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"])
+ [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -32,7 +33,7 @@ AC_DEFUN([gl_ASSERT_H],
]])],
[gl_cv_static_assert=$gl_working],
[gl_cv_static_assert=no])
- CFLAGS=$gl_save_CFLAGS
+ CFLAGS=$gl_saved_CFLAGS
test "$gl_cv_static_assert" != no && break
done])
diff --git a/gnulib/m4/btowc.m4 b/gnulib/m4/btowc.m4
index c1d956b755..d9dd7036a2 100644
--- a/gnulib/m4/btowc.m4
+++ b/gnulib/m4/btowc.m4
@@ -1,5 +1,6 @@
-# btowc.m4 serial 14
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# btowc.m4
+# serial 14
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/builtin-expect.m4 b/gnulib/m4/builtin-expect.m4
index 531ed48af7..33f255e9f5 100644
--- a/gnulib/m4/builtin-expect.m4
+++ b/gnulib/m4/builtin-expect.m4
@@ -1,10 +1,12 @@
-dnl Check for __builtin_expect.
-
-dnl Copyright 2016-2023 Free Software Foundation, Inc.
+# builtin-expect.m4
+# serial 2
+dnl Copyright 2016-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Provide a GCC-compatible __builtin_expect macro in <config.h>.
+
dnl Written by Paul Eggert.
AC_DEFUN([gl___BUILTIN_EXPECT],
diff --git a/gnulib/m4/c-bool.m4 b/gnulib/m4/c-bool.m4
index f614371bb2..0fb0de3b59 100644
--- a/gnulib/m4/c-bool.m4
+++ b/gnulib/m4/c-bool.m4
@@ -1,10 +1,12 @@
-# Check for bool that conforms to C2023.
-
-dnl Copyright 2022-2023 Free Software Foundation, Inc.
+# c-bool.m4
+# serial 1
+dnl Copyright 2022-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Check for bool that conforms to C2023.
+
AC_DEFUN([gl_C_BOOL],
[
AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
diff --git a/gnulib/m4/c32rtomb.m4 b/gnulib/m4/c32rtomb.m4
new file mode 100644
index 0000000000..cf7ff69dae
--- /dev/null
+++ b/gnulib/m4/c32rtomb.m4
@@ -0,0 +1,186 @@
+# c32rtomb.m4
+# serial 8
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_C32RTOMB],
+[
+ AC_REQUIRE([gl_UCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
+
+ AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB])
+ if test $gl_cv_func_c32rtomb = no; then
+ HAVE_C32RTOMB=0
+ else
+ dnl When we override mbrtoc32, redefining the meaning of the char32_t
+ dnl values, we need to override c32rtomb as well, for consistency.
+ if test $HAVE_WORKING_MBRTOC32 = 0; then
+ REPLACE_C32RTOMB=1
+ fi
+ AC_CACHE_CHECK([whether c32rtomb return value is correct],
+ [gl_cv_func_c32rtomb_retval],
+ [
+ dnl Initial guess, used when cross-compiling.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX.
+ aix*) gl_cv_func_c32rtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_c32rtomb_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#ifdef __HAIKU__
+ #include <stdint.h>
+#endif
+#include <uchar.h>
+int main ()
+{
+ int result = 0;
+ if (c32rtomb (NULL, 0, NULL) != 1)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_c32rtomb_retval=yes],
+ [gl_cv_func_c32rtomb_retval=no],
+ [:])
+ ])
+ case "$gl_cv_func_c32rtomb_retval" in
+ *yes) ;;
+ *) AC_DEFINE([C32RTOMB_RETVAL_BUG], [1],
+ [Define if the c32rtomb function has an incorrect return value.])
+ REPLACE_C32RTOMB=1 ;;
+ esac
+ if test $HAVE_WORKING_C32RTOMB = 0; then
+ REPLACE_C32RTOMB=1
+ fi
+ fi
+])
+
+AC_DEFUN([gl_CHECK_FUNC_C32RTOMB],
+[
+ dnl Cf. gl_CHECK_FUNCS_ANDROID
+ AC_CHECK_DECL([c32rtomb], , ,
+ [[#ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
+ ]])
+ if test $ac_cv_have_decl_c32rtomb = yes; then
+ dnl We can't use AC_CHECK_FUNC here, because c32rtomb() is defined as a
+ dnl static inline function on Haiku 2020.
+ AC_CACHE_CHECK([for c32rtomb], [gl_cv_func_c32rtomb],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
+ ]],
+ [[char buf[8];
+ return c32rtomb (buf, 0, NULL) == 0;
+ ]])
+ ],
+ [gl_cv_func_c32rtomb=yes],
+ [gl_cv_func_c32rtomb=no])
+ ])
+ else
+ gl_cv_func_c32rtomb=no
+ fi
+])
+
+dnl Test whether c32rtomb works not worse than wcrtomb.
+dnl Result is HAVE_WORKING_C32RTOMB.
+
+AC_DEFUN([gl_C32RTOMB_SANITYCHECK],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_TYPE_CHAR32_T])
+ AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_c32rtomb =
no; then
+ HAVE_WORKING_C32RTOMB=0
+ else
+ AC_CACHE_CHECK([whether c32rtomb works as well as wcrtomb],
+ [gl_cv_func_c32rtomb_sanitycheck],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris derivatives.
+ solaris*)
+ if test -f /etc/release && grep 'Oracle Solaris' /etc/release
>/dev/null; then
+ gl_cv_func_c32rtomb_sanitycheck="guessing yes"
+ else
+ gl_cv_func_c32rtomb_sanitycheck="guessing no"
+ fi
+ ;;
+ # Guess yes otherwise.
+ *)
+ gl_cv_func_c32rtomb_sanitycheck="guessing yes"
+ ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#ifdef __HAIKU__
+ #include <stdint.h>
+#endif
+#include <uchar.h>
+int main ()
+{
+ int result = 0;
+ /* This fails on Solaris 11 OmniOS:
+ c32rtomb returns (size_t)-1.
+ wcrtomb returns 4 (correct). */
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ char buf[16];
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\201\060\211\070", 4, &state) == 4
+ && wcrtomb (buf, wc, NULL) == 4
+ && memcmp (buf, "\201\060\211\070", 4) == 0)
+ {
+ char32_t c32 = (wchar_t) 0xBADFACE;
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtoc32 (&c32, "\201\060\211\070", 4, &state) == 4
+ && c32rtomb (buf, c32, NULL) != 4)
+ result |= 1;
+ }
+ }
+ return result;
+}]])],
+ [gl_cv_func_c32rtomb_sanitycheck=yes],
+ [gl_cv_func_c32rtomb_sanitycheck=no],
+ [:])
+ fi
+ ])
+ case "$gl_cv_func_c32rtomb_sanitycheck" in
+ *yes)
+ HAVE_WORKING_C32RTOMB=1
+ AC_DEFINE([HAVE_WORKING_C32RTOMB], [1],
+ [Define if the c32rtomb function basically works.])
+ ;;
+ *) HAVE_WORKING_C32RTOMB=0 ;;
+ esac
+ fi
+ AC_SUBST([HAVE_WORKING_C32RTOMB])
+])
diff --git a/gnulib/m4/calloc.m4 b/gnulib/m4/calloc.m4
index e2f5677556..c69ce414a0 100644
--- a/gnulib/m4/calloc.m4
+++ b/gnulib/m4/calloc.m4
@@ -1,9 +1,9 @@
-# calloc.m4 serial 31
-
-# Copyright (C) 2004-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# calloc.m4
+# serial 34
+dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# Written by Jim Meyering.
@@ -58,6 +58,11 @@ AC_DEFUN([gl_FUNC_CALLOC_GNU],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_CALLOC_POSIX])
+
+ dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
+ dnl gets defined already before this macro gets invoked. This helps
+ dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise.
+
REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX"
if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then
_AC_FUNC_CALLOC_IF([], [REPLACE_CALLOC_FOR_CALLOC_GNU=1])
diff --git a/gnulib/m4/clock_time.m4 b/gnulib/m4/clock_time.m4
index 7ed718c003..27f6fd153a 100644
--- a/gnulib/m4/clock_time.m4
+++ b/gnulib/m4/clock_time.m4
@@ -1,5 +1,6 @@
-# clock_time.m4 serial 14
-dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
+# clock_time.m4
+# serial 14
+dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/close.m4 b/gnulib/m4/close.m4
index 0feabd6917..88c37fab6c 100644
--- a/gnulib/m4/close.m4
+++ b/gnulib/m4/close.m4
@@ -1,5 +1,6 @@
-# close.m4 serial 10
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# close.m4
+# serial 10
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/codeset.m4 b/gnulib/m4/codeset.m4
index 5804f472e9..e69b7402fc 100644
--- a/gnulib/m4/codeset.m4
+++ b/gnulib/m4/codeset.m4
@@ -1,5 +1,6 @@
-# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software
+# codeset.m4
+# serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/double-slash-root.m4 b/gnulib/m4/double-slash-root.m4
index 1776e5eb75..3437c699ad 100644
--- a/gnulib/m4/double-slash-root.m4
+++ b/gnulib/m4/double-slash-root.m4
@@ -1,5 +1,6 @@
-# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
+# double-slash-root.m4
+# serial 4 -*- Autoconf -*-
+dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/dup2.m4 b/gnulib/m4/dup2.m4
index 876e0d8bd2..786121fd8f 100644
--- a/gnulib/m4/dup2.m4
+++ b/gnulib/m4/dup2.m4
@@ -1,5 +1,6 @@
-#serial 28
-dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+# dup2.m4
+# serial 28
+dnl Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/eealloc.m4 b/gnulib/m4/eealloc.m4
index cb3e08fe53..8a15e70554 100644
--- a/gnulib/m4/eealloc.m4
+++ b/gnulib/m4/eealloc.m4
@@ -1,5 +1,6 @@
-# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc.
+# eealloc.m4
+# serial 3
+dnl Copyright (C) 2003, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/errno_h.m4 b/gnulib/m4/errno_h.m4
index 4c70d22528..920ea6cc65 100644
--- a/gnulib/m4/errno_h.m4
+++ b/gnulib/m4/errno_h.m4
@@ -1,5 +1,6 @@
-# errno_h.m4 serial 14
-dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# errno_h.m4
+# serial 18
+dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +10,11 @@ AC_PREREQ([2.61])
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
+
+ dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
+ dnl gets defined already before this macro gets invoked. This persuades
+ dnl AIX 7.3 errno.h to assign ENOTEMPTY a value different than EEXIST.
+
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
AC_EGREP_CPP([booboo],[
#include <errno.h>
@@ -62,6 +68,9 @@ booboo
#endif
#if !defined EILSEQ
booboo
+#endif
+#if !defined ESOCKTNOSUPPORT
+booboo
#endif
],
[gl_cv_header_errno_h_complete=no],
diff --git a/gnulib/m4/error.m4 b/gnulib/m4/error.m4
index 93a7558b5f..273b636b5d 100644
--- a/gnulib/m4/error.m4
+++ b/gnulib/m4/error.m4
@@ -1,10 +1,9 @@
-#serial 16
-
-# Copyright (C) 1996-1998, 2001-2004, 2009-2023 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# error.m4
+# serial 16
+dnl Copyright (C) 1996-1998, 2001-2004, 2009-2024 Free Software Foundation,
Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ERROR],
[
diff --git a/gnulib/m4/error_h.m4 b/gnulib/m4/error_h.m4
index e8a58f6fbd..91a8fc6897 100644
--- a/gnulib/m4/error_h.m4
+++ b/gnulib/m4/error_h.m4
@@ -1,11 +1,12 @@
-# error_h.m4 serial 4
-dnl Copyright (C) 1996-2023 Free Software Foundation, Inc.
+# error_h.m4
+# serial 5
+dnl Copyright (C) 1996-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-dnl Provide a working "error.h".
+dnl Provide a working <error.h>.
AC_DEFUN_ONCE([gl_ERROR_H],
[
@@ -110,12 +111,15 @@ AC_DEFUN_ONCE([gl_ERROR_H],
esac
fi
- if test $HAVE_ERROR = 0 || test $REPLACE_ERROR = 1 \
- || test $HAVE_ERROR_AT_LINE = 0 || test $REPLACE_ERROR_AT_LINE = 1; then
- COMPILE_ERROR_C=1
- else
- COMPILE_ERROR_C=0
- fi
+ m4_ifdef([gl_HAVE_MODULE_VERROR],
+ [COMPILE_ERROR_C=1],
+ [if test $HAVE_ERROR = 0 || test $REPLACE_ERROR = 1 \
+ || test $HAVE_ERROR_AT_LINE = 0 \
+ || test $REPLACE_ERROR_AT_LINE = 1; then
+ COMPILE_ERROR_C=1
+ else
+ COMPILE_ERROR_C=0
+ fi])
AC_SUBST([HAVE_ERROR])
AC_SUBST([HAVE_ERROR_AT_LINE])
diff --git a/gnulib/m4/exponentd.m4 b/gnulib/m4/exponentd.m4
index 163114b89e..db597afccc 100644
--- a/gnulib/m4/exponentd.m4
+++ b/gnulib/m4/exponentd.m4
@@ -1,5 +1,6 @@
-# exponentd.m4 serial 4
-dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc.
+# exponentd.m4
+# serial 4
+dnl Copyright (C) 2007-2008, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/extensions-aix.m4 b/gnulib/m4/extensions-aix.m4
new file mode 100644
index 0000000000..990a7ac3ef
--- /dev/null
+++ b/gnulib/m4/extensions-aix.m4
@@ -0,0 +1,25 @@
+# extensions-aix.m4
+# serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# On AIX, most extensions are already enabled through the _ALL_SOURCE macro,
+# defined by gl_USE_SYSTEM_EXTENSIONS. gl_USE_AIX_EXTENSIONS additionally
+# activates more GNU and Linux-like behaviours, affecting
+# - the time_t type,
+# - errno values in <errno.h>: ENOTEMPTY
+# - functions in <stdlib.h>: malloc calloc realloc valloc
+#
<https://www.ibm.com/docs/en/aix/7.3?topic=m-malloc-free-realloc-calloc-mallopt-mallinfo-mallinfo-heap-alloca-valloc-posix-memalign-subroutine>
+# - functions in <string.h>: strerror_r (returns 'char *', like glibc)
+# - functions in <dirent.h>: scandir, alphasort, readdir_r
+# - functions in <netdb.h>: gethostbyname_r gethostbyaddr_r
+# - declarations in <unistd.h>: sbrk
+# and a couple of secondary <sys/*> header files.
+
+AC_DEFUN_ONCE([gl_USE_AIX_EXTENSIONS],
+[
+ AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
+ [Define so that AIX headers are more compatible with GNU/Linux.])
+])
diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
index 5336b8daf7..1fb68956b3 100644
--- a/gnulib/m4/extensions.m4
+++ b/gnulib/m4/extensions.m4
@@ -1,10 +1,11 @@
-# serial 23 -*- Autoconf -*-
-# Enable extensions on systems that normally disable them.
+# extensions.m4
+# serial 25 -*- Autoconf -*-
+dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Enable extensions on systems that normally disable them.
dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
@@ -229,4 +230,15 @@ AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
[Define to enable the declarations of ISO C 11 types and functions.])
;;
esac
+
+ dnl On OpenSolaris derivatives, the include files contains a couple of
+ dnl declarations that are only activated with an explicit
+ dnl -D__STDC_WANT_LIB_EXT1__.
+ AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS],
+[/* Define to enable the declarations of ISO C 23 Annex K types and functions.
*/
+#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__)
+#undef/**/__STDC_WANT_LIB_EXT1__
+#define __STDC_WANT_LIB_EXT1__ 1
+#endif
+])
])
diff --git a/gnulib/m4/extern-inline.m4 b/gnulib/m4/extern-inline.m4
index f9894d7fe5..547da82afa 100644
--- a/gnulib/m4/extern-inline.m4
+++ b/gnulib/m4/extern-inline.m4
@@ -1,10 +1,12 @@
-dnl 'extern inline' a la ISO C99.
-
-dnl Copyright 2012-2023 Free Software Foundation, Inc.
+# extern-inline.m4
+# serial 1
+dnl Copyright 2012-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl 'extern inline' a la ISO C99.
+
AC_DEFUN([gl_EXTERN_INLINE],
[
AC_CACHE_CHECK([whether ctype.h defines __header_inline],
diff --git a/gnulib/m4/fcntl-o.m4 b/gnulib/m4/fcntl-o.m4
index 2fc3d09ad7..43aa132579 100644
--- a/gnulib/m4/fcntl-o.m4
+++ b/gnulib/m4/fcntl-o.m4
@@ -1,5 +1,6 @@
-# fcntl-o.m4 serial 8
-dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
+# fcntl-o.m4
+# serial 8
+dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/fcntl.m4 b/gnulib/m4/fcntl.m4
index 524a99af80..f6d0f37731 100644
--- a/gnulib/m4/fcntl.m4
+++ b/gnulib/m4/fcntl.m4
@@ -1,5 +1,6 @@
-# fcntl.m4 serial 11
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# fcntl.m4
+# serial 12
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -82,7 +83,7 @@ AC_DEFUN([gl_FUNC_FCNTL],
esac
dnl Many systems lack F_DUPFD_CLOEXEC.
- dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
+ dnl NetBSD 10.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
[gl_cv_func_fcntl_f_dupfd_cloexec],
[AC_RUN_IFELSE(
diff --git a/gnulib/m4/fcntl_h.m4 b/gnulib/m4/fcntl_h.m4
index 68f4e64802..b69f7a0ca8 100644
--- a/gnulib/m4/fcntl_h.m4
+++ b/gnulib/m4/fcntl_h.m4
@@ -1,10 +1,12 @@
+# fcntl_h.m4
# serial 20
-# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Configure fcntl.h.
+
dnl Written by Paul Eggert.
AC_DEFUN_ONCE([gl_FCNTL_H],
diff --git a/gnulib/m4/float_h.m4 b/gnulib/m4/float_h.m4
index 95897cf17b..12c0eb6749 100644
--- a/gnulib/m4/float_h.m4
+++ b/gnulib/m4/float_h.m4
@@ -1,5 +1,6 @@
-# float_h.m4 serial 14
-dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# float_h.m4
+# serial 15
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -53,6 +54,31 @@ changequote([,])dnl
;;
esac
+ dnl Test for completeness w.r.t. ISO C 23.
+ REPLACE_FLOAT_SNAN=0
+ AC_CACHE_CHECK([whether float.h conforms to ISO C23],
+ [gl_cv_header_float_h_isoc23],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <float.h>
+ int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG };
+ float maxf = FLT_NORM_MAX;
+ double maxd = DBL_NORM_MAX;
+ long double maxl = LDBL_NORM_MAX;
+ ]],
+ [[float sf = FLT_SNAN;
+ double sd = DBL_SNAN;
+ long double sl = LDBL_SNAN;
+ return (sf != 0) + (sd != 0) + (sl != 0);
+ ]])],
+ [gl_cv_header_float_h_isoc23=yes],
+ [gl_cv_header_float_h_isoc23=no])
+ ])
+ if test $gl_cv_header_float_h_isoc23 != yes; then
+ GL_GENERATE_FLOAT_H=true
+ REPLACE_FLOAT_SNAN=1
+ fi
+
dnl Test against glibc-2.7 Linux/SPARC64 bug.
REPLACE_ITOLD=0
AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
diff --git a/gnulib/m4/free.m4 b/gnulib/m4/free.m4
index 0389dea3f4..a2b596d67f 100644
--- a/gnulib/m4/free.m4
+++ b/gnulib/m4/free.m4
@@ -1,8 +1,9 @@
-# free.m4 serial 6
-# Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# free.m4
+# serial 6
+dnl Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert and Bruno Haible.
diff --git a/gnulib/m4/fstat.m4 b/gnulib/m4/fstat.m4
index 382741f412..47777b0c5a 100644
--- a/gnulib/m4/fstat.m4
+++ b/gnulib/m4/fstat.m4
@@ -1,5 +1,6 @@
-# fstat.m4 serial 9
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# fstat.m4
+# serial 10
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,10 +11,10 @@ AC_DEFUN([gl_FUNC_FSTAT],
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
case "$host_os" in
- mingw* | windows* | solaris*)
+ darwin* | mingw* | windows* | solaris*)
+ dnl macOS and Solaris stat can return a negative tv_nsec.
dnl On MinGW, the original stat() returns st_atime, st_mtime,
dnl st_ctime values that are affected by the time zone.
- dnl Solaris stat can return a negative tv_nsec.
REPLACE_FSTAT=1
;;
esac
diff --git a/gnulib/m4/getdtablesize.m4 b/gnulib/m4/getdtablesize.m4
index 8bcda9053b..aaefe9b298 100644
--- a/gnulib/m4/getdtablesize.m4
+++ b/gnulib/m4/getdtablesize.m4
@@ -1,5 +1,6 @@
-# getdtablesize.m4 serial 8
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# getdtablesize.m4
+# serial 8
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/getopt.m4 b/gnulib/m4/getopt.m4
index b136ce9537..53cab8bef9 100644
--- a/gnulib/m4/getopt.m4
+++ b/gnulib/m4/getopt.m4
@@ -1,5 +1,6 @@
-# getopt.m4 serial 49
-dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
+# getopt.m4
+# serial 50
+dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -365,14 +366,7 @@ dnl is ambiguous with environment values that contain
newlines.
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
[
- AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
- if test $ac_cv_header_sys_cdefs_h = yes; then
- HAVE_SYS_CDEFS_H=1
- else
- HAVE_SYS_CDEFS_H=0
- fi
- AC_SUBST([HAVE_SYS_CDEFS_H])
-
+ gl_CHECK_HEADER_SYS_CDEFS_H
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
diff --git a/gnulib/m4/getprogname.m4 b/gnulib/m4/getprogname.m4
index 2b741f5083..b24f448055 100644
--- a/gnulib/m4/getprogname.m4
+++ b/gnulib/m4/getprogname.m4
@@ -1,11 +1,11 @@
-# getprogname.m4 - check for getprogname or replacements for it
-
-# Copyright (C) 2016-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
+# getprogname.m4
# serial 8
+dnl Copyright (C) 2016-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Check for getprogname or replacements for it
AC_DEFUN([gl_FUNC_GETPROGNAME],
[
diff --git a/gnulib/m4/getrandom.m4 b/gnulib/m4/getrandom.m4
index fd73191b7b..0051c9c421 100644
--- a/gnulib/m4/getrandom.m4
+++ b/gnulib/m4/getrandom.m4
@@ -1,5 +1,6 @@
-# getrandom.m4 serial 12
-dnl Copyright 2020-2023 Free Software Foundation, Inc.
+# getrandom.m4
+# serial 13
+dnl Copyright 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +10,8 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_FUNC_GETRANDOM],
[
AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
gl_CHECK_FUNCS_ANDROID([getrandom],
[[/* Additional includes are needed before <sys/random.h> on uClibc
and Mac OS X. */
diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
index 54cdf6a50b..50da779473 100644
--- a/gnulib/m4/gnulib-cache.m4
+++ b/gnulib/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4
index c372316135..d985522893 100644
--- a/gnulib/m4/gnulib-common.m4
+++ b/gnulib/m4/gnulib-common.m4
@@ -1,5 +1,6 @@
-# gnulib-common.m4 serial 88
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# gnulib-common.m4
+# serial 103
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -20,10 +21,22 @@ AC_DEFUN([gl_COMMON_BODY], [
#define _GL_CONFIG_H_INCLUDED 1
])
AH_VERBATIM([_GL_GNUC_PREREQ],
-[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
-#if defined __GNUC__ && defined __GNUC_MINOR__
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR.
+ Except that
+ - clang groks GNU C 4.2, even on Windows, where it does not define
+ __GNUC__.
+ - The OpenMandriva-modified clang compiler pretends that it groks
+ GNU C version 13.1, but it doesn't: It does not support
+ __attribute__ ((__malloc__ (f, i))), nor does it support
+ __attribute__ ((__warning__ (message))) on a function redeclaration.
+ - Users can make clang lie as well, through the -fgnuc-version option.
*/
+#if defined __GNUC__ && defined __GNUC_MINOR__ && !defined __clang__
# define _GL_GNUC_PREREQ(major, minor) \
((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#elif defined __clang__
+ /* clang really only groks GNU C 4.2. */
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < 4 + ((minor) <= 2))
#else
# define _GL_GNUC_PREREQ(major, minor) 0
#endif
@@ -76,50 +89,79 @@ AC_DEFUN([gl_COMMON_BODY], [
#endif])
AH_VERBATIM([attribute],
[/* Attributes. */
-#if (defined __has_attribute \
- && (!defined __clang_minor__ \
- || (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
- : 5 <= __clang_major__)))
-# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
-#else
-# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
-# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
-# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
-# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
-# define _GL_ATTR_diagnose_if 0
-# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
-# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
-# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
-# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
-# ifdef _ICC
-# define _GL_ATTR_may_alias 0
+/* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if
+ <config.h> gets included once again after <sys/cdefs.h>, __has_attribute(x)
+ expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all
+ attributes. */
+#ifndef _GL_HAS_ATTRIBUTE
+# if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
+ : 5 <= __clang_major__)))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
# else
-# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_reproducible 0 /* not yet supported, as of GCC 14 */
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unsequenced 0 /* not yet supported, as of GCC 14 */
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
# endif
-# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
-# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
-# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
-# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
-# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
-# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
-# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
-# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
-/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
-#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
- && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
-# pragma GCC diagnostic ignored "-Wpedantic"
+/* Use __has_c_attribute if available. However, do not use with
+ pre-C23 GCC, which can issue false positives if -Wpedantic. */
+#if (defined __has_c_attribute \
+ && ! (_GL_GNUC_PREREQ (4, 6) \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710))
+# define _GL_HAVE___HAS_C_ATTRIBUTE 1
+#else
+# define _GL_HAVE___HAS_C_ATTRIBUTE 0
#endif
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in function declarations. There are two problems here.
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ 1) We want that the _GL_ATTRIBUTE_* can be cumulated on the same declaration
+ in any order.
+ =========================== foo.c = foo.cc ===========================
+ __attribute__ ((__deprecated__)) [[__nodiscard__]] int bar1 (int);
+ [[__nodiscard__]] __attribute__ ((__deprecated__)) int bar2 (int);
+ ======================================================================
+ This gives a syntax error
+ - in C mode with gcc
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796>, and
+ - in C++ mode with clang++ version < 16, and
+ - in C++ mode, inside extern "C" {}, still in newer clang++ versions
+ <https://github.com/llvm/llvm-project/issues/101990>.
+ */
/* Define if, in a function declaration, the attributes in bracket syntax
[[...]] must come before the attributes in __attribute__((...)) syntax.
If this is defined, it is best to avoid the bracket syntax, so that the
@@ -134,6 +176,176 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
# endif
#endif
+/*
+ 2) We want that the _GL_ATTRIBUTE_* can be placed in a declaration
+ - without 'extern', in C as well as in C++,
+ - with 'extern', in C,
+ - with 'extern "C"', in C++
+ in the same position. That is, we don't want to be forced to use a
+ macro which arranges for the attribute to come before 'extern' in
+ one case and after 'extern' in the other case, because such a macro
+ would make the source code of .h files pretty ugly.
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define ND [[__nodiscard__]]
+ #define WUR __attribute__((__warn_unused_result__))
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ // gcc clang g++ clang++
+
+ ND int foo (int);
+ int ND foo (int); // warn error warn error
+ int foo ND (int);
+ int foo (int) ND; // warn error warn error
+
+ WUR int foo (int);
+ int WUR foo (int);
+ int fo1 WUR (int); // error error error error
+ int foo (int) WUR;
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+ // gcc clang g++ clang++
+
+ ND extern CC int foo (int); // error error
+ extern CC ND int foo (int); // error error
+ extern CC int ND foo (int); // warn error warn error
+ extern CC int foo ND (int);
+ extern CC int foo (int) ND; // warn error warn error
+
+ WUR extern CC int foo (int); // warn
+ extern CC WUR int foo (int);
+ extern CC int WUR foo (int);
+ extern CC int foo WUR (int); // error error error error
+ extern CC int foo (int) WUR;
+
+ ND EXTERN_C_FUNC int foo (int); // error error
+ EXTERN_C_FUNC ND int foo (int);
+ EXTERN_C_FUNC int ND foo (int); // warn error warn error
+ EXTERN_C_FUNC int foo ND (int);
+ EXTERN_C_FUNC int foo (int) ND; // warn error warn error
+
+ WUR EXTERN_C_FUNC int foo (int); // warn
+ EXTERN_C_FUNC WUR int foo (int);
+ EXTERN_C_FUNC int WUR foo (int);
+ EXTERN_C_FUNC int fo2 WUR (int); // error error error error
+ EXTERN_C_FUNC int foo (int) WUR;
+ ======================================================================
+ So, if we insist on using the 'extern' keyword ('extern CC' idiom):
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there is one available position:
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is no available position:
+ it would need to come before 'extern' in C but after 'extern "C"'
+ in C++.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ Whereas, if we use the 'EXTERN_C_FUNC' idiom, which conditionally
+ omits the 'extern' keyword:
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there are two available positions:
+ - before the return type,
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is one available position:
+ - before the return type.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ The best choice is therefore to use the 'EXTERN_C_FUNC' idiom and
+ put the attributes before the return type. This works regardless
+ to what the _GL_ATTRIBUTE_* macros expand.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in static/inline function definitions.
+
+ There are similar constraints as for function declarations. However, here,
+ we cannot omit the storage-class specifier. Therefore, the following rule
+ applies:
+ * The macros
+ _GL_ATTRIBUTE_CONST
+ _GL_ATTRIBUTE_DEPRECATED
+ _GL_ATTRIBUTE_MAYBE_UNUSED
+ _GL_ATTRIBUTE_NODISCARD
+ _GL_ATTRIBUTE_PURE
+ _GL_ATTRIBUTE_REPRODUCIBLE
+ _GL_ATTRIBUTE_UNSEQUENCED
+ which may expand to bracket syntax [[...]], must come first, before the
+ storage-class specifier.
+ * Other _GL_ATTRIBUTE_* macros, that expand to __attribute__((...))
syntax,
+ are better placed between the storage-class specifier and the return
+ type.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in variable declarations.
+
+ At which position can they be placed?
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define BD [[__deprecated__]]
+ #define AD __attribute__ ((__deprecated__))
+
+ // gcc clang g++ clang++
+
+ BD extern CC int var; // error error
+ extern CC BD int var; // error error
+ extern CC int BD var; // warn error warn error
+ extern CC int var BD;
+
+ AD extern CC int var; // warn
+ extern CC AD int var;
+ extern CC int AD var;
+ extern CC int var AD;
+
+ BD extern CC int z[]; // error error
+ extern CC BD int z[]; // error error
+ extern CC int BD z[]; // warn error warn error
+ extern CC int z1 BD [];
+ extern CC int z[] BD; // warn error error
+
+ AD extern CC int z[]; // warn
+ extern CC AD int z[];
+ extern CC int AD z[];
+ extern CC int z2 AD []; // error error error error
+ extern CC int z[] AD;
+ ======================================================================
+
+ * For non-array variables, the only good position is after the variable
name,
+ that is, at the end of the declaration.
+ * For array variables, you will need to distinguish C and C++:
+ - In C, before the 'extern' keyword.
+ - In C++, between the 'extern "C"' and the variable's type.
+ */
]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
[
/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the
function
@@ -141,7 +353,7 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
by the Nth argument of the function is the size of the returned memory
block.
*/
-/* Applies to: function, pointer to function, function types. */
+/* Applies to: functions, pointer to functions, function types. */
#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
# if _GL_HAS_ATTRIBUTE (alloc_size)
# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
@@ -152,7 +364,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
function and report an error if it cannot do so. */
-/* Applies to: function. */
+/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
# if _GL_HAS_ATTRIBUTE (always_inline)
# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
@@ -164,7 +376,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
in stack traces when debugging. The compiler should omit the function from
stack traces. */
-/* Applies to: function. */
+/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_ARTIFICIAL
# if _GL_HAS_ATTRIBUTE (artificial)
# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
@@ -190,18 +402,23 @@ AC_DEFUN([gl_COMMON_BODY], [
# endif
#endif
-/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
- calls to the function with the same arguments.
- This attribute is safe for a function that neither depends on nor affects
- observable state, and always returns exactly once - e.g., does not loop
- forever, and does not call longjmp.
- (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
+/* _GL_ATTRIBUTE_CONST declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used.
+ This attribute is safe for a function that neither depends on
+ nor affects state, and always returns exactly once -
+ e.g., does not raise an exception, call longjmp, or loop forever.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE because the
+ function cannot observe state. It is stricter than
+ _GL_ATTRIBUTE_UNSEQUENCED because the function must return exactly
+ once and cannot depend on state addressed by its arguments.) */
/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_CONST
# if _GL_HAS_ATTRIBUTE (const)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
# else
-# define _GL_ATTRIBUTE_CONST
+# define _GL_ATTRIBUTE_CONST _GL_ATTRIBUTE_UNSEQUENCED
# endif
#endif
@@ -242,7 +459,7 @@ AC_DEFUN([gl_COMMON_BODY], [
in C++ also: namespace, class, template specialization. */
#ifndef _GL_ATTRIBUTE_DEPRECATED
# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
-# ifdef __has_c_attribute
+# if _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__deprecated__)
# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
# endif
@@ -291,7 +508,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Applies to: Empty statement (;), inside a 'switch' statement. */
/* Always expands to something. */
#ifndef _GL_ATTRIBUTE_FALLTHROUGH
-# ifdef __has_c_attribute
+# if _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__fallthrough__)
# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
# endif
@@ -380,7 +597,7 @@ AC_DEFUN([gl_COMMON_BODY], [
# if !defined __apple_build_version__ && __clang_major__ >= 10
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
-# elif defined __has_c_attribute
+# elif _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__maybe_unused__)
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
@@ -411,7 +628,7 @@ AC_DEFUN([gl_COMMON_BODY], [
# if __clang_major__ >= 1000
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif
-# elif defined __has_c_attribute
+# elif _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__nodiscard__)
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif
@@ -470,7 +687,7 @@ AC_DEFUN([gl_COMMON_BODY], [
other attributes. */
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4
+# if _GL_GNUC_PREREQ (2, 8) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -495,25 +712,58 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Applies to: struct members, struct, union,
in C++ also: class. */
#ifndef _GL_ATTRIBUTE_PACKED
-# if _GL_HAS_ATTRIBUTE (packed)
+/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__))
despite
+ __has_attribute OK. */
+# if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C
# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
# else
# define _GL_ATTRIBUTE_PACKED
# endif
#endif
-/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
- calls to the function with the same arguments if observable state is not
- changed between calls.
- This attribute is safe for a function that does not affect
- observable state, and always returns exactly once.
- (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
+/* _GL_ATTRIBUTE_PURE declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used, and if observable state is the same.
+ This attribute is safe for a function that does not affect observable state
+ and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST because the function
+ can depend on observable state. It is stricter than
+ _GL_ATTRIBUTE_REPRODUCIBLE because the function must return exactly
+ once and cannot affect state addressed by its arguments.) */
/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_PURE
# if _GL_HAS_ATTRIBUTE (pure)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define _GL_ATTRIBUTE_PURE
+# define _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_REPRODUCIBLE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_REPRODUCIBLE declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same and is updated in time for
+ the rest of the program.
+ This attribute is safe for a function that is effectless and idempotent; see
+ ISO C 23 § 6.7.12.7 for a definition of these terms.
+ (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because
+ the function need not be stateless and idempotent. It is looser
+ than _GL_ATTRIBUTE_PURE because the function need not return
+ exactly once and can affect state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+/* This may be revisited when gcc and clang support [[reproducible]] or
possibly
+ __attribute__ ((__reproducible__)). */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if _GL_HAS_ATTRIBUTE (reproducible)
+# define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+# define _GL_ATTRIBUTE_REPRODUCIBLE
# endif
#endif
@@ -541,6 +791,33 @@ AC_DEFUN([gl_COMMON_BODY], [
# endif
#endif
+/* _GL_ATTRIBUTE_UNSEQUENCED declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same.
+ This attribute is safe for a function that is effectless, idempotent,
+ stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of
+ these terms.
+ (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because
+ the function must be stateless and independent. It is looser than
+ _GL_ATTRIBUTE_CONST because the function need not return exactly
+ once and can depend on state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_UNSEQUENCED
+/* This may be revisited when gcc and clang support [[unsequenced]] or possibly
+ __attribute__ ((__unsequenced__)). */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if _GL_HAS_ATTRIBUTE (unsequenced)
+# define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_UNSEQUENCED
+# define _GL_ATTRIBUTE_UNSEQUENCED
+# endif
+#endif
+
/* A helper macro. Don't use it directly. */
#ifndef _GL_ATTRIBUTE_UNUSED
# if _GL_HAS_ATTRIBUTE (unused)
@@ -1070,6 +1347,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
dnl -Wno-pedantic >= 4.8 >= 3.9
dnl -Wno-sign-compare >= 3 >= 3.9
dnl -Wno-sign-conversion >= 4.3 >= 3.9
+ dnl -Wno-tautological-out-of-range-compare - >= 3.9
dnl -Wno-type-limits >= 4.3 >= 3.9
dnl -Wno-undef >= 3 >= 3.9
dnl -Wno-unsuffixed-float-constants >= 4.5
@@ -1077,7 +1355,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
dnl -Wno-unused-parameter >= 3 >= 3.9
dnl
cat > conftest.c <<\EOF
- #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ >= 3 && !defined __clang__) || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
-Wno-cast-qual
-Wno-conversion
-Wno-float-equal
@@ -1086,20 +1364,23 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
-Wno-unused-function
-Wno-unused-parameter
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-float-conversion
#endif
- #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ >= 7 && !defined __clang__) || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
-Wimplicit-fallthrough
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-pedantic
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if 3 < __clang_major__ + (9 <= __clang_minor__)
+ -Wno-tautological-constant-out-of-range-compare
+ #endif
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-sign-conversion
-Wno-type-limits
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__)
-Wno-unsuffixed-float-constants
#endif
EOF
@@ -1158,12 +1439,12 @@ AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS],
if test $gl_cv_compiler_clang = yes; then
dnl Test whether the compiler supports the option
dnl '-Werror=unguarded-availability-new'.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile -Werror=unguarded-availability-new"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'],
[gl_cv_compiler_check_future_option=none])
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
else
gl_cv_compiler_check_future_option=none
fi
@@ -1211,14 +1492,14 @@ AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS],
darwin*)
if test "x$gl_cv_compiler_check_future_option" != "xnone"; then
dnl Use a compile test, not a link test.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile $gl_cv_compiler_check_future_option"
- save_ac_compile_for_check_decl="$ac_compile_for_check_decl"
+ saved_ac_compile_for_check_decl="$ac_compile_for_check_decl"
ac_compile_for_check_decl="$ac_compile_for_check_decl
$gl_cv_compiler_check_future_option"
unset [ac_cv_have_decl_][$1]
AC_CHECK_DECL([$1], , , [$2])
- ac_compile="$save_ac_compile"
- ac_compile_for_check_decl="$save_ac_compile_for_check_decl"
+ ac_compile="$saved_ac_compile"
+ ac_compile_for_check_decl="$saved_ac_compile_for_check_decl"
[ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]"
if test $[ac_cv_func_][$1] = yes; then
[gl_cv_onwards_func_][$1]=yes
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 50234dca55..63e07661eb 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -79,6 +79,10 @@ AC_DEFUN([gl_EARLY],
# Code from module error-h:
# Code from module exitfail:
# Code from module extensions:
+ # This is actually already done in the pre-early phase.
+ # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ # Code from module extensions-aix:
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
# Code from module extern-inline:
# Code from module fcntl:
# Code from module fcntl-h:
@@ -147,13 +151,19 @@ AC_DEFUN([gl_EARLY],
# Code from module multiarch:
# Code from module nl_langinfo:
# Code from module nocrash:
+ # Code from module once:
# Code from module open:
# Code from module pathmax:
+ # Code from module pthread-h:
+ gl_ANYTHREADLIB_EARLY
+ # Code from module pthread-once:
# Code from module realloc-gnu:
# Code from module realloc-posix:
# Code from module reallocarray:
# Code from module regex:
+ # Code from module sched:
# Code from module setlocale-null:
+ # Code from module setlocale-null-unlocked:
# Code from module size_max:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
@@ -192,6 +202,7 @@ AC_DEFUN([gl_EARLY],
# Code from module sys_random:
# Code from module sys_stat:
# Code from module sys_types:
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
# Code from module tempname:
# Code from module threadlib:
gl_THREADLIB_EARLY
@@ -271,84 +282,98 @@ AC_DEFUN([gl_INIT],
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isalnum])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isalpha])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isblank])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32iscntrl])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isdigit])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isgraph])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32islower])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isprint])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32ispunct])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isspace])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isupper])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32isxdigit])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32tolower])
AC_REQUIRE([gl_UCHAR_H])
dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is
dnl determined. It describes how mbrtoc32 is implemented.
AC_REQUIRE([gl_MBSTATE_T_BROKEN])
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
gl_UCHAR_MODULE_INDICATOR([c32width])
gl_FUNC_CALLOC_GNU
if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
@@ -624,9 +649,9 @@ AC_DEFUN([gl_INIT],
gl_UNICTYPE_H_REQUIRE_DEFAULTS
AC_PROG_MKDIR_P
AC_REQUIRE([AC_C_INLINE])
- gl_LIBUNISTRING_MODULE([1.1], [unictype/ctype-alnum])
+ gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-alnum])
AC_REQUIRE([AC_C_INLINE])
- gl_LIBUNISTRING_MODULE([1.1], [unictype/ctype-alpha])
+ gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-alpha])
AC_REQUIRE([AC_C_INLINE])
gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-blank])
AC_REQUIRE([AC_C_INLINE])
@@ -634,13 +659,13 @@ AC_DEFUN([gl_INIT],
AC_REQUIRE([AC_C_INLINE])
gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-digit])
AC_REQUIRE([AC_C_INLINE])
- gl_LIBUNISTRING_MODULE([1.1], [unictype/ctype-graph])
+ gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-graph])
AC_REQUIRE([AC_C_INLINE])
gl_LIBUNISTRING_MODULE([0.9.11], [unictype/ctype-lower])
AC_REQUIRE([AC_C_INLINE])
- gl_LIBUNISTRING_MODULE([1.1], [unictype/ctype-print])
+ gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-print])
AC_REQUIRE([AC_C_INLINE])
- gl_LIBUNISTRING_MODULE([1.1], [unictype/ctype-punct])
+ gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-punct])
AC_REQUIRE([AC_C_INLINE])
gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-space])
AC_REQUIRE([AC_C_INLINE])
@@ -673,7 +698,7 @@ AC_DEFUN([gl_INIT],
])
gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h])
AC_PROG_MKDIR_P
- gl_LIBUNISTRING_MODULE([1.1], [uniwidth/width])
+ gl_LIBUNISTRING_MODULE([1.2], [uniwidth/width])
AC_C_VARARRAYS
gl_FUNC_VASPRINTF
gl_STDIO_MODULE_INDICATOR([vasprintf])
@@ -734,9 +759,14 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616=false
gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07=false
gl_gnulib_enabled_nl_langinfo=false
+ gl_gnulib_enabled_once=false
gl_gnulib_enabled_open=false
gl_gnulib_enabled_pathmax=false
+ gl_gnulib_enabled_94ea50e7ff7c2508f8a5894b17b1211c=false
+ gl_gnulib_enabled_e0dc424e76447be3f4b8566d84038f5a=false
+ gl_gnulib_enabled_sched=false
gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd=false
+ gl_gnulib_enabled_e7ab648fbf42deb155fb024e2402e26d=false
gl_gnulib_enabled_size_max=false
gl_gnulib_enabled_stat=false
gl_gnulib_enabled_0137e3d3638b33e5819d132d0b23165c=false
@@ -821,6 +851,7 @@ AC_DEFUN([gl_INIT],
gl_FUNC_CLOSE
gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1])
gl_UNISTD_MODULE_INDICATOR([close])
+ gl_MODULE_INDICATOR([close])
gl_gnulib_enabled_close=true
if test $REPLACE_CLOSE = 1; then
func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239
@@ -923,8 +954,11 @@ AC_DEFUN([gl_INIT],
gl_FLOAT_H
gl_CONDITIONAL_HEADER([float.h])
AC_PROG_MKDIR_P
- gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_FLOAT],
+ [test $REPLACE_FLOAT_LDBL = 1 || test $REPLACE_FLOAT_SNAN
= 1])
gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1])
+ dnl Prerequisites of lib/float.c.
+ AC_REQUIRE([gl_BIGENDIAN])
gl_gnulib_enabled_float=true
fi
}
@@ -954,6 +988,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_FSTAT
])
gl_SYS_STAT_MODULE_INDICATOR([fstat])
+ gl_MODULE_INDICATOR([fstat])
gl_gnulib_enabled_fstat=true
if test $REPLACE_FSTAT = 1; then
func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07
@@ -1086,6 +1121,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_LOCALECONV
])
gl_LOCALE_MODULE_INDICATOR([localeconv])
+ gl_MODULE_INDICATOR([localeconv])
gl_gnulib_enabled_localeconv=true
func_gl_gnulib_m4code_locale
fi
@@ -1096,13 +1132,11 @@ AC_DEFUN([gl_INIT],
gl_LOCK
gl_MODULE_INDICATOR([lock])
gl_gnulib_enabled_lock=true
+ func_gl_gnulib_m4code_once
func_gl_gnulib_m4code_threadlib
if test $gl_threads_api = windows; then
func_gl_gnulib_m4code_503a4cb75d69c787103d0aa2ab7d8440
fi
- if test $gl_threads_api = windows; then
- func_gl_gnulib_m4code_68a4501daeca58988392c7e60b4917ab
- fi
if test $gl_threads_api = windows; then
func_gl_gnulib_m4code_f0efff84a70f4afba30902bb8ffe9354
fi
@@ -1120,6 +1154,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_LSTAT
])
gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ gl_MODULE_INDICATOR([lstat])
gl_gnulib_enabled_lstat=true
if test $REPLACE_LSTAT = 1; then
func_gl_gnulib_m4code_stat
@@ -1244,6 +1279,20 @@ AC_DEFUN([gl_INIT],
fi
fi
}
+ func_gl_gnulib_m4code_once ()
+ {
+ if $gl_gnulib_enabled_once; then :; else
+ gl_ONCE
+ gl_gnulib_enabled_once=true
+ if test $gl_threads_api = posix; then
+ func_gl_gnulib_m4code_e0dc424e76447be3f4b8566d84038f5a
+ fi
+ func_gl_gnulib_m4code_threadlib
+ if test $gl_threads_api = windows; then
+ func_gl_gnulib_m4code_68a4501daeca58988392c7e60b4917ab
+ fi
+ fi
+ }
func_gl_gnulib_m4code_open ()
{
if $gl_gnulib_enabled_open; then :; else
@@ -1273,6 +1322,40 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_pathmax=true
fi
}
+ func_gl_gnulib_m4code_94ea50e7ff7c2508f8a5894b17b1211c ()
+ {
+ if $gl_gnulib_enabled_94ea50e7ff7c2508f8a5894b17b1211c; then :; else
+ gl_PTHREAD_H
+ gl_PTHREAD_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_gnulib_enabled_94ea50e7ff7c2508f8a5894b17b1211c=true
+ func_gl_gnulib_m4code_sched
+ func_gl_gnulib_m4code_cb7562e84d8cf7185af782fe497b53dd
+ fi
+ }
+ func_gl_gnulib_m4code_e0dc424e76447be3f4b8566d84038f5a ()
+ {
+ if $gl_gnulib_enabled_e0dc424e76447be3f4b8566d84038f5a; then :; else
+ gl_PTHREAD_ONCE
+ gl_CONDITIONAL([GL_COND_OBJ_PTHREAD_ONCE],
+ [test $HAVE_PTHREAD_ONCE = 0 || test
$REPLACE_PTHREAD_ONCE = 1])
+ gl_PTHREAD_MODULE_INDICATOR([pthread-once])
+ gl_gnulib_enabled_e0dc424e76447be3f4b8566d84038f5a=true
+ func_gl_gnulib_m4code_94ea50e7ff7c2508f8a5894b17b1211c
+ if test $gl_threads_api = windows; then
+ func_gl_gnulib_m4code_68a4501daeca58988392c7e60b4917ab
+ fi
+ fi
+ }
+ func_gl_gnulib_m4code_sched ()
+ {
+ if $gl_gnulib_enabled_sched; then :; else
+ gl_SCHED_H
+ gl_SCHED_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_gnulib_enabled_sched=true
+ fi
+ }
func_gl_gnulib_m4code_e7e881d32ca02f1c997b13c737c64bbd ()
{
if $gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd; then :; else
@@ -1285,6 +1368,14 @@ AC_DEFUN([gl_INIT],
gl_LOCALE_MODULE_INDICATOR([setlocale_null])
gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd=true
func_gl_gnulib_m4code_locale
+ func_gl_gnulib_m4code_e7ab648fbf42deb155fb024e2402e26d
+ fi
+ }
+ func_gl_gnulib_m4code_e7ab648fbf42deb155fb024e2402e26d ()
+ {
+ if $gl_gnulib_enabled_e7ab648fbf42deb155fb024e2402e26d; then :; else
+ gl_gnulib_enabled_e7ab648fbf42deb155fb024e2402e26d=true
+ func_gl_gnulib_m4code_locale
fi
}
func_gl_gnulib_m4code_size_max ()
@@ -1308,6 +1399,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_STAT
])
gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_MODULE_INDICATOR([stat])
gl_gnulib_enabled_stat=true
if test $REPLACE_STAT = 1; then
func_gl_gnulib_m4code_filename
@@ -1716,9 +1808,14 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_f691f076f650964c9f5598c3ee487616],
[$gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616])
AM_CONDITIONAL([gl_GNULIB_ENABLED_676220fa4366efa9bdbfccf11a857c07],
[$gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07])
AM_CONDITIONAL([gl_GNULIB_ENABLED_nl_langinfo],
[$gl_gnulib_enabled_nl_langinfo])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_once], [$gl_gnulib_enabled_once])
AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_94ea50e7ff7c2508f8a5894b17b1211c],
[$gl_gnulib_enabled_94ea50e7ff7c2508f8a5894b17b1211c])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_e0dc424e76447be3f4b8566d84038f5a],
[$gl_gnulib_enabled_e0dc424e76447be3f4b8566d84038f5a])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_sched], [$gl_gnulib_enabled_sched])
AM_CONDITIONAL([gl_GNULIB_ENABLED_e7e881d32ca02f1c997b13c737c64bbd],
[$gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_e7ab648fbf42deb155fb024e2402e26d],
[$gl_gnulib_enabled_e7ab648fbf42deb155fb024e2402e26d])
AM_CONDITIONAL([gl_GNULIB_ENABLED_size_max], [$gl_gnulib_enabled_size_max])
AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
AM_CONDITIONAL([gl_GNULIB_ENABLED_0137e3d3638b33e5819d132d0b23165c],
[$gl_gnulib_enabled_0137e3d3638b33e5819d132d0b23165c])
@@ -1984,6 +2081,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/gettext.h
lib/glthread/lock.c
lib/glthread/lock.h
+ lib/glthread/once.c
+ lib/glthread/once.h
lib/glthread/threadlib.c
lib/hard-locale.c
lib/hard-locale.h
@@ -2064,6 +2163,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/printf-args.h
lib/printf-parse.c
lib/printf-parse.h
+ lib/pthread-once.c
+ lib/pthread.in.h
lib/realloc.c
lib/reallocarray.c
lib/regcomp.c
@@ -2072,7 +2173,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/regex_internal.c
lib/regex_internal.h
lib/regexec.c
+ lib/sched.in.h
lib/setlocale-lock.c
+ lib/setlocale_null-unlocked.c
lib/setlocale_null.c
lib/setlocale_null.h
lib/size_max.h
@@ -2190,6 +2293,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/btowc.m4
m4/builtin-expect.m4
m4/c-bool.m4
+ m4/c32rtomb.m4
m4/calloc.m4
m4/clock_time.m4
m4/close.m4
@@ -2201,6 +2305,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/error.m4
m4/error_h.m4
m4/exponentd.m4
+ m4/extensions-aix.m4
m4/extensions.m4
m4/extern-inline.m4
m4/fcntl-o.m4
@@ -2266,17 +2371,23 @@ AC_DEFUN([gl_FILE_LIST], [
m4/musl.m4
m4/nl_langinfo.m4
m4/nocrash.m4
+ m4/off64_t.m4
m4/off_t.m4
+ m4/once.m4
m4/open-cloexec.m4
m4/open-slash.m4
m4/open.m4
m4/pathmax.m4
m4/pid_t.m4
m4/printf.m4
+ m4/pthread-once.m4
+ m4/pthread-spin.m4
+ m4/pthread_h.m4
m4/pthread_rwlock_rdlock.m4
m4/realloc.m4
m4/reallocarray.m4
m4/regex.m4
+ m4/sched_h.m4
m4/setlocale_null.m4
m4/size_max.m4
m4/ssize_t.m4
@@ -2300,6 +2411,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/strndup.m4
m4/strnlen.m4
m4/strstr.m4
+ m4/sys_cdefs_h.m4
m4/sys_random_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
@@ -2318,7 +2430,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/visibility.m4
m4/warn-on-use.m4
m4/wchar_h.m4
- m4/wchar_t.m4
m4/wcrtomb.m4
m4/wctype.m4
m4/wctype_h.m4
diff --git a/gnulib/m4/gnulib-tool.m4 b/gnulib/m4/gnulib-tool.m4
index a9dd569bdb..2f517f1bbc 100644
--- a/gnulib/m4/gnulib-tool.m4
+++ b/gnulib/m4/gnulib-tool.m4
@@ -1,5 +1,6 @@
-# gnulib-tool.m4 serial 4
-dnl Copyright (C) 2004-2005, 2009-2023 Free Software Foundation, Inc.
+# gnulib-tool.m4
+# serial 5
+dnl Copyright (C) 2004-2005, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -41,6 +42,9 @@ AC_DEFUN([gl_LIB], [])
dnl Usage: gl_LGPL or gl_LGPL([VERSION])
AC_DEFUN([gl_LGPL], [])
+dnl Usage: gl_GPL([VERSION])
+AC_DEFUN([gl_GPL], [])
+
dnl Usage: gl_MAKEFILE_NAME([FILENAME])
AC_DEFUN([gl_MAKEFILE_NAME], [])
diff --git a/gnulib/m4/host-cpu-c-abi.m4 b/gnulib/m4/host-cpu-c-abi.m4
index 134f228341..80a8366855 100644
--- a/gnulib/m4/host-cpu-c-abi.m4
+++ b/gnulib/m4/host-cpu-c-abi.m4
@@ -1,5 +1,6 @@
-# host-cpu-c-abi.m4 serial 15
-dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# host-cpu-c-abi.m4
+# serial 18
+dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -35,7 +36,7 @@ dnl * The same canonical name is used for different
endiannesses. You can
dnl determine the endianness through preprocessor symbols:
dnl - 'arm': test __ARMEL__.
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
-dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__.
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
@@ -461,217 +462,66 @@ EOF
dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
-dnl one, or to 'unknown' if unknown.
+dnl one.
dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
- [if test -n "$gl_cv_host_cpu_c_abi"; then
- case "$gl_cv_host_cpu_c_abi" in
- i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 |
mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
- gl_cv_host_cpu_c_abi_32bit=yes ;;
- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 |
powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
- gl_cv_host_cpu_c_abi_32bit=no ;;
- *)
- gl_cv_host_cpu_c_abi_32bit=unknown ;;
- esac
- else
- case "$host_cpu" in
-
- # CPUs that only support a 32-bit ABI.
- arc \
- | bfin \
- | cris* \
- | csky \
- | epiphany \
- | ft32 \
- | h8300 \
- | m68k \
- | microblaze | microblazeel \
- | nds32 | nds32le | nds32be \
- | nios2 | nios2eb | nios2el \
- | or1k* \
- | or32 \
- | sh | sh[1234] | sh[1234]e[lb] \
- | tic6x \
- | xtensa* )
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
+ [case "$host_cpu" in
- # CPUs that only support a 64-bit ABI.
-changequote(,)dnl
- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
- | mmix )
-changequote([,])dnl
- gl_cv_host_cpu_c_abi_32bit=no
- ;;
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+ # CPUs that only support a 64-bit ABI.
changequote(,)dnl
- i[34567]86 )
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
changequote([,])dnl
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
-
- x86_64 )
- # On x86_64 systems, the C compiler may be generating code in one of
- # these ABIs:
- # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
- # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
- # with native Windows (mingw, MSVC).
- # - 64-bit instruction set, 32-bit pointers, 32-bit 'long':
x86_64-x32.
- # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if (defined __x86_64__ || defined __amd64__ \
- || defined _M_X64 || defined _M_AMD64) \
- && !(defined __ILP32__ || defined _ILP32)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- arm* | aarch64 )
- # Assume arm with EABI.
- # On arm64 systems, the C compiler may be generating code in one of
- # these ABIs:
- # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
- # - aarch64 instruction set, 32-bit pointers, 32-bit 'long':
arm64-ilp32.
- # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or
armhf.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __aarch64__ && !(defined __ILP32__ || defined
_ILP32)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
- # On hppa, the C compiler may be generating 32-bit code or 64-bit
- # code. In the latter case, it defines _LP64 and __LP64__.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- ia64* )
- # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
- # 32-bit code. In the latter case, it defines _ILP32.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef _ILP32
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=yes],
- [gl_cv_host_cpu_c_abi_32bit=no])
- ;;
-
- mips* )
- # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
- # at 32.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- powerpc* )
- # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
- # No need to distinguish them here; the caller may distinguish
- # them based on the OS.
- # On powerpc64 systems, the C compiler may still be generating
- # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
- # be generating 64-bit code.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- rs6000 )
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
-
- riscv32 | riscv64 )
- # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
- # Size of 'long' and 'void *':
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- s390* )
- # On s390x, the C compiler may be generating 64-bit (= s390x) code
- # or 31-bit (= s390) code.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__ || defined __s390x__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
- sparc | sparc64 )
- # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
- # C compiler still generates 32-bit code.
+ *)
+ if test -n "$gl_cv_host_cpu_c_abi"; then
+ dnl gl_HOST_CPU_C_ABI has already been run. Use its result.
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32
| mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 |
powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ fi
+ if test $gl_cv_host_cpu_c_abi_32bit = unknown; then
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __sparcv9 || defined __arch64__
- int ok;
- #else
- error fail
- #endif
+ [[int test_pointer_size[sizeof (void *) - 5];
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- *)
- gl_cv_host_cpu_c_abi_32bit=unknown
- ;;
- esac
- fi
+ fi
+ ;;
+ esac
])
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
diff --git a/gnulib/m4/iconv.m4 b/gnulib/m4/iconv.m4
index ff5d526113..b414bfca62 100644
--- a/gnulib/m4/iconv.m4
+++ b/gnulib/m4/iconv.m4
@@ -1,5 +1,6 @@
-# iconv.m4 serial 26
-dnl Copyright (C) 2000-2002, 2007-2014, 2016-2023 Free Software Foundation,
+# iconv.m4
+# serial 28
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -38,7 +39,7 @@ AC_DEFUN([AM_ICONV_LINK],
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
- am_save_CPPFLAGS="$CPPFLAGS"
+ gl_saved_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
@@ -55,7 +56,7 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close(cd);]])],
[am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
- am_save_LIBS="$LIBS"
+ gl_saved_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
@@ -68,14 +69,14 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close(cd);]])],
[am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes])
- LIBS="$am_save_LIBS"
+ LIBS="$gl_saved_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
- dnl Solaris 10.
- am_save_LIBS="$LIBS"
+ dnl Solaris 10, macOS 14.4.
+ gl_saved_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
@@ -113,6 +114,35 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close (cd_utf8_to_88591);
}
}
+ /* Test against macOS 14.4 bug: Failures are not distinguishable from
+ successful returns.
+ POSIX:2018 says: "The iconv() function shall ... return the number of
+ non-identical conversions performed."
+ But here, the conversion always does transliteration (the suffixes
+ "//TRANSLIT" and "//IGNORE" have no effect, nor does iconvctl()) and
+ does not report when it does a non-identical conversion. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\305\202"; /* LATIN SMALL LETTER L
WITH STROKE */
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ /* Here:
+ With glibc, GNU libiconv (including macOS up to 13): res ==
(size_t)-1, errno == EILSEQ.
+ With musl libc, NetBSD 10, Solaris 11: res == 1.
+ With macOS 14.4: res == 0, output is "l". */
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
/* Test against Solaris 10 bug: Failures are not distinguishable from
successful returns. */
{
@@ -129,7 +159,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- result |= 2;
+ result |= 4;
iconv_close (cd_ascii_to_88591);
}
}
@@ -148,7 +178,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
- result |= 4;
+ result |= 8;
iconv_close (cd_88591_to_utf8);
}
}
@@ -168,7 +198,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
- result |= 8;
+ result |= 16;
iconv_close (cd_88591_to_utf8);
}
}
@@ -186,7 +216,7 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_t cd4 = iconv_open ("utf8", "eucJP");
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
- result |= 16;
+ result |= 32;
if (cd1 != (iconv_t)(-1))
iconv_close (cd1);
if (cd2 != (iconv_t)(-1))
@@ -205,7 +235,7 @@ AC_DEFUN([AM_ICONV_LINK],
esac])
test "$am_cv_func_iconv_works" = no || break
done
- LIBS="$am_save_LIBS"
+ LIBS="$gl_saved_LIBS"
])
case "$am_cv_func_iconv_works" in
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
@@ -224,7 +254,7 @@ AC_DEFUN([AM_ICONV_LINK],
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
- CPPFLAGS="$am_save_CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
diff --git a/gnulib/m4/include_next.m4 b/gnulib/m4/include_next.m4
index 9f19215ef0..03e852518e 100644
--- a/gnulib/m4/include_next.m4
+++ b/gnulib/m4/include_next.m4
@@ -1,5 +1,6 @@
-# include_next.m4 serial 26
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# include_next.m4
+# serial 27
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -74,17 +75,17 @@ EOF
#endif
#define DEFINED_IN_CONFTESTD2
EOF
- gl_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+ gl_saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2"
dnl We intentionally avoid using AC_LANG_SOURCE here.
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=yes],
- [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2"
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=buggy],
[gl_cv_have_include_next=no])
])
- CPPFLAGS="$gl_save_CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS"
rm -rf conftestd1a conftestd1b conftestd2
])
PRAGMA_SYSTEM_HEADER=
diff --git a/gnulib/m4/intmax_t.m4 b/gnulib/m4/intmax_t.m4
index ef32e1b9ca..72858ea86c 100644
--- a/gnulib/m4/intmax_t.m4
+++ b/gnulib/m4/intmax_t.m4
@@ -1,5 +1,6 @@
-# intmax_t.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# intmax_t.m4
+# serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/inttypes.m4 b/gnulib/m4/inttypes.m4
index e7efbe9416..c43cd16207 100644
--- a/gnulib/m4/inttypes.m4
+++ b/gnulib/m4/inttypes.m4
@@ -1,5 +1,6 @@
-# inttypes.m4 serial 37
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# inttypes.m4
+# serial 37
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/inttypes_h.m4 b/gnulib/m4/inttypes_h.m4
index 68c60e9dbb..3b9da5b0ac 100644
--- a/gnulib/m4/inttypes_h.m4
+++ b/gnulib/m4/inttypes_h.m4
@@ -1,5 +1,6 @@
-# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# inttypes_h.m4
+# serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/iswblank.m4 b/gnulib/m4/iswblank.m4
index b1220b1e93..4dc12d9adf 100644
--- a/gnulib/m4/iswblank.m4
+++ b/gnulib/m4/iswblank.m4
@@ -1,5 +1,6 @@
-# iswblank.m4 serial 7
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# iswblank.m4
+# serial 7
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/iswctype.m4 b/gnulib/m4/iswctype.m4
index 5dedaa365a..16031be475 100644
--- a/gnulib/m4/iswctype.m4
+++ b/gnulib/m4/iswctype.m4
@@ -1,5 +1,6 @@
-# iswctype.m4 serial 3
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# iswctype.m4
+# serial 3
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/iswdigit.m4 b/gnulib/m4/iswdigit.m4
index b0572819ce..999acd2891 100644
--- a/gnulib/m4/iswdigit.m4
+++ b/gnulib/m4/iswdigit.m4
@@ -1,5 +1,6 @@
-# iswdigit.m4 serial 5
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# iswdigit.m4
+# serial 7
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,6 +13,7 @@ AC_DEFUN([gl_FUNC_ISWDIGIT],
AC_REQUIRE([gt_LOCALE_JA])
AC_REQUIRE([gt_LOCALE_FR_UTF8])
AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
dnl <wctype.h> redefines iswdigit already.
@@ -75,7 +77,7 @@ main (int argc, char *argv[])
if (strcmp ("$LOCALE_JA", "none") != 0
&& setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
- /* This fails on NetBSD 8.0. */
+ /* This fails on NetBSD 10.0. */
/* U+FF11 FULLWIDTH DIGIT ONE */
is = for_character ("\243\261", 2);
if (!(is == 0))
@@ -84,12 +86,12 @@ main (int argc, char *argv[])
if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
&& setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
- /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14. */
+ /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14. */
/* U+0663 ARABIC-INDIC DIGIT THREE */
is = for_character ("\331\243", 2);
if (!(is == 0))
result |= 4;
- /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14. */
+ /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14. */
/* U+FF11 FULLWIDTH DIGIT ONE */
is = for_character ("\357\274\221", 3);
if (!(is == 0))
@@ -98,7 +100,7 @@ main (int argc, char *argv[])
if (strcmp ("$LOCALE_ZH_CN", "none") != 0
&& setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
- /* This fails on NetBSD 8.0, Solaris 10, Solaris 11.4. */
+ /* This fails on NetBSD 10.0, Solaris 10, Solaris 11.4. */
/* U+FF11 FULLWIDTH DIGIT ONE */
is = for_character ("\243\261", 2);
if (!(is == 0))
diff --git a/gnulib/m4/iswpunct.m4 b/gnulib/m4/iswpunct.m4
index 14691154cf..1edf58aa81 100644
--- a/gnulib/m4/iswpunct.m4
+++ b/gnulib/m4/iswpunct.m4
@@ -1,5 +1,6 @@
-# iswpunct.m4 serial 1
-dnl Copyright (C) 2023 Free Software Foundation, Inc.
+# iswpunct.m4
+# serial 2
+dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,6 +9,7 @@ AC_DEFUN([gl_FUNC_ISWPUNCT],
[
AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
AC_REQUIRE([gl_WCTYPE_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
dnl <wctype.h> redefines iswpunct already.
diff --git a/gnulib/m4/iswxdigit.m4 b/gnulib/m4/iswxdigit.m4
index 7321807bc6..6085bf6b01 100644
--- a/gnulib/m4/iswxdigit.m4
+++ b/gnulib/m4/iswxdigit.m4
@@ -1,5 +1,6 @@
-# iswxdigit.m4 serial 5
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# iswxdigit.m4
+# serial 7
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +12,7 @@ AC_DEFUN([gl_FUNC_ISWXDIGIT],
AC_REQUIRE([gt_LOCALE_JA])
AC_REQUIRE([gt_LOCALE_FR_UTF8])
AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
dnl <wctype.h> redefines iswxdigit already.
@@ -65,7 +67,7 @@ main (int argc, char *argv[])
if (strcmp ("$LOCALE_JA", "none") != 0
&& setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
- /* This fails on NetBSD 8.0. */
+ /* This fails on NetBSD 10.0. */
/* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
is = for_character ("\243\301", 2);
if (!(is == 0))
@@ -79,7 +81,7 @@ main (int argc, char *argv[])
is = for_character ("\331\243", 2);
if (!(is == 0))
result |= 2;
- /* This fails on MSVC 14. */
+ /* This fails on NetBSD 10.0, MSVC 14. */
/* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
is = for_character ("\357\274\241", 3);
if (!(is == 0))
diff --git a/gnulib/m4/langinfo_h.m4 b/gnulib/m4/langinfo_h.m4
index b17a526ab9..5eee8a71f6 100644
--- a/gnulib/m4/langinfo_h.m4
+++ b/gnulib/m4/langinfo_h.m4
@@ -1,5 +1,6 @@
-# langinfo_h.m4 serial 12
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# langinfo_h.m4
+# serial 12
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/largefile.m4 b/gnulib/m4/largefile.m4
index 7e65d72fea..2881348359 100644
--- a/gnulib/m4/largefile.m4
+++ b/gnulib/m4/largefile.m4
@@ -1,11 +1,13 @@
+# largefile.m4
+# serial 2
+dnl Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
# Enable large files on systems where this is not the default.
# Enable support for files on Linux file systems with 64-bit inode numbers.
-# Copyright 1992-1996, 1998-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
@@ -24,9 +26,20 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
]])
)
+dnl Remove AC_SYS_YEAR2038_RECOMMENDED if unpatched Autoconf 2.72 or earlier.
+dnl Autoconf 2.72 still uses -n32, which is not a C preprocessor option,
+dnl and which was useful only on IRIX which is no longer supported.
+dnl This should be fixed in Autoconf 2.73.
+m4_ifdef([AC_SYS_YEAR2038_RECOMMENDED],
+ [m4_bmatch(m4_ifdef([_AC_SYS_LARGEFILE_OPTIONS],
+ [m4_defn([_AC_SYS_LARGEFILE_OPTIONS])],
+ ["-n32"]),
+ ["-n32"],
+ [m4_undefine([AC_SYS_YEAR2038_RECOMMENDED])])])
+
m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [
-# Support AC_SYS_YEAR2038_RECOMMENDED and related macros, even if
-# Autoconf 2.71 or earlier. This code is taken from Autoconf master.
+# Fix up AC_SYS_YEAR2038_RECOMMENDED and related macros, even if
+# unpatched Autoconf 2.72 or earlier. This code is taken from Autoconf master.
# _AC_SYS_YEAR2038_TEST_CODE
# --------------------------
@@ -75,7 +88,7 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
# If you change this macro you may also need to change
# _AC_SYS_YEAR2038_OPTIONS.
AC_DEFUN([_AC_SYS_YEAR2038_PROBE],
-[AC_CACHE_CHECK([for $CC option for timestamps after 2038],
+[AC_CACHE_CHECK([for $CC option to support timestamps after 2038],
[ac_cv_sys_year2038_opts],
[ac_save_CPPFLAGS="$CPPFLAGS"
ac_opt_found=no
@@ -205,7 +218,6 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
["none needed"] dnl Most current systems
["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec
["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS
- ["-n32"] dnl 32-bit IRIX 6, SGI cc (obsolete)
))
# _AC_SYS_LARGEFILE_PROBE
@@ -222,25 +234,25 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
# If you change this macro you may also need to change
# _AC_SYS_LARGEFILE_OPTIONS.
AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
-[AC_CACHE_CHECK([for $CC option to enable large file support],
+[AC_CACHE_CHECK([for $CC option to support large files],
[ac_cv_sys_largefile_opts],
- [ac_save_CC="$CC"
+ [ac_save_CPPFLAGS=$CPPFLAGS
ac_opt_found=no
for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do
AS_IF([test x"$ac_opt" != x"none needed"],
- [CC="$ac_save_CC $ac_opt"])
+ [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
[AS_IF([test x"$ac_opt" = x"none needed"],
[# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
- CC="$CC -DFTYPE=ino_t"
+ CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t"
AC_COMPILE_IFELSE([], [],
- [CC="$CC -D_FILE_OFFSET_BITS=64"
+ [CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])])
ac_cv_sys_largefile_opts=$ac_opt
ac_opt_found=yes])
test $ac_opt_found = no || break
done
- CC="$ac_save_CC"
+ CPPFLAGS=$ac_save_CPPFLAGS
dnl Gnulib implements large file support for native Windows, based on the
dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE.
m4_ifdef([gl_LARGEFILE], [
@@ -270,9 +282,6 @@ AS_CASE([$ac_cv_sys_largefile_opts],
[AC_DEFINE([_LARGE_FILES], [1],
[Define to 1 on platforms where this makes off_t a 64-bit type.])],
- ["-n32"],
- [CC="$CC -n32"],
-
[AC_MSG_ERROR(
[internal error: bad value for \$ac_cv_sys_largefile_opts])])
diff --git a/gnulib/m4/lib-ld.m4 b/gnulib/m4/lib-ld.m4
index 70ca4a2e1d..5da3eecfc6 100644
--- a/gnulib/m4/lib-ld.m4
+++ b/gnulib/m4/lib-ld.m4
@@ -1,5 +1,6 @@
-# lib-ld.m4 serial 12
-dnl Copyright (C) 1996-2003, 2009-2023 Free Software Foundation, Inc.
+# lib-ld.m4
+# serial 13
+dnl Copyright (C) 1996-2003, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -97,9 +98,9 @@ else
fi
if test -n "$ac_prog"; then
# Search for $ac_prog in $PATH.
- acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$acl_save_ifs"
+ IFS="$acl_saved_IFS"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext";
then
acl_cv_path_LD="$ac_dir/$ac_prog"
@@ -116,7 +117,7 @@ else
esac
fi
done
- IFS="$acl_save_ifs"
+ IFS="$acl_saved_IFS"
fi
case $host in
*-*-aix*)
diff --git a/gnulib/m4/lib-link.m4 b/gnulib/m4/lib-link.m4
index 5f8afae61a..fb764d3229 100644
--- a/gnulib/m4/lib-link.m4
+++ b/gnulib/m4/lib-link.m4
@@ -1,5 +1,6 @@
-# lib-link.m4 serial 33
-dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# lib-link.m4
+# serial 34
+dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -69,11 +70,11 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
dnl because if the user has installed lib[]Name and not disabled its use
dnl via --without-lib[]Name-prefix, he wants to use it.
- ac_save_CPPFLAGS="$CPPFLAGS"
+ acl_saved_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
- ac_save_LIBS="$LIBS"
+ acl_saved_LIBS="$LIBS"
dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
dnl because these -l options might require -L options that are present in
dnl LIBS. -l options benefit only from the -L options listed before it.
@@ -89,7 +90,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[AC_LANG_PROGRAM([[$3]], [[$4]])],
[ac_cv_lib[]Name=yes],
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
- LIBS="$ac_save_LIBS"
+ LIBS="$acl_saved_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
@@ -100,7 +101,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
HAVE_LIB[]NAME=no
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
dnl $INC[]NAME either.
- CPPFLAGS="$ac_save_CPPFLAGS"
+ CPPFLAGS="$acl_saved_CPPFLAGS"
LIB[]NAME=
LTLIB[]NAME=
LIB[]NAME[]_PREFIX=
@@ -537,12 +538,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Read the .la file. It defines the variables
dnl dlname, library_names, old_library, dependency_libs, current,
dnl age, revision, installed, dlopen, dlpreopen, libdir.
- save_libdir="$libdir"
+ saved_libdir="$libdir"
case "$found_la" in
*/* | *\\*) . "$found_la" ;;
*) . "./$found_la" ;;
esac
- libdir="$save_libdir"
+ libdir="$saved_libdir"
dnl We use only dependency_libs.
for dep in $dependency_libs; do
case "$dep" in
@@ -682,18 +683,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
done
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
dnl The -rpath options are cumulative.
for found_dir in $rpathdirs; do
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$found_dir"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
fi
@@ -790,18 +791,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
for dir in $rpathdirs; do
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
done
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
$1="$flag"
else
dnl The -rpath options are cumulative.
for dir in $rpathdirs; do
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$dir"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
$1="${$1}${$1:+ }$flag"
done
fi
diff --git a/gnulib/m4/lib-prefix.m4 b/gnulib/m4/lib-prefix.m4
index aefe7f7124..6277f72d0c 100644
--- a/gnulib/m4/lib-prefix.m4
+++ b/gnulib/m4/lib-prefix.m4
@@ -1,5 +1,6 @@
-# lib-prefix.m4 serial 20
-dnl Copyright (C) 2001-2005, 2008-2023 Free Software Foundation, Inc.
+# lib-prefix.m4
+# serial 23
+dnl Copyright (C) 2001-2005, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -126,10 +127,10 @@ AC_DEFUN([AC_LIB_PREPARE_PREFIX],
else
acl_final_exec_prefix="$exec_prefix"
fi
- acl_save_prefix="$prefix"
+ acl_saved_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
- prefix="$acl_save_prefix"
+ prefix="$acl_saved_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
@@ -137,13 +138,13 @@ dnl variables prefix and exec_prefix bound to the values
they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
- acl_save_prefix="$prefix"
+ acl_saved_prefix="$prefix"
prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
+ acl_saved_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
+ exec_prefix="$acl_saved_exec_prefix"
+ prefix="$acl_saved_prefix"
])
dnl AC_LIB_PREPARE_MULTILIB creates
@@ -174,7 +175,7 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
[AC_EGREP_CPP([Extensible Linking Format],
- [#if defined __ELF__ || (defined __linux__ && defined __EDG__)
+ [#if defined __ELF__ || (defined __linux__ && (defined __EDG__ ||
defined __SUNPRO_C))
Extensible Linking Format
#endif
],
@@ -256,6 +257,15 @@ changequote([,])dnl
esac
fi
;;
+ netbsd*)
+ dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains
+ dnl 32-bit libraries.
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparc ;;
+ esac
+ fi
+ ;;
*)
dnl If $CC generates code for a 32-bit ABI, the libraries are
dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
@@ -280,7 +290,7 @@ changequote([,])dnl
fi
fi
if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
+ acl_saved_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
@@ -297,7 +307,7 @@ changequote([,])dnl
esac
fi
done
- IFS="$acl_save_IFS"
+ IFS="$acl_saved_IFS"
if test $HOST_CPU_C_ABI_32BIT = yes; then
# 32-bit ABI.
acl_libdirstem3=
diff --git a/gnulib/m4/libunistring-base.m4 b/gnulib/m4/libunistring-base.m4
index 6dd184a789..21e0e44212 100644
--- a/gnulib/m4/libunistring-base.m4
+++ b/gnulib/m4/libunistring-base.m4
@@ -1,5 +1,6 @@
-# libunistring-base.m4 serial 8
-dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# libunistring-base.m4
+# serial 9
+dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -152,6 +153,10 @@ dnl gl_LIBUNISTRING_VERSION_CMP([VERSION])
dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION
dnl is less than the VERSION argument.
AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
+[dnl VERSION = 999.9 means to evaluates to true always, i.e. to ignore
+dnl the installed libunistring regardless of its version.
+m4_if([$1], [999.9],
+[true],
[ { test "$HAVE_LIBUNISTRING" != yes \
|| {
dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least.
@@ -189,7 +194,7 @@ AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
}
])
}
- }])
+ }])])
dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the
dnl same as ORIG, otherwise to 0.
diff --git a/gnulib/m4/limits-h.m4 b/gnulib/m4/limits-h.m4
index 6a5983ebc2..1b619e1eb2 100644
--- a/gnulib/m4/limits-h.m4
+++ b/gnulib/m4/limits-h.m4
@@ -1,10 +1,12 @@
-dnl Check whether limits.h has needed features.
-
-dnl Copyright 2016-2023 Free Software Foundation, Inc.
+# limits-h.m4
+# serial 1
+dnl Copyright 2016-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Check whether limits.h has needed features.
+
dnl From Paul Eggert.
AC_DEFUN_ONCE([gl_LIMITS_H],
diff --git a/gnulib/m4/localcharset.m4 b/gnulib/m4/localcharset.m4
index 15b6b2a553..807a5eedac 100644
--- a/gnulib/m4/localcharset.m4
+++ b/gnulib/m4/localcharset.m4
@@ -1,5 +1,6 @@
-# localcharset.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc.
+# localcharset.m4
+# serial 8
+dnl Copyright (C) 2002, 2004, 2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/locale-fr.m4 b/gnulib/m4/locale-fr.m4
index ac1c7217da..f8d7c543e0 100644
--- a/gnulib/m4/locale-fr.m4
+++ b/gnulib/m4/locale-fr.m4
@@ -1,5 +1,6 @@
-# locale-fr.m4 serial 23
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-fr.m4
+# serial 23
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -116,7 +117,7 @@ int main () {
if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr=fr_FR.iso88591
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr=fr
else
@@ -250,7 +251,7 @@ int main () {
if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr_utf8=fr_FR.UTF-8
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr_utf8=fr.UTF-8
else
diff --git a/gnulib/m4/locale-ja.m4 b/gnulib/m4/locale-ja.m4
index 4350010cba..8423bcb972 100644
--- a/gnulib/m4/locale-ja.m4
+++ b/gnulib/m4/locale-ja.m4
@@ -1,5 +1,6 @@
-# locale-ja.m4 serial 18
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-ja.m4
+# serial 18
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -117,7 +118,7 @@ int main ()
if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_ja=ja_JP.EUC
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_ja=ja
else
diff --git a/gnulib/m4/locale-zh.m4 b/gnulib/m4/locale-zh.m4
index 10a2b5875a..fb9f26ab9f 100644
--- a/gnulib/m4/locale-zh.m4
+++ b/gnulib/m4/locale-zh.m4
@@ -1,5 +1,6 @@
-# locale-zh.m4 serial 18
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-zh.m4
+# serial 19
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -21,6 +22,7 @@ AC_DEFUN_ONCE([gt_LOCALE_ZH_CN],
#endif
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
struct tm t;
char buf[16];
int main ()
@@ -79,6 +81,19 @@ int main ()
single wide character. This excludes the GB2312 and GBK encodings. */
if (mblen ("\203\062\332\066", 5) != 4)
return 1;
+ /* Check whether mbrtowc accept this character one byte at a time.
+ This excludes NetBSD 10.0. */
+ if (sizeof (wchar_t) > 2)
+ {
+ wchar_t wc;
+ mbstate_t state;
+ memset (&state, 0, sizeof (state));
+ if (!(mbrtowc (&wc, "\203", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\062", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\332", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\066", 1, &state) == 1))
+ return 1;
+ }
return 0;
#endif
}
diff --git a/gnulib/m4/locale_h.m4 b/gnulib/m4/locale_h.m4
index f7281ac0c8..cd1c81ec12 100644
--- a/gnulib/m4/locale_h.m4
+++ b/gnulib/m4/locale_h.m4
@@ -1,5 +1,6 @@
-# locale_h.m4 serial 29
-dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# locale_h.m4
+# serial 31
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -59,9 +60,6 @@ AC_DEFUN_ONCE([gl_LOCALE_H],
dnl On native Windows with MSVC, merely define these member names as
macros.
dnl This avoids trouble in C++ mode.
case "$host_os" in
- windows*-gnu*)
- REPLACE_STRUCT_LCONV=1
- ;;
windows*-msvc*)
;;
mingw* | windows*)
@@ -157,7 +155,7 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE])
])
m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
diff --git a/gnulib/m4/localeconv.m4 b/gnulib/m4/localeconv.m4
index b9d8c1b113..77d5684ff0 100644
--- a/gnulib/m4/localeconv.m4
+++ b/gnulib/m4/localeconv.m4
@@ -1,5 +1,6 @@
-# localeconv.m4 serial 3
-dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
+# localeconv.m4
+# serial 3
+dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/lock.m4 b/gnulib/m4/lock.m4
index 88cf5575d5..eb0fc6a181 100644
--- a/gnulib/m4/lock.m4
+++ b/gnulib/m4/lock.m4
@@ -1,5 +1,6 @@
-# lock.m4 serial 14
-dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+# lock.m4
+# serial 14
+dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/lstat.m4 b/gnulib/m4/lstat.m4
index 977386348a..f838e2cc1e 100644
--- a/gnulib/m4/lstat.m4
+++ b/gnulib/m4/lstat.m4
@@ -1,10 +1,9 @@
-# serial 35
-
-# Copyright (C) 1997-2001, 2003-2023 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# lstat.m4
+# serial 36
+dnl Copyright (C) 1997-2001, 2003-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Jim Meyering.
@@ -18,7 +17,7 @@ AC_DEFUN([gl_FUNC_LSTAT],
if test $ac_cv_func_lstat = yes; then
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
- solaris* | *no)
+ darwin* | solaris* | *no)
REPLACE_LSTAT=1
;;
esac
diff --git a/gnulib/m4/malloc.m4 b/gnulib/m4/malloc.m4
index 096c262b17..ee6df5c3fb 100644
--- a/gnulib/m4/malloc.m4
+++ b/gnulib/m4/malloc.m4
@@ -1,5 +1,6 @@
-# malloc.m4 serial 30
-dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# malloc.m4
+# serial 34
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
[[#include <stdlib.h>
]],
[[void *p = malloc (0);
- int result = !p;
+ void * volatile vp = p;
+ int result = !vp;
free (p);
return result;]])
],
@@ -43,6 +45,11 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+
+ dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
+ dnl gets defined already before this macro gets invoked. This helps
+ dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise.
+
REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
_AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1])
diff --git a/gnulib/m4/malloca.m4 b/gnulib/m4/malloca.m4
index 1d777ebe6d..9e09d22cb9 100644
--- a/gnulib/m4/malloca.m4
+++ b/gnulib/m4/malloca.m4
@@ -1,5 +1,6 @@
-# malloca.m4 serial 2
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# malloca.m4
+# serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/math_h.m4 b/gnulib/m4/math_h.m4
index c214f8efa8..7e69629c3d 100644
--- a/gnulib/m4/math_h.m4
+++ b/gnulib/m4/math_h.m4
@@ -1,5 +1,6 @@
-# math_h.m4 serial 126
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# math_h.m4
+# serial 140
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -42,15 +43,21 @@ AC_DEFUN_ONCE([gl_MATH_H],
cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
expf expl exp2 exp2f exp2l expm1 expm1f expm1l
fabsf fabsl floorf floorl fma fmaf fmal
- fmod fmodf fmodl frexpf frexpl hypotf hypotl
+ fmod fmodf fmodl frexpf frexpl
+ getpayload getpayloadf getpayloadl
+ hypotf hypotl
ilogb ilogbf ilogbl
ldexpf ldexpl
log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
- logb logbf logbl
+ logb logbf logbl logp1 log1pf logp1l
modf modff modfl powf
remainder remainderf remainderl
- rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
- tanf tanl tanhf trunc truncf truncl])
+ rint rintf rintl round roundf roundl
+ setpayload setpayloadf setpayloadl
+ setpayloadsig setpayloadsigf setpayloadsigl
+ sinf sinl sinhf sqrtf sqrtl
+ tanf tanl tanhf totalorder totalorderf totalorderl totalordermag
+ totalordermagf totalordermagl trunc truncf truncl])
])
# gl_MATH_MODULE_INDICATOR([modulename])
@@ -113,6 +120,9 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
@@ -143,6 +153,9 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1L])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
@@ -156,6 +169,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
@@ -165,6 +184,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
@@ -210,6 +235,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_GETPAYLOAD=1; AC_SUBST([HAVE_GETPAYLOAD])
+ HAVE_GETPAYLOADF=1; AC_SUBST([HAVE_GETPAYLOADF])
+ HAVE_GETPAYLOADL=1; AC_SUBST([HAVE_GETPAYLOADL])
HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
@@ -228,6 +256,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_LOGP1=1; AC_SUBST([HAVE_LOGP1])
+ HAVE_LOGP1F=1; AC_SUBST([HAVE_LOGP1F])
+ HAVE_LOGP1L=1; AC_SUBST([HAVE_LOGP1L])
HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
HAVE_POWF=1; AC_SUBST([HAVE_POWF])
@@ -235,6 +266,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
HAVE_RINT=1; AC_SUBST([HAVE_RINT])
HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SETPAYLOAD=1; AC_SUBST([HAVE_SETPAYLOAD])
+ HAVE_SETPAYLOADF=1; AC_SUBST([HAVE_SETPAYLOADF])
+ HAVE_SETPAYLOADL=1; AC_SUBST([HAVE_SETPAYLOADL])
+ HAVE_SETPAYLOADSIG=1; AC_SUBST([HAVE_SETPAYLOADSIG])
+ HAVE_SETPAYLOADSIGF=1; AC_SUBST([HAVE_SETPAYLOADSIGF])
+ HAVE_SETPAYLOADSIGL=1; AC_SUBST([HAVE_SETPAYLOADSIGL])
HAVE_SINF=1; AC_SUBST([HAVE_SINF])
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
@@ -243,6 +280,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_TANF=1; AC_SUBST([HAVE_TANF])
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
+ HAVE_TOTALORDER=1; AC_SUBST([HAVE_TOTALORDER])
+ HAVE_TOTALORDERF=1; AC_SUBST([HAVE_TOTALORDERF])
+ HAVE_TOTALORDERL=1; AC_SUBST([HAVE_TOTALORDERL])
+ HAVE_TOTALORDERMAG=1; AC_SUBST([HAVE_TOTALORDERMAG])
+ HAVE_TOTALORDERMAGF=1; AC_SUBST([HAVE_TOTALORDERMAGF])
+ HAVE_TOTALORDERMAGL=1; AC_SUBST([HAVE_TOTALORDERMAGL])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
@@ -310,6 +353,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
+ REPLACE_GETPAYLOAD=0; AC_SUBST([REPLACE_GETPAYLOAD])
+ REPLACE_GETPAYLOADF=0; AC_SUBST([REPLACE_GETPAYLOADF])
+ REPLACE_GETPAYLOADL=0; AC_SUBST([REPLACE_GETPAYLOADL])
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
@@ -356,6 +402,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
+ REPLACE_TOTALORDER=0; AC_SUBST([REPLACE_TOTALORDER])
+ REPLACE_TOTALORDERF=0; AC_SUBST([REPLACE_TOTALORDERF])
+ REPLACE_TOTALORDERL=0; AC_SUBST([REPLACE_TOTALORDERL])
+ REPLACE_TOTALORDERMAG=0; AC_SUBST([REPLACE_TOTALORDERMAG])
+ REPLACE_TOTALORDERMAGF=0; AC_SUBST([REPLACE_TOTALORDERMAGF])
+ REPLACE_TOTALORDERMAGL=0; AC_SUBST([REPLACE_TOTALORDERMAGL])
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
@@ -366,7 +418,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
# The currently known platforms where this is the case are:
-# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+# Linux/HPPA, NetBSD/sparc32, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
[
AC_CACHE_CHECK([whether long double and double are the same],
diff --git a/gnulib/m4/mbchar.m4 b/gnulib/m4/mbchar.m4
index aed40a53c6..b84eb4dc96 100644
--- a/gnulib/m4/mbchar.m4
+++ b/gnulib/m4/mbchar.m4
@@ -1,5 +1,6 @@
-# mbchar.m4 serial 9
-dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+# mbchar.m4
+# serial 9
+dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbiter.m4 b/gnulib/m4/mbiter.m4
index 8e879dc4b9..e1f4ae65b7 100644
--- a/gnulib/m4/mbiter.m4
+++ b/gnulib/m4/mbiter.m4
@@ -1,5 +1,6 @@
-# mbiter.m4 serial 7
-dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc.
+# mbiter.m4
+# serial 7
+dnl Copyright (C) 2005, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbrtoc32.m4 b/gnulib/m4/mbrtoc32.m4
index 361c9f8380..4da0712bd4 100644
--- a/gnulib/m4/mbrtoc32.m4
+++ b/gnulib/m4/mbrtoc32.m4
@@ -1,5 +1,6 @@
-# mbrtoc32.m4 serial 18
-dnl Copyright (C) 2014-2023 Free Software Foundation, Inc.
+# mbrtoc32.m4
+# serial 21
+dnl Copyright (C) 2014-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -26,6 +27,7 @@ AC_DEFUN([gl_FUNC_MBRTOC32],
else
gl_MBRTOC32_EMPTY_INPUT
gl_MBRTOC32_C_LOCALE
+ gl_MBRTOC32_UTF8_LOCALE
case "$gl_cv_func_mbrtoc32_empty_input" in
*yes) ;;
*) AC_DEFINE([MBRTOC32_EMPTY_INPUT_BUG], [1],
@@ -40,6 +42,15 @@ AC_DEFUN([gl_FUNC_MBRTOC32],
REPLACE_MBRTOC32=1
;;
esac
+ case "$gl_cv_func_mbrtoc32_utf8_locale_works" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOC32_MULTIBYTE_LOCALE_BUG], [1],
+ [Define if the mbrtoc32 function does not accept the input bytes
one-by-one.])
+ REPLACE_MBRTOC32=1
+ dnl Our replacement mbrtoc32 can handle UTF-8, but not GB18030.
+ LOCALE_ZH_CN=none
+ ;;
+ esac
fi
if test $HAVE_WORKING_MBRTOC32 = 0; then
REPLACE_MBRTOC32=1
@@ -162,6 +173,53 @@ AC_DEFUN([gl_MBRTOC32_C_LOCALE],
])
])
+dnl Test whether mbrtoc32 works when it's fed the bytes one-by-one in an UTF-8
+dnl locale.
+
+AC_DEFUN([gl_MBRTOC32_UTF8_LOCALE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtoc32 works in an UTF-8 locale],
+ [gl_cv_func_mbrtoc32_utf8_locale_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
+ ]], [[
+ char *locale = setlocale (LC_ALL, "en_US.UTF-8");
+ if (locale)
+ {
+ /* This test fails on Cygwin 3.5.3. */
+ mbstate_t state = { 0, };
+ char32_t uc = 0xDEADBEEF;
+ /* \360\237\220\203 = U+0001F403 */
+ if (mbrtoc32 (&uc, "\360", 1, &state) != (size_t)-2)
+ return 1;
+ if (mbrtoc32 (&uc, "\237", 1, &state) != (size_t)-2)
+ return 2;
+ if (mbrtoc32 (&uc, "\220", 1, &state) != (size_t)-2)
+ return 3;
+ if (mbrtoc32 (&uc, "\203", 1, &state) != 1)
+ return 4;
+ if (uc != 0x0001F403)
+ return 5;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_mbrtoc32_utf8_locale_works=yes],
+ [gl_cv_func_mbrtoc32_utf8_locale_works=no],
+ [case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_mbrtoc32_utf8_locale_works="guessing no" ;;
+ *)
gl_cv_func_mbrtoc32_utf8_locale_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+])
+
dnl Test whether mbrtoc32 works not worse than mbrtowc.
dnl Result is HAVE_WORKING_MBRTOC32.
@@ -172,7 +230,7 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK],
AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32])
AC_REQUIRE([gt_LOCALE_FR])
AC_REQUIRE([gt_LOCALE_ZH_CN])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 =
no; then
HAVE_WORKING_MBRTOC32=0
else
@@ -262,5 +320,6 @@ int main ()
# Prerequisites of lib/mbrtoc32.c and lib/lc-charset-dispatch.c.
AC_DEFUN([gl_PREREQ_MBRTOC32], [
+ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
:
])
diff --git a/gnulib/m4/mbrtowc.m4 b/gnulib/m4/mbrtowc.m4
index ea0789510f..4ea8184049 100644
--- a/gnulib/m4/mbrtowc.m4
+++ b/gnulib/m4/mbrtowc.m4
@@ -1,5 +1,6 @@
-# mbrtowc.m4 serial 44 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
+# mbrtowc.m4
+# serial 44
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/mbsinit.m4 b/gnulib/m4/mbsinit.m4
index 8d10569f64..10c86ba94e 100644
--- a/gnulib/m4/mbsinit.m4
+++ b/gnulib/m4/mbsinit.m4
@@ -1,5 +1,6 @@
-# mbsinit.m4 serial 10
-dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+# mbsinit.m4
+# serial 10
+dnl Copyright (C) 2008, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbslen.m4 b/gnulib/m4/mbslen.m4
index a9e0ed2a58..429317c8c0 100644
--- a/gnulib/m4/mbslen.m4
+++ b/gnulib/m4/mbslen.m4
@@ -1,5 +1,6 @@
-# mbslen.m4 serial 3
-dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# mbslen.m4
+# serial 3
+dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbstate_t.m4 b/gnulib/m4/mbstate_t.m4
index dcd66b9613..66d65cd7c1 100644
--- a/gnulib/m4/mbstate_t.m4
+++ b/gnulib/m4/mbstate_t.m4
@@ -1,5 +1,6 @@
-# mbstate_t.m4 serial 14
-dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc.
+# mbstate_t.m4
+# serial 14
+dnl Copyright (C) 2000-2002, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbswidth.m4 b/gnulib/m4/mbswidth.m4
index 0b7f90273e..321d15c0b2 100644
--- a/gnulib/m4/mbswidth.m4
+++ b/gnulib/m4/mbswidth.m4
@@ -1,5 +1,6 @@
-# mbswidth.m4 serial 19
-dnl Copyright (C) 2000-2002, 2004, 2006-2023 Free Software Foundation, Inc.
+# mbswidth.m4
+# serial 19
+dnl Copyright (C) 2000-2002, 2004, 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mbtowc.m4 b/gnulib/m4/mbtowc.m4
index 02ed6ebb33..603b0c1ae5 100644
--- a/gnulib/m4/mbtowc.m4
+++ b/gnulib/m4/mbtowc.m4
@@ -1,5 +1,6 @@
-# mbtowc.m4 serial 5
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# mbtowc.m4
+# serial 5
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/memchr.m4 b/gnulib/m4/memchr.m4
index 1523f19e09..31ff2dacff 100644
--- a/gnulib/m4/memchr.m4
+++ b/gnulib/m4/memchr.m4
@@ -1,5 +1,6 @@
-# memchr.m4 serial 19
-dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc.
+# memchr.m4
+# serial 20
+dnl Copyright (C) 2002-2004, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -48,7 +49,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
if (fd >= 0)
# endif
{
- int pagesize = getpagesize ();
+ long int pagesize = sysconf (_SC_PAGESIZE);
char *two_pages =
(char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
flags, fd, 0);
diff --git a/gnulib/m4/mempcpy.m4 b/gnulib/m4/mempcpy.m4
index 612b77b3c1..377fda3cac 100644
--- a/gnulib/m4/mempcpy.m4
+++ b/gnulib/m4/mempcpy.m4
@@ -1,5 +1,6 @@
-# mempcpy.m4 serial 14
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# mempcpy.m4
+# serial 14
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/memrchr.m4 b/gnulib/m4/memrchr.m4
index 7611ac7e3a..d8c931e90c 100644
--- a/gnulib/m4/memrchr.m4
+++ b/gnulib/m4/memrchr.m4
@@ -1,5 +1,6 @@
-# memrchr.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
+# memrchr.m4
+# serial 11
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/minmax.m4 b/gnulib/m4/minmax.m4
index fd09846ffb..bc7d0c345f 100644
--- a/gnulib/m4/minmax.m4
+++ b/gnulib/m4/minmax.m4
@@ -1,5 +1,6 @@
-# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
+# minmax.m4
+# serial 4
+dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mkdir.m4 b/gnulib/m4/mkdir.m4
index 79c5e2c740..894cab7203 100644
--- a/gnulib/m4/mkdir.m4
+++ b/gnulib/m4/mkdir.m4
@@ -1,9 +1,9 @@
-# serial 19
-
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# mkdir.m4
+# serial 20
+dnl Copyright (C) 2001, 2003-2004, 2006, 2008-2024 Free Software Foundation,
Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
# On others, mkdir ("foo/./", 0700) mistakenly succeeds.
@@ -32,7 +32,6 @@ AC_DEFUN([gl_FUNC_MKDIR],
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing
yes" ;;
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing
no" ;;
windows*-msvc*) gl_cv_func_mkdir_trailing_slash_works="guessing
yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
diff --git a/gnulib/m4/mkstemp.m4 b/gnulib/m4/mkstemp.m4
index 40958a72c4..311e6afd45 100644
--- a/gnulib/m4/mkstemp.m4
+++ b/gnulib/m4/mkstemp.m4
@@ -1,9 +1,9 @@
-#serial 30
-
-# Copyright (C) 2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# mkstemp.m4
+# serial 30
+dnl Copyright (C) 2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
# silly limit that it can create no more than 26 files from a given template.
diff --git a/gnulib/m4/mmap-anon.m4 b/gnulib/m4/mmap-anon.m4
index d07d26e49e..61ca0120da 100644
--- a/gnulib/m4/mmap-anon.m4
+++ b/gnulib/m4/mmap-anon.m4
@@ -1,5 +1,6 @@
-# mmap-anon.m4 serial 12
-dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+# mmap-anon.m4
+# serial 12
+dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/mode_t.m4 b/gnulib/m4/mode_t.m4
index 82197c0214..0d5c280828 100644
--- a/gnulib/m4/mode_t.m4
+++ b/gnulib/m4/mode_t.m4
@@ -1,5 +1,6 @@
-# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# mode_t.m4
+# serial 2
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/msvc-inval.m4 b/gnulib/m4/msvc-inval.m4
index 8d9d21b529..7919ff1223 100644
--- a/gnulib/m4/msvc-inval.m4
+++ b/gnulib/m4/msvc-inval.m4
@@ -1,5 +1,6 @@
-# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# msvc-inval.m4
+# serial 1
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/msvc-nothrow.m4 b/gnulib/m4/msvc-nothrow.m4
index 0263e49088..007c762018 100644
--- a/gnulib/m4/msvc-nothrow.m4
+++ b/gnulib/m4/msvc-nothrow.m4
@@ -1,5 +1,6 @@
-# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# msvc-nothrow.m4
+# serial 1
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/multiarch.m4 b/gnulib/m4/multiarch.m4
index 3ba5b0f76c..3af29d39a0 100644
--- a/gnulib/m4/multiarch.m4
+++ b/gnulib/m4/multiarch.m4
@@ -1,5 +1,6 @@
-# multiarch.m4 serial 9
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# multiarch.m4
+# serial 9
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/musl.m4 b/gnulib/m4/musl.m4
index e28a3fed67..0d4de8926a 100644
--- a/gnulib/m4/musl.m4
+++ b/gnulib/m4/musl.m4
@@ -1,5 +1,6 @@
-# musl.m4 serial 4
-dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+# musl.m4
+# serial 4
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/nl_langinfo.m4 b/gnulib/m4/nl_langinfo.m4
index 7648d52467..f38f11bbd3 100644
--- a/gnulib/m4/nl_langinfo.m4
+++ b/gnulib/m4/nl_langinfo.m4
@@ -1,5 +1,6 @@
-# nl_langinfo.m4 serial 11
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# nl_langinfo.m4
+# serial 11
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/nocrash.m4 b/gnulib/m4/nocrash.m4
index 6a76638761..cbe8fe82d5 100644
--- a/gnulib/m4/nocrash.m4
+++ b/gnulib/m4/nocrash.m4
@@ -1,5 +1,6 @@
-# nocrash.m4 serial 5
-dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
+# nocrash.m4
+# serial 5
+dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/off64_t.m4 b/gnulib/m4/off64_t.m4
new file mode 100644
index 0000000000..34fa21eb16
--- /dev/null
+++ b/gnulib/m4/off64_t.m4
@@ -0,0 +1,31 @@
+# off64_t.m4
+# serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether <sys/types.h> defines the 'off64_t' type.
+dnl Set HAVE_OFF64_T.
+
+AC_DEFUN([gl_TYPE_OFF64_T],
+[
+ dnl Persuade glibc <sys/types.h>, <stdio.h>, <fcntl.h>, <unistd.h>, <aio.h>
+ dnl to define off64_t.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CACHE_CHECK([for off64_t], [gl_cv_off64_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[int x = sizeof (off64_t *) + sizeof (off64_t);
+ return !x;]])],
+ [gl_cv_off64_t=yes], [gl_cv_off64_t=no])])
+
+ if test $gl_cv_off64_t != no; then
+ HAVE_OFF64_T=1
+ else
+ HAVE_OFF64_T=0
+ fi
+ AC_SUBST([HAVE_OFF64_T])
+])
diff --git a/gnulib/m4/off_t.m4 b/gnulib/m4/off_t.m4
index 880f347250..db6035dbeb 100644
--- a/gnulib/m4/off_t.m4
+++ b/gnulib/m4/off_t.m4
@@ -1,5 +1,6 @@
-# off_t.m4 serial 1
-dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
+# off_t.m4
+# serial 1
+dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/msvc-nothrow.m4 b/gnulib/m4/once.m4
similarity index 57%
copy from gnulib/m4/msvc-nothrow.m4
copy to gnulib/m4/once.m4
index 0263e49088..6b0d32394d 100644
--- a/gnulib/m4/msvc-nothrow.m4
+++ b/gnulib/m4/once.m4
@@ -1,10 +1,13 @@
-# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# once.m4
+# serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_MSVC_NOTHROW],
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_ONCE],
[
- AC_REQUIRE([gl_MSVC_INVAL])
+ AC_REQUIRE([gl_THREADLIB])
])
diff --git a/gnulib/m4/open-cloexec.m4 b/gnulib/m4/open-cloexec.m4
index fd572fcd1d..6defdfb400 100644
--- a/gnulib/m4/open-cloexec.m4
+++ b/gnulib/m4/open-cloexec.m4
@@ -1,10 +1,12 @@
-# Test whether O_CLOEXEC is defined.
-
-dnl Copyright 2017-2023 Free Software Foundation, Inc.
+# open-cloexec.m4
+# serial 1
+dnl Copyright 2017-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Test whether O_CLOEXEC is defined.
+
AC_DEFUN([gl_PREPROC_O_CLOEXEC],
[
AC_CACHE_CHECK([for O_CLOEXEC],
diff --git a/gnulib/m4/open-slash.m4 b/gnulib/m4/open-slash.m4
index 1f731f8ad8..03460e422d 100644
--- a/gnulib/m4/open-slash.m4
+++ b/gnulib/m4/open-slash.m4
@@ -1,5 +1,6 @@
-# open-slash.m4 serial 2
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# open-slash.m4
+# serial 2
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/open.m4 b/gnulib/m4/open.m4
index b14fd013fc..62a11a110c 100644
--- a/gnulib/m4/open.m4
+++ b/gnulib/m4/open.m4
@@ -1,5 +1,6 @@
-# open.m4 serial 16
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# open.m4
+# serial 16
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/pathmax.m4 b/gnulib/m4/pathmax.m4
index 6d47d2c026..4280837f1e 100644
--- a/gnulib/m4/pathmax.m4
+++ b/gnulib/m4/pathmax.m4
@@ -1,5 +1,6 @@
-# pathmax.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation,
+# pathmax.m4
+# serial 11
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/pid_t.m4 b/gnulib/m4/pid_t.m4
index 0fd7d0a181..8bedcc6bcd 100644
--- a/gnulib/m4/pid_t.m4
+++ b/gnulib/m4/pid_t.m4
@@ -1,5 +1,6 @@
-# pid_t.m4 serial 4
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# pid_t.m4
+# serial 4
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/printf.m4 b/gnulib/m4/printf.m4
index 3be48277a6..a6daa1a62c 100644
--- a/gnulib/m4/printf.m4
+++ b/gnulib/m4/printf.m4
@@ -1,5 +1,6 @@
-# printf.m4 serial 85
-dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+# printf.m4
+# serial 95
+dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -86,7 +87,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_sizes_c99="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_sizes_c99="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -230,7 +230,6 @@ int main ()
# Guess yes on Android.
linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_long_double="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_long_double="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -358,7 +357,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_infinite="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_infinite="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_infinite="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -574,7 +572,6 @@ changequote(,)dnl
linux*-android*)
gl_cv_func_printf_infinite_long_double="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*)
gl_cv_func_printf_infinite_long_double="guessing no" ;;
windows*-msvc*)
gl_cv_func_printf_infinite_long_double="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -619,6 +616,7 @@ static double zero = 0.0;
int main ()
{
int result = 0;
+ /* This fails on FreeBSD 5.2.1, Solaris 11.4. */
if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.922p+1 33") != 0
&& strcmp (buf, "0x3.244p+0 33") != 0
@@ -630,27 +628,29 @@ int main ()
&& strcmp (buf, "-0X3.244P+0 33") != 0
&& strcmp (buf, "-0X6.488P-1 33") != 0
&& strcmp (buf, "-0XC.91P-2 33") != 0))
- result |= 2;
- /* This catches a FreeBSD 13.0 bug: it doesn't round. */
+ result |= 1;
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4, NetBSD 10.0 bug:
+ it doesn't round. */
if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.83p+0 33") != 0
&& strcmp (buf, "0x3.05p-1 33") != 0
&& strcmp (buf, "0x6.0ap-2 33") != 0
&& strcmp (buf, "0xc.14p-3 33") != 0))
- result |= 4;
- /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
+ result |= 2;
+ /* This catches a macOS 14 (Darwin 23), FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+ Solaris 11.4 bug: it doesn't round. */
if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x2p+0 33") != 0
&& strcmp (buf, "0x3p-1 33") != 0
&& strcmp (buf, "0x6p-2 33") != 0
&& strcmp (buf, "0xcp-3 33") != 0))
result |= 4;
- /* This catches a FreeBSD 6.1 bug. See
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4 bug. See
<https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
- /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9), FreeBSD 6.4 bug. */
if (sprintf (buf, "%.1a", 1.999) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
@@ -658,7 +658,8 @@ int main ()
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
/* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
- glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>
+ and a FreeBSD 6.4, NetBSD 10.0 bug. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
@@ -865,7 +866,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_directive_f="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_directive_f="guessing yes"
;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -895,10 +895,16 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#ifdef _MSC_VER
+#include <crtdbg.h>
#include <inttypes.h>
/* See page about "Parameter Validation" on msdn.microsoft.com.
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
@@ -912,6 +918,12 @@ invalid_parameter_handler (const wchar_t *expression,
exit (1);
}
#endif
+static void
+abort_handler (int sig)
+{
+ (void) sig;
+ _exit (1);
+}
static char fmtstring[10];
static char buf[100];
int main ()
@@ -919,7 +931,11 @@ int main ()
int count = -1;
#ifdef _MSC_VER
_set_invalid_parameter_handler (invalid_parameter_handler);
+ /* Also avoid an Abort/Retry/Ignore dialog in debug builds.
+
<https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode>
*/
+ _CrtSetReportMode (_CRT_ASSERT, 0);
#endif
+ signal (SIGABRT, abort_handler);
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
support %n in format strings in read-only memory but not in writable
memory. */
@@ -1037,7 +1053,8 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports the %lc format
dnl directive and in particular, when the argument is a null wide character,
-dnl whether the functions don't produce a NUL byte.
+dnl whether the functions produce a NUL byte, as specified in ISO C 23
+dnl after the issue GB-141 was fixed.
dnl Result is gl_cv_func_printf_directive_lc.
AC_DEFUN([gl_PRINTF_DIRECTIVE_LC],
@@ -1056,13 +1073,11 @@ int main ()
{
int result = 0;
char buf[100];
- /* This test fails on glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
- macOS 12.5, AIX 7.2, Solaris 11.4.
- glibc 2.35 bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=30257>
*/
+ /* This test fails on musl libc 1.2.4. */
{
buf[0] = '\0';
if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0
- || strcmp (buf, "az") != 0)
+ || memcmp (buf, "a\0z", 4) != 0)
result |= 1;
}
return result;
@@ -1072,10 +1087,10 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on musl libc.
- *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing yes";;
- # Guess no otherwise.
- *) gl_cv_func_printf_directive_lc="guessing no";;
+ # Guess no on musl libc.
+ *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_printf_directive_lc="guessing yes";;
esac
changequote([,])dnl
])
@@ -1265,6 +1280,50 @@ changequote([,])dnl
])
])
+dnl Test whether the *printf family of functions supports the # flag with a
+dnl zero precision and a zero value in the 'x' and 'X' directives correctly.
+dnl ISO C and POSIX specify that for the 'd', 'i', 'b', 'o', 'u', 'x', 'X'
+dnl directives: "The result of converting a zero value with a precision of
+dnl zero is no characters." But on Mac OS X 10.5, for the 'x', 'X' directives,
+dnl when a # flag is present, the output is "0" instead of "".
+dnl Result is gl_cv_func_printf_flag_alt_precision_zero.
+
+AC_DEFUN([gl_PRINTF_FLAG_ALT_PRECISION_ZERO],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the alternative flag with a zero
precision],
+ [gl_cv_func_printf_flag_alt_precision_zero],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+static char buf[10];
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%#.0x %d", 0, 33, 44) > 0 + 3)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_printf_flag_alt_precision_zero=yes],
+ [gl_cv_func_printf_flag_alt_precision_zero=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no only on macOS 10..12 systems.
+ darwin[0-9] | darwin[0-9].* | \
+ darwin1[0-9] | darwin1[0-9].* | \
+ darwin2[0-1] | darwin2[0-1].*)
+ gl_cv_func_printf_flag_alt_precision_zero="guessing no" ;;
+ darwin*) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
+ *) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
dnl Test whether the *printf family of functions supports large precisions.
dnl On mingw, precisions larger than 512 are treated like 512, in integer,
dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
@@ -1629,7 +1688,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_snprintf_retval_c99="guessing
yes";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_snprintf_retval_c99="guessing no"
;;
windows*-msvc*) gl_cv_func_snprintf_retval_c99="guessing yes"
;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -1660,8 +1718,14 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <signal.h>
#include <stdio.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#if HAVE_SNPRINTF
# define my_snprintf snprintf
#else
@@ -1676,11 +1740,18 @@ static int my_snprintf (char *buf, int size, const char
*format, ...)
return ret;
}
#endif
+static void
+abort_handler (int sig)
+{
+ (void) sig;
+ _exit (1);
+}
static char fmtstring[10];
static char buf[100];
int main ()
{
int count = -1;
+ signal (SIGABRT, abort_handler);
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
support %n in format strings in read-only memory but not in writable
memory. */
@@ -1986,7 +2057,7 @@ static wchar_t buf[100];
int main ()
{
int result = 0;
- /* This catches a glibc 2.15 and Haiku 2022 bug. */
+ /* This catches a glibc 2.15, Haiku 2022, NetBSD 10.0 bug. */
if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
L"%La %d", 3.1416015625L, 33, 44, 55) < 0
|| (wcscmp (buf, L"0x1.922p+1 33") != 0
@@ -2016,6 +2087,8 @@ int main ()
*-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing
yes";;
# Guess yes on Android.
linux*-android*) gl_cv_func_swprintf_directive_la="guessing
yes";;
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_swprintf_directive_la="guessing no";;
# Guess no on native Windows.
mingw* | windows*) gl_cv_func_swprintf_directive_la="guessing no";;
# If we don't know, obey --enable-cross-guesses.
@@ -2089,17 +2162,18 @@ dnl 13 = gl_PRINTF_POSITIONS
dnl 14 = gl_PRINTF_FLAG_GROUPING
dnl 15 = gl_PRINTF_FLAG_LEFTADJUST
dnl 16 = gl_PRINTF_FLAG_ZERO
-dnl 17 = gl_PRINTF_PRECISION
-dnl 18 = gl_PRINTF_ENOMEM
-dnl 19 = gl_SNPRINTF_PRESENCE
-dnl 20 = gl_SNPRINTF_TRUNCATION_C99
-dnl 21 = gl_SNPRINTF_RETVAL_C99
-dnl 22 = gl_SNPRINTF_DIRECTIVE_N
-dnl 23 = gl_SNPRINTF_SIZE1
-dnl 24 = gl_VSNPRINTF_ZEROSIZE_C99
-dnl 25 = gl_SWPRINTF_WORKS
-dnl 26 = gl_SWPRINTF_DIRECTIVE_LA
-dnl 27 = gl_SWPRINTF_DIRECTIVE_LC
+dnl 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO
+dnl 18 = gl_PRINTF_PRECISION
+dnl 19 = gl_PRINTF_ENOMEM
+dnl 20 = gl_SNPRINTF_PRESENCE
+dnl 21 = gl_SNPRINTF_TRUNCATION_C99
+dnl 22 = gl_SNPRINTF_RETVAL_C99
+dnl 23 = gl_SNPRINTF_DIRECTIVE_N
+dnl 24 = gl_SNPRINTF_SIZE1
+dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl 26 = gl_SWPRINTF_WORKS
+dnl 27 = gl_SWPRINTF_DIRECTIVE_LA
+dnl 28 = gl_SWPRINTF_DIRECTIVE_LC
dnl
dnl 1 = checking whether printf supports size specifiers as in C99...
dnl 2 = checking whether printf supports size specifiers as in C23...
@@ -2117,58 +2191,60 @@ dnl 13 = checking whether printf supports POSIX/XSI
format strings with position
dnl 14 = checking whether printf supports the grouping flag...
dnl 15 = checking whether printf supports the left-adjust flag correctly...
dnl 16 = checking whether printf supports the zero flag correctly...
-dnl 17 = checking whether printf supports large precisions...
-dnl 18 = checking whether printf survives out-of-memory conditions...
-dnl 19 = checking for snprintf...
-dnl 20 = checking whether snprintf truncates the result as in C99...
-dnl 21 = checking whether snprintf returns a byte count as in C99...
-dnl 22 = checking whether snprintf fully supports the 'n' directive...
-dnl 23 = checking whether snprintf respects a size of 1...
-dnl 24 = checking whether vsnprintf respects a zero size as in C99...
-dnl 25 = checking whether swprintf works...
-dnl 26 = checking whether swprintf supports the 'La' and 'LA' directives...
-dnl 27 = checking whether swprintf supports the 'lc' directive...
+dnl 17 = checking whether printf supports the alternative flag with a zero
precision...
+dnl 18 = checking whether printf supports large precisions...
+dnl 19 = checking whether printf survives out-of-memory conditions...
+dnl 20 = checking for snprintf...
+dnl 21 = checking whether snprintf truncates the result as in C99...
+dnl 22 = checking whether snprintf returns a byte count as in C99...
+dnl 23 = checking whether snprintf fully supports the 'n' directive...
+dnl 24 = checking whether snprintf respects a size of 1...
+dnl 25 = checking whether vsnprintf respects a zero size as in C99...
+dnl 26 = checking whether swprintf works...
+dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives...
+dnl 28 = checking whether swprintf supports the 'lc' directive...
dnl
dnl . = yes, # = no.
dnl
-dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27
-dnl musl libc 1.2.3 . # . . . . # # . . . . . .
. . . . . . . . . . # . #
-dnl glibc 2.35 . # . . . . . . . . . # . .
. . . . . . . . . . . . .
-dnl glibc 2.5 . # . . . . # # . . . # . .
. . . . . . . . . . . # .
-dnl glibc 2.3.6 . # . . . # # # . . . # . .
. . . . . . . . . . . # .
-dnl FreeBSD 13.0 . # . . . # # # . . . # . .
. . . # . . . . . . # . #
-dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl Mac OS X 10.13.5 . # . . # # # # . # . # . .
. . . . . . . # . . # ? ?
-dnl Mac OS X 10.5.8 . # . . # # # # . . . # . .
. # . . . . . . . . # ? ?
-dnl Mac OS X 10.3.9 . # . . . # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . .
. . . # . . . . . . # . #
-dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . #
. # . # . . . . . . # ? ?
-dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . .
. . . ? . . . . . . ? ? ?
-dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . .
. . . # . . . . . . ? ? ?
-dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . #
. # # # . . . . . . ? ? ?
-dnl Solaris 11.4 . # . # # # # # . . # # . .
. # . . . . . . . . . # .
-dnl Solaris 11.3 . # . . . # # # . . # # . .
. . . . . . . . . . . # .
-dnl Solaris 11.0 . # . # # # # # . . # # . .
. # . . . . . . . . ? ? ?
-dnl Solaris 10 . # . # # # # # . . # # . .
. # # . . . . . . . . # .
-dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . .
. # # . . . # . . . ? ? ?
-dnl Solaris 2.5.1 # # . # # # # # # . # # . .
. # . . # # # # # # ? ? ?
-dnl AIX 7.1 . # . # # # # # . . . # . .
. # # . . . . . . . # . .
-dnl AIX 5.2 . # . # # # # # . . . # . .
. # . . . . . . . . # ? ?
-dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . .
. # . . . . # . . . # ? ?
-dnl HP-UX 11.31 . # . . . # # # . . . ? . .
. # . . . . # # . . ? ? ?
-dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . .
. # . . . . # # . # ? ? ?
-dnl HP-UX 10.20 # # . # . # # # # . ? ? . .
# # . . . . # # ? # ? ? ?
-dnl IRIX 6.5 # # . # # # # # # . # # . .
. # . . . . # . . . # ? ?
-dnl OSF/1 5.1 # # . # # # # # # . . ? . .
. # . . . . # . . # ? ? ?
-dnl OSF/1 4.0d # # . # # # # # # . . ? . .
. # . . # # # # # # ? ? ?
-dnl NetBSD 9.0 . # . . . # # # . . . # . .
. . . . . . . . . . # . #
-dnl NetBSD 5.0 . # . . # # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ?
? ? ? ? . . . ? ? ? # ? ?
-dnl NetBSD 3.0 . # . . . # # # # . ? # # #
? # . # . . . . . . # ? ?
-dnl Haiku . # . . # # # # # . # ? . .
. . . ? . . ? . . . . # .
-dnl BeOS # # # . # # # # # . ? ? # .
? . # ? . . ? . . . ? ? ?
-dnl Android 4.3 . # . # # # # # # # # ? . #
. # . # . . . # . . ? ? ?
-dnl old mingw / msvcrt # # # # # # # # # . . ? # #
. # # ? . # # # . . # ? ?
-dnl MSVC 9 # # # # # # # # # # . ? # #
. # # ? # # # # . . # ? ?
-dnl mingw 2009-2011 . # # . # . # # . . . ? # #
. . . ? . . . . . . # ? ?
-dnl mingw-w64 2011 # # # # # # # # # . . ? # #
. # # ? . # # # . . # ? ?
+dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28
+dnl musl libc 1.2.3 . # . . . . # # . . . # . .
. . ? . . . . . . . . # . #
+dnl glibc 2.35 . # . . . . . . . . . . . .
. . . . . . . . . . . . . .
+dnl glibc 2.5 . # . . . . # # . . . . . .
. . . . . . . . . . . . # .
+dnl glibc 2.3.6 . # . . . # # # . . . . . .
. . . . . . . . . . . . # .
+dnl FreeBSD 14.0 . . . . . # . . . . . . . .
. . . . # . . . . . . # . #
+dnl FreeBSD 13.0 . # . . . # # # . . . . . .
. . . . # . . . . . . # . #
+dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . .
. # ? . # . . . . . . # ? ?
+dnl Mac OS X 10.13.5 . # . . # # # # . # . . . .
. . . . . . . . # . . # ? ?
+dnl Mac OS X 10.5.8 . # . . # # # # . . . . . .
. # # . . . . . . . . # ? ?
+dnl Mac OS X 10.3.9 . # . . . # # # . . . . . .
. # # . # . . . . . . # ? ?
+dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . .
. . . . # . . . . . . # . #
+dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . #
. # ? . # . . . . . . # ? ?
+dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . .
. . ? . ? . . . . . . ? ? ?
+dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . .
. . ? . # . . . . . . ? ? ?
+dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . #
. # ? # # . . . . . . ? ? ?
+dnl Solaris 11.4 . # . # # # # # . . # . . .
. # . . . . . . . . . . # .
+dnl Solaris 11.3 . # . . . # # # . . # . . .
. . . . . . . . . . . . # .
+dnl Solaris 11.0 . # . # # # # # . . # . . .
. # . . . . . . . . . ? ? ?
+dnl Solaris 10 . # . # # # # # . . # . . .
. # . # . . . . . . . . # .
+dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . .
. # ? # . . . # . . . ? ? ?
+dnl Solaris 2.5.1 # # . # # # # # # . # . . .
. # ? . . # # # # # # ? ? ?
+dnl AIX 7.1 . # . # # # # # . . . . . .
. # . # . . . . . . . # . .
+dnl AIX 5.2 . # . # # # # # . . . . . .
. # ? . . . . . . . . # ? ?
+dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . .
. # ? . . . . # . . . # ? ?
+dnl HP-UX 11.31 . # . . . # # # . . . ? . .
. # ? . . . . # # . . ? ? ?
+dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . .
. # ? . . . . # # . # ? ? ?
+dnl HP-UX 10.20 # # . # . # # # # . ? ? . .
# # ? . . . . # # ? # ? ? ?
+dnl IRIX 6.5 # # . # # # # # # . # . . .
. # ? . . . . # . . . # ? ?
+dnl OSF/1 5.1 # # . # # # # # # . . ? . .
. # ? . . . . # . . # ? ? ?
+dnl OSF/1 4.0d # # . # # # # # # . . ? . .
. # ? . . # # # # # # ? ? ?
+dnl NetBSD 9.0 . # . . . # # # . . . . . .
. . . . . . . . . . . # . #
+dnl NetBSD 5.0 . # . . # # # # . . . . . .
. # ? . # . . . . . . # ? ?
+dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ?
? ? ? ? ? . . . ? ? ? # ? ?
+dnl NetBSD 3.0 . # . . . # # # # . ? . # #
? # ? . # . . . . . . # ? ?
+dnl Haiku . # . . # # # # # . # ? . .
. . ? . ? . . ? . . . . # .
+dnl BeOS # # # . # # # # # . ? ? # .
? . ? # ? . . ? . . . ? ? ?
+dnl Android 4.3 . # . # # # # # # # # ? . #
. # ? . # . . . # . . ? ? ?
+dnl old mingw / msvcrt # # # # # # # # # . . ? # #
. # ? # ? . # # # . . # ? ?
+dnl MSVC 9 # # # # # # # # # # . ? # #
. # ? # ? # # # # . . # ? ?
+dnl mingw 2009-2011 . # # . # . # # . . . ? # #
. . ? . ? . . . . . . # ? ?
+dnl mingw-w64 2011 # # # # # # # # # . . ? # #
. # ? # ? . # # # . . # ? ?
diff --git a/gnulib/m4/pthread-once.m4 b/gnulib/m4/pthread-once.m4
new file mode 100644
index 0000000000..46b8840e2b
--- /dev/null
+++ b/gnulib/m4/pthread-once.m4
@@ -0,0 +1,36 @@
+# pthread-once.m4
+# serial 3
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PTHREAD_ONCE],
+[
+ AC_REQUIRE([gl_PTHREAD_H])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \
+ && test $gl_threads_api = windows; then
+ dnl Choose function names that don't conflict with the mingw-w64
winpthreads
+ dnl library.
+ REPLACE_PTHREAD_ONCE=1
+ else
+ if test $HAVE_PTHREAD_H = 0; then
+ HAVE_PTHREAD_ONCE=0
+ else
+ dnl Work around Cygwin 3.5.3 bug.
+ AC_CACHE_CHECK([whether pthread_once works],
+ [gl_cv_func_pthread_once_works],
+ [case "$host_os" in
+ cygwin*) gl_cv_func_pthread_once_works="guessing no" ;;
+ *) gl_cv_func_pthread_once_works="yes" ;;
+ esac
+ ])
+ case "$gl_cv_func_pthread_once_works" in
+ *yes) ;;
+ *) REPLACE_PTHREAD_ONCE=1 ;;
+ esac
+ fi
+ fi
+])
diff --git a/gnulib/m4/pthread-spin.m4 b/gnulib/m4/pthread-spin.m4
new file mode 100644
index 0000000000..67a50fa4db
--- /dev/null
+++ b/gnulib/m4/pthread-spin.m4
@@ -0,0 +1,71 @@
+# pthread-spin.m4
+# serial 8
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_PTHREAD_SPIN],
+[
+ AC_REQUIRE([gl_PTHREAD_H_PART1])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \
+ && test $gl_threads_api = windows; then
+ dnl Choose function names that don't conflict with the mingw-w64
winpthreads
+ dnl library.
+ REPLACE_PTHREAD_SPIN_INIT=1
+ REPLACE_PTHREAD_SPIN_LOCK=1
+ REPLACE_PTHREAD_SPIN_TRYLOCK=1
+ REPLACE_PTHREAD_SPIN_UNLOCK=1
+ REPLACE_PTHREAD_SPIN_DESTROY=1
+ else
+ if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then
+ HAVE_PTHREAD_SPIN_INIT=0
+ HAVE_PTHREAD_SPIN_LOCK=0
+ HAVE_PTHREAD_SPIN_TRYLOCK=0
+ HAVE_PTHREAD_SPIN_UNLOCK=0
+ HAVE_PTHREAD_SPIN_DESTROY=0
+ else
+ dnl Test whether the gnulib module 'threadlib' is in use.
+ dnl Some packages like Emacs use --avoid=threadlib.
+ dnl Write the symbol in such a way that it does not cause 'aclocal' to
pick
+ dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
+ dnl Test whether the functions actually exist.
+ dnl FreeBSD 5.2.1 declares them but does not define them.
+ AC_CACHE_CHECK([for pthread_spin_init],
+ [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD],
+ [gl_saved_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ ]],
+ [[pthread_spinlock_t lock;
+ return pthread_spin_init (&lock, 0);
+ ]])
+ ],
+ [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD=yes],
+ [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD=no])
+ LIBS="$gl_saved_LIBS"
+ ])
+ if test $gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD != yes; then
+ HAVE_PTHREAD_SPIN_INIT=0
+ REPLACE_PTHREAD_SPIN_INIT=1
+ HAVE_PTHREAD_SPIN_LOCK=0
+ REPLACE_PTHREAD_SPIN_LOCK=1
+ HAVE_PTHREAD_SPIN_TRYLOCK=0
+ REPLACE_PTHREAD_SPIN_TRYLOCK=1
+ HAVE_PTHREAD_SPIN_UNLOCK=0
+ REPLACE_PTHREAD_SPIN_UNLOCK=1
+ HAVE_PTHREAD_SPIN_DESTROY=0
+ REPLACE_PTHREAD_SPIN_DESTROY=1
+ fi
+ ], [
+ :
+ ])
+ fi
+ fi
+])
diff --git a/gnulib/m4/pthread_h.m4 b/gnulib/m4/pthread_h.m4
new file mode 100644
index 0000000000..42001213d0
--- /dev/null
+++ b/gnulib/m4/pthread_h.m4
@@ -0,0 +1,292 @@
+# pthread_h.m4
+# serial 11
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_PTHREAD_H_PART1],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_PTHREAD_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PTHREADLIB])
+
+ gl_CHECK_NEXT_HEADERS([pthread.h])
+ if test $ac_cv_header_pthread_h = yes; then
+ HAVE_PTHREAD_H=1
+ dnl On mingw, if --enable-threads=windows or gl_AVOID_WINPTHREAD is used,
+ dnl ignore the <pthread.h> from the mingw-w64 winpthreads library.
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
+ if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \
+ && test $gl_threads_api = windows; then
+ HAVE_PTHREAD_H=0
+ fi
+ ])
+ else
+ HAVE_PTHREAD_H=0
+ fi
+ AC_SUBST([HAVE_PTHREAD_H])
+
+ AC_CHECK_TYPES([pthread_t, pthread_spinlock_t], [], [],
+ [AC_INCLUDES_DEFAULT[
+ #if HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif]])
+ if test $ac_cv_type_pthread_t != yes; then
+ HAVE_PTHREAD_T=0
+ fi
+ if test $ac_cv_type_pthread_spinlock_t != yes; then
+ HAVE_PTHREAD_SPINLOCK_T=0
+ fi
+])
+
+AC_DEFUN([gl_PTHREAD_H],
+[
+ AC_REQUIRE([gl_PTHREAD_H_PART1])
+
+ dnl Set HAVE_PTHREAD_SPIN_INIT, REPLACE_PTHREAD_SPIN_INIT.
+ gl_PTHREAD_SPIN
+
+ dnl Constants may be defined as C preprocessor macros or as enum items.
+
+ AC_CACHE_CHECK([for PTHREAD_CREATE_DETACHED],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_CREATE_DETACHED;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED=yes],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED=no])
+ ])
+ if test $gl_cv_const_PTHREAD_CREATE_DETACHED != yes; then
+ HAVE_PTHREAD_CREATE_DETACHED=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_MUTEX_RECURSIVE],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_MUTEX_RECURSIVE;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=yes],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=no])
+ ])
+ if test $gl_cv_const_PTHREAD_MUTEX_RECURSIVE != yes; then
+ HAVE_PTHREAD_MUTEX_RECURSIVE=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_MUTEX_ROBUST],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_MUTEX_ROBUST;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST=yes],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST=no])
+ ])
+ if test $gl_cv_const_PTHREAD_MUTEX_ROBUST != yes; then
+ HAVE_PTHREAD_MUTEX_ROBUST=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_PROCESS_SHARED],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_PROCESS_SHARED;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED=yes],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED=no])
+ ])
+ if test $gl_cv_const_PTHREAD_PROCESS_SHARED != yes; then
+ HAVE_PTHREAD_PROCESS_SHARED=0
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <pthread.h>
+ ]], [
+ pthread_create pthread_attr_init pthread_attr_getdetachstate
+ pthread_attr_setdetachstate pthread_attr_destroy pthread_self pthread_equal
+ pthread_detach pthread_join pthread_exit
+ pthread_once
+ pthread_mutex_init pthread_mutexattr_init pthread_mutexattr_gettype
+ pthread_mutexattr_settype pthread_mutexattr_getrobust
+ pthread_mutexattr_setrobust pthread_mutexattr_destroy pthread_mutex_lock
+ pthread_mutex_trylock pthread_mutex_timedlock pthread_mutex_unlock
+ pthread_mutex_destroy
+ pthread_rwlock_init pthread_rwlockattr_init pthread_rwlockattr_destroy
+ pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock
+ pthread_rwlock_trywrlock pthread_rwlock_timedrdlock
+ pthread_rwlock_timedwrlock pthread_rwlock_unlock pthread_rwlock_destroy
+ pthread_cond_init pthread_condattr_init pthread_condattr_destroy
+ pthread_cond_wait pthread_cond_timedwait pthread_cond_signal
+ pthread_cond_broadcast pthread_cond_destroy
+ pthread_key_create pthread_setspecific pthread_getspecific
+ pthread_key_delete
+ pthread_spin_init pthread_spin_lock pthread_spin_trylock
pthread_spin_unlock
+ pthread_spin_destroy])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl For backward compatibility with gnulib versions <= 2019-07.
+ LIB_PTHREAD="$LIBPMULTITHREAD"
+ AC_SUBST([LIB_PTHREAD])
+])
+
+# gl_PTHREAD_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_PTHREAD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_PTHREAD_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_THREAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_ONCE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_RWLOCK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_COND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_TSS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SPIN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX_TIMEDLOCK])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_PTHREAD_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_PTHREAD_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T])
+ HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T])
+ HAVE_PTHREAD_CREATE_DETACHED=1;
AC_SUBST([HAVE_PTHREAD_CREATE_DETACHED])
+ HAVE_PTHREAD_MUTEX_RECURSIVE=1;
AC_SUBST([HAVE_PTHREAD_MUTEX_RECURSIVE])
+ HAVE_PTHREAD_MUTEX_ROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEX_ROBUST])
+ HAVE_PTHREAD_PROCESS_SHARED=1;
AC_SUBST([HAVE_PTHREAD_PROCESS_SHARED])
+ HAVE_PTHREAD_CREATE=1; AC_SUBST([HAVE_PTHREAD_CREATE])
+ HAVE_PTHREAD_ATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_ATTR_INIT])
+ HAVE_PTHREAD_ATTR_GETDETACHSTATE=1;
AC_SUBST([HAVE_PTHREAD_ATTR_GETDETACHSTATE])
+ HAVE_PTHREAD_ATTR_SETDETACHSTATE=1;
AC_SUBST([HAVE_PTHREAD_ATTR_SETDETACHSTATE])
+ HAVE_PTHREAD_ATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_ATTR_DESTROY])
+ HAVE_PTHREAD_SELF=1; AC_SUBST([HAVE_PTHREAD_SELF])
+ HAVE_PTHREAD_EQUAL=1; AC_SUBST([HAVE_PTHREAD_EQUAL])
+ HAVE_PTHREAD_DETACH=1; AC_SUBST([HAVE_PTHREAD_DETACH])
+ HAVE_PTHREAD_JOIN=1; AC_SUBST([HAVE_PTHREAD_JOIN])
+ HAVE_PTHREAD_EXIT=1; AC_SUBST([HAVE_PTHREAD_EXIT])
+ HAVE_PTHREAD_ONCE=1; AC_SUBST([HAVE_PTHREAD_ONCE])
+ HAVE_PTHREAD_MUTEX_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEX_INIT])
+ HAVE_PTHREAD_MUTEXATTR_INIT=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_INIT])
+ HAVE_PTHREAD_MUTEXATTR_GETTYPE=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETTYPE])
+ HAVE_PTHREAD_MUTEXATTR_SETTYPE=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETTYPE])
+ HAVE_PTHREAD_MUTEXATTR_GETROBUST=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETROBUST])
+ HAVE_PTHREAD_MUTEXATTR_SETROBUST=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETROBUST])
+ HAVE_PTHREAD_MUTEXATTR_DESTROY=1;
AC_SUBST([HAVE_PTHREAD_MUTEXATTR_DESTROY])
+ HAVE_PTHREAD_MUTEX_LOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_LOCK])
+ HAVE_PTHREAD_MUTEX_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TRYLOCK])
+ HAVE_PTHREAD_MUTEX_TIMEDLOCK=1;
AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK])
+ HAVE_PTHREAD_MUTEX_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_UNLOCK])
+ HAVE_PTHREAD_MUTEX_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEX_DESTROY])
+ HAVE_PTHREAD_RWLOCK_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_INIT])
+ HAVE_PTHREAD_RWLOCKATTR_INIT=1;
AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_INIT])
+ HAVE_PTHREAD_RWLOCKATTR_DESTROY=1;
AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_DESTROY])
+ HAVE_PTHREAD_RWLOCK_RDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_RDLOCK])
+ HAVE_PTHREAD_RWLOCK_WRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_WRLOCK])
+ HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1;
AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYRDLOCK])
+ HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1;
AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYWRLOCK])
+ HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1;
AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+ HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1;
AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+ HAVE_PTHREAD_RWLOCK_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_UNLOCK])
+ HAVE_PTHREAD_RWLOCK_DESTROY=1;
AC_SUBST([HAVE_PTHREAD_RWLOCK_DESTROY])
+ HAVE_PTHREAD_COND_INIT=1; AC_SUBST([HAVE_PTHREAD_COND_INIT])
+ HAVE_PTHREAD_CONDATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_INIT])
+ HAVE_PTHREAD_CONDATTR_DESTROY=1;
AC_SUBST([HAVE_PTHREAD_CONDATTR_DESTROY])
+ HAVE_PTHREAD_COND_WAIT=1; AC_SUBST([HAVE_PTHREAD_COND_WAIT])
+ HAVE_PTHREAD_COND_TIMEDWAIT=1;
AC_SUBST([HAVE_PTHREAD_COND_TIMEDWAIT])
+ HAVE_PTHREAD_COND_SIGNAL=1; AC_SUBST([HAVE_PTHREAD_COND_SIGNAL])
+ HAVE_PTHREAD_COND_BROADCAST=1;
AC_SUBST([HAVE_PTHREAD_COND_BROADCAST])
+ HAVE_PTHREAD_COND_DESTROY=1; AC_SUBST([HAVE_PTHREAD_COND_DESTROY])
+ HAVE_PTHREAD_KEY_CREATE=1; AC_SUBST([HAVE_PTHREAD_KEY_CREATE])
+ HAVE_PTHREAD_SETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_SETSPECIFIC])
+ HAVE_PTHREAD_GETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_GETSPECIFIC])
+ HAVE_PTHREAD_KEY_DELETE=1; AC_SUBST([HAVE_PTHREAD_KEY_DELETE])
+ HAVE_PTHREAD_SPIN_INIT=1; AC_SUBST([HAVE_PTHREAD_SPIN_INIT])
+ HAVE_PTHREAD_SPIN_LOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_LOCK])
+ HAVE_PTHREAD_SPIN_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_TRYLOCK])
+ HAVE_PTHREAD_SPIN_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_UNLOCK])
+ HAVE_PTHREAD_SPIN_DESTROY=1; AC_SUBST([HAVE_PTHREAD_SPIN_DESTROY])
+ REPLACE_PTHREAD_CREATE=0; AC_SUBST([REPLACE_PTHREAD_CREATE])
+ REPLACE_PTHREAD_ATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_ATTR_INIT])
+ REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0;
AC_SUBST([REPLACE_PTHREAD_ATTR_GETDETACHSTATE])
+ REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0;
AC_SUBST([REPLACE_PTHREAD_ATTR_SETDETACHSTATE])
+ REPLACE_PTHREAD_ATTR_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_ATTR_DESTROY])
+ REPLACE_PTHREAD_SELF=0; AC_SUBST([REPLACE_PTHREAD_SELF])
+ REPLACE_PTHREAD_EQUAL=0; AC_SUBST([REPLACE_PTHREAD_EQUAL])
+ REPLACE_PTHREAD_DETACH=0; AC_SUBST([REPLACE_PTHREAD_DETACH])
+ REPLACE_PTHREAD_JOIN=0; AC_SUBST([REPLACE_PTHREAD_JOIN])
+ REPLACE_PTHREAD_EXIT=0; AC_SUBST([REPLACE_PTHREAD_EXIT])
+ REPLACE_PTHREAD_ONCE=0; AC_SUBST([REPLACE_PTHREAD_ONCE])
+ REPLACE_PTHREAD_MUTEX_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_INIT])
+ REPLACE_PTHREAD_MUTEXATTR_INIT=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_INIT])
+ REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETTYPE])
+ REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETTYPE])
+ REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETROBUST])
+ REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETROBUST])
+ REPLACE_PTHREAD_MUTEXATTR_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_DESTROY])
+ REPLACE_PTHREAD_MUTEX_LOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_LOCK])
+ REPLACE_PTHREAD_MUTEX_TRYLOCK=0;
AC_SUBST([REPLACE_PTHREAD_MUTEX_TRYLOCK])
+ REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0;
AC_SUBST([REPLACE_PTHREAD_MUTEX_TIMEDLOCK])
+ REPLACE_PTHREAD_MUTEX_UNLOCK=0;
AC_SUBST([REPLACE_PTHREAD_MUTEX_UNLOCK])
+ REPLACE_PTHREAD_MUTEX_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_MUTEX_DESTROY])
+ REPLACE_PTHREAD_RWLOCK_INIT=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_INIT])
+ REPLACE_PTHREAD_RWLOCKATTR_INIT=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_INIT])
+ REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_DESTROY])
+ REPLACE_PTHREAD_RWLOCK_RDLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_RDLOCK])
+ REPLACE_PTHREAD_RWLOCK_WRLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_WRLOCK])
+ REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYRDLOCK])
+ REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYWRLOCK])
+ REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+ REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+ REPLACE_PTHREAD_RWLOCK_UNLOCK=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_UNLOCK])
+ REPLACE_PTHREAD_RWLOCK_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_RWLOCK_DESTROY])
+ REPLACE_PTHREAD_COND_INIT=0; AC_SUBST([REPLACE_PTHREAD_COND_INIT])
+ REPLACE_PTHREAD_CONDATTR_INIT=0;
AC_SUBST([REPLACE_PTHREAD_CONDATTR_INIT])
+ REPLACE_PTHREAD_CONDATTR_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_CONDATTR_DESTROY])
+ REPLACE_PTHREAD_COND_WAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_WAIT])
+ REPLACE_PTHREAD_COND_TIMEDWAIT=0;
AC_SUBST([REPLACE_PTHREAD_COND_TIMEDWAIT])
+ REPLACE_PTHREAD_COND_SIGNAL=0;
AC_SUBST([REPLACE_PTHREAD_COND_SIGNAL])
+ REPLACE_PTHREAD_COND_BROADCAST=0;
AC_SUBST([REPLACE_PTHREAD_COND_BROADCAST])
+ REPLACE_PTHREAD_COND_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_COND_DESTROY])
+ REPLACE_PTHREAD_KEY_CREATE=0; AC_SUBST([REPLACE_PTHREAD_KEY_CREATE])
+ REPLACE_PTHREAD_SETSPECIFIC=0;
AC_SUBST([REPLACE_PTHREAD_SETSPECIFIC])
+ REPLACE_PTHREAD_GETSPECIFIC=0;
AC_SUBST([REPLACE_PTHREAD_GETSPECIFIC])
+ REPLACE_PTHREAD_KEY_DELETE=0; AC_SUBST([REPLACE_PTHREAD_KEY_DELETE])
+ REPLACE_PTHREAD_SPIN_INIT=0; AC_SUBST([REPLACE_PTHREAD_SPIN_INIT])
+ REPLACE_PTHREAD_SPIN_LOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_LOCK])
+ REPLACE_PTHREAD_SPIN_TRYLOCK=0;
AC_SUBST([REPLACE_PTHREAD_SPIN_TRYLOCK])
+ REPLACE_PTHREAD_SPIN_UNLOCK=0;
AC_SUBST([REPLACE_PTHREAD_SPIN_UNLOCK])
+ REPLACE_PTHREAD_SPIN_DESTROY=0;
AC_SUBST([REPLACE_PTHREAD_SPIN_DESTROY])
+])
diff --git a/gnulib/m4/pthread_rwlock_rdlock.m4
b/gnulib/m4/pthread_rwlock_rdlock.m4
index 7cc650c49d..b8b5b11724 100644
--- a/gnulib/m4/pthread_rwlock_rdlock.m4
+++ b/gnulib/m4/pthread_rwlock_rdlock.m4
@@ -1,5 +1,6 @@
-# pthread_rwlock_rdlock.m4 serial 6
-dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
+# pthread_rwlock_rdlock.m4
+# serial 8
+dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -34,11 +35,11 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
[
- AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([gl_THREADLIB])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
[gl_cv_pthread_rwlock_rdlock_prefer_writer],
- [save_LIBS="$LIBS"
+ [saved_LIBS="$LIBS"
LIBS="$LIBS $LIBMULTITHREAD"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
@@ -174,7 +175,7 @@ main ()
*)
gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
esac
])
- LIBS="$save_LIBS"
+ LIBS="$saved_LIBS"
])
case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
*yes)
diff --git a/gnulib/m4/realloc.m4 b/gnulib/m4/realloc.m4
index fcd6253557..cc91102836 100644
--- a/gnulib/m4/realloc.m4
+++ b/gnulib/m4/realloc.m4
@@ -1,5 +1,6 @@
-# realloc.m4 serial 28
-dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# realloc.m4
+# serial 32
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
[[#include <stdlib.h>
]],
[[void *p = realloc (0, 0);
- int result = !p;
+ void * volatile vp = p;
+ int result = !vp;
free (p);
return result;]])
],
@@ -43,6 +45,11 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
+
+ dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
+ dnl gets defined already before this macro gets invoked. This helps
+ dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise.
+
if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
_AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1])
fi
diff --git a/gnulib/m4/reallocarray.m4 b/gnulib/m4/reallocarray.m4
index 6a5b5ab344..958095e15c 100644
--- a/gnulib/m4/reallocarray.m4
+++ b/gnulib/m4/reallocarray.m4
@@ -1,5 +1,6 @@
-# reallocarray.m4 serial 5
-dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
+# reallocarray.m4
+# serial 5
+dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/regex.m4 b/gnulib/m4/regex.m4
index 20082b89a8..f0101fe67c 100644
--- a/gnulib/m4/regex.m4
+++ b/gnulib/m4/regex.m4
@@ -1,10 +1,9 @@
+# regex.m4
# serial 75
-
-# Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+dnl Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
diff --git a/gnulib/m4/sched_h.m4 b/gnulib/m4/sched_h.m4
new file mode 100644
index 0000000000..61c202ef0c
--- /dev/null
+++ b/gnulib/m4/sched_h.m4
@@ -0,0 +1,101 @@
+# sched_h.m4
+# serial 16
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN_ONCE([gl_SCHED_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([gl_CHECK_HEADER_SYS_CDEFS_H])
+
+ AC_CHECK_HEADERS([sched.h], [], [],
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ ]])
+ gl_NEXT_HEADERS([sched.h])
+
+ if test "$ac_cv_header_sched_h" = yes; then
+ HAVE_SCHED_H=1
+ else
+ HAVE_SCHED_H=0
+ fi
+ AC_SUBST([HAVE_SCHED_H])
+
+ if test "$HAVE_SCHED_H" = 1; then
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ #include <sched.h>
+ ]])
+ else
+ HAVE_STRUCT_SCHED_PARAM=0
+ case "$host_os" in
+ os2*)
+ dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [],
+ [#include <spawn.h>])
+ ;;
+ vms)
+ dnl On OpenVMS 7.2 or newer, struct sched_param is in pthread.h.
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [],
+ [#include <pthread.h>])
+ ;;
+ esac
+ fi
+ AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <sched.h>
+ ]], [sched_yield])
+])
+
+# gl_SCHED_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SCHED_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SCHED_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SCHED_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCHED_YIELD])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SCHED_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_SCHED_YIELD=1; AC_SUBST([HAVE_SCHED_YIELD])
+ REPLACE_SCHED_YIELD=0; AC_SUBST([REPLACE_SCHED_YIELD])
+])
diff --git a/gnulib/m4/setlocale_null.m4 b/gnulib/m4/setlocale_null.m4
index bafc5be8ec..e5b7d28b16 100644
--- a/gnulib/m4/setlocale_null.m4
+++ b/gnulib/m4/setlocale_null.m4
@@ -1,5 +1,6 @@
-# setlocale_null.m4 serial 9
-dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+# setlocale_null.m4
+# serial 9
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/size_max.m4 b/gnulib/m4/size_max.m4
index 0763366dfc..df91cf0629 100644
--- a/gnulib/m4/size_max.m4
+++ b/gnulib/m4/size_max.m4
@@ -1,5 +1,6 @@
-# size_max.m4 serial 12
-dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc.
+# size_max.m4
+# serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/ssize_t.m4 b/gnulib/m4/ssize_t.m4
index 52bd77d2ae..c15f948adb 100644
--- a/gnulib/m4/ssize_t.m4
+++ b/gnulib/m4/ssize_t.m4
@@ -1,5 +1,6 @@
-# ssize_t.m4 serial 6
-dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc.
+# ssize_t.m4
+# serial 6
+dnl Copyright (C) 2001-2003, 2006, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/stat-time.m4 b/gnulib/m4/stat-time.m4
index 40993d5731..e8ee7d5125 100644
--- a/gnulib/m4/stat-time.m4
+++ b/gnulib/m4/stat-time.m4
@@ -1,11 +1,11 @@
-# Checks for stat-related time functions.
-
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software
-# Foundation, Inc.
+# stat-time.m4
+# serial 1
+dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Checks for stat-related time functions.
dnl From Paul Eggert.
diff --git a/gnulib/m4/stat.m4 b/gnulib/m4/stat.m4
index 81bd16a8f4..fabd360c7a 100644
--- a/gnulib/m4/stat.m4
+++ b/gnulib/m4/stat.m4
@@ -1,10 +1,9 @@
-# serial 20
-
-# Copyright (C) 2009-2023 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# stat.m4
+# serial 21
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STAT],
[
@@ -61,8 +60,8 @@ AC_DEFUN([gl_FUNC_STAT],
help when passed a file name with a trailing slash]);;
esac
case $host_os in
- dnl Solaris stat can return a negative tv_nsec.
- solaris*)
+ dnl macOS and Solaris stat can return a negative tv_nsec.
+ darwin* | solaris*)
REPLACE_FSTAT=1 ;;
esac
;;
diff --git a/gnulib/m4/std-gnu11.m4 b/gnulib/m4/std-gnu11.m4
index 4179470ec9..e8d5de7a1e 100644
--- a/gnulib/m4/std-gnu11.m4
+++ b/gnulib/m4/std-gnu11.m4
@@ -1,5 +1,11 @@
+# std-gnu11.m4
+# serial 2
+
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
+# The std-gnu23 module, which defines _AC_C_C23_OPTIONS, supersedes us.
+m4_ifndef([_AC_C_C23_OPTIONS], [
+
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
# commit 017d5ddd82854911f0119691d91ea8a1438824d6
# dated Sun Apr 3 13:57:17 2016 -0700
@@ -9,7 +15,7 @@
m4_version_prereq([2.70], [], [
-# Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,7 +41,7 @@ m4_version_prereq([2.70], [], [
# COMPILER ... is a space separated list of C compilers to search for.
# This just gives the user an opportunity to specify an alternative
# search list for the C compiler.
-AC_DEFUN_ONCE([AC_PROG_CC],
+AC_DEFUN([AC_PROG_CC],
[AC_LANG_PUSH(C)dnl
AC_ARG_VAR([CC], [C compiler command])dnl
AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
@@ -827,3 +833,4 @@ dnl with extended modes being tried first.
])# m4_version_prereq
+])# !_AC_C_C23_OPTIONS
diff --git a/gnulib/m4/stdalign.m4 b/gnulib/m4/stdalign.m4
index 5880efb2eb..1c29d1e4fb 100644
--- a/gnulib/m4/stdalign.m4
+++ b/gnulib/m4/stdalign.m4
@@ -1,10 +1,12 @@
-# Check for alignas and alignof that conform to C23.
-
-dnl Copyright 2011-2023 Free Software Foundation, Inc.
+# stdalign.m4
+# serial 1
+dnl Copyright 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Check for alignas and alignof that conform to C23.
+
dnl Written by Paul Eggert and Bruno Haible.
# Prepare for substituting <stdalign.h> if it is not supported.
@@ -13,10 +15,10 @@ AC_DEFUN([gl_ALIGNASOF],
[
AC_CACHE_CHECK([for alignas and alignof],
[gl_cv_header_working_stdalign_h],
- [gl_save_CFLAGS=$CFLAGS
+ [gl_saved_CFLAGS=$CFLAGS
for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
AS_CASE([$gl_working],
- [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"])
+ [*stdalign.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_STDALIGN_H"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdint.h>
@@ -56,7 +58,7 @@ AC_DEFUN([gl_ALIGNASOF],
[gl_cv_header_working_stdalign_h=$gl_working],
[gl_cv_header_working_stdalign_h=no])
- CFLAGS=$gl_save_CFLAGS
+ CFLAGS=$gl_saved_CFLAGS
test "$gl_cv_header_working_stdalign_h" != no && break
done])
@@ -79,7 +81,7 @@ AC_DEFUN([gl_ALIGNASOF],
References:
ISO C23 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>)
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf>)
sections 6.5.3.4, 6.7.5, 7.15.
C++11 (latest free draft
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
diff --git a/gnulib/m4/stdarg.m4 b/gnulib/m4/stdarg.m4
index 94787ccc5e..980f410413 100644
--- a/gnulib/m4/stdarg.m4
+++ b/gnulib/m4/stdarg.m4
@@ -1,5 +1,6 @@
-# stdarg.m4 serial 8
-dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
+# stdarg.m4
+# serial 8
+dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/stddef_h.m4 b/gnulib/m4/stddef_h.m4
index aa012219fc..c7f75b37fa 100644
--- a/gnulib/m4/stddef_h.m4
+++ b/gnulib/m4/stddef_h.m4
@@ -1,5 +1,6 @@
-# stddef_h.m4 serial 14
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# stddef_h.m4
+# serial 17
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +10,6 @@ dnl A placeholder for <stddef.h>, for platforms that have
issues.
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -51,11 +51,6 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
- if test $gt_cv_c_wchar_t = no; then
- HAVE_WCHAR_T=0
- GL_GENERATE_STDDEF_H=true
- fi
-
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
[gl_cv_decl_null_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -83,6 +78,36 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
+ dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
+ AC_CACHE_CHECK([whether nullptr_t needs <stddef.h>],
+ [gl_cv_nullptr_t_needs_stddef],
+ [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]],
+ [gl_cv_nullptr_t_needs_stddef=no],
+ [gl_cv_nullptr_t_needs_stddef=yes])])
+ if test "$gl_cv_nullptr_t_needs_stddef" = no; then
+ NULLPTR_T_NEEDS_STDDEF=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ AC_CACHE_CHECK([for clean definition of __STDC_VERSION_STDDEF_H__],
+ [gl_cv_clean_version_stddef],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE(
+ [[/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 */
+ #include <stddef.h>
+ #undef __STDC_VERSION_STDDEF_H__
+ #include <time.h>
+ #ifdef __STDC_VERSION_STDDEF_H__
+ # error "<time.h> defines __STDC_VERSION_STDDEF_H__"
+ #endif
+ ]])],
+ [gl_cv_clean_version_stddef=yes],
+ [gl_cv_clean_version_stddef=no])])
+ if test "$gl_cv_clean_version_stddef" = no; then
+ STDDEF_NOT_IDEMPOTENT=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
if $GL_GENERATE_STDDEF_H; then
gl_NEXT_HEADERS([stddef.h])
fi
@@ -113,7 +138,8 @@ AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
AC_DEFUN([gl_STDDEF_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
+ NULLPTR_T_NEEDS_STDDEF=1; AC_SUBST([NULLPTR_T_NEEDS_STDDEF])
+ STDDEF_NOT_IDEMPOTENT=0; AC_SUBST([STDDEF_NOT_IDEMPOTENT])
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
- HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
])
diff --git a/gnulib/m4/stdint.m4 b/gnulib/m4/stdint.m4
index d5ff08b1b8..2dea846914 100644
--- a/gnulib/m4/stdint.m4
+++ b/gnulib/m4/stdint.m4
@@ -1,5 +1,6 @@
-# stdint.m4 serial 63
-dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# stdint.m4
+# serial 63
+dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/stdint_h.m4 b/gnulib/m4/stdint_h.m4
index 70349f6cb2..29f42160b0 100644
--- a/gnulib/m4/stdint_h.m4
+++ b/gnulib/m4/stdint_h.m4
@@ -1,5 +1,6 @@
-# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# stdint_h.m4
+# serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/stdio_h.m4 b/gnulib/m4/stdio_h.m4
index dbfa0d5d61..ec52ae92ff 100644
--- a/gnulib/m4/stdio_h.m4
+++ b/gnulib/m4/stdio_h.m4
@@ -1,5 +1,6 @@
-# stdio_h.m4 serial 63
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# stdio_h.m4
+# serial 75
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -132,6 +133,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
@@ -152,12 +154,14 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_ZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN])
@@ -171,20 +175,29 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZPRINTF])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
diff --git a/gnulib/m4/stdlib_h.m4 b/gnulib/m4/stdlib_h.m4
index f47c1eb37b..332669f946 100644
--- a/gnulib/m4/stdlib_h.m4
+++ b/gnulib/m4/stdlib_h.m4
@@ -1,5 +1,6 @@
-# stdlib_h.m4 serial 75
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# stdlib_h.m4
+# serial 79
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -109,6 +110,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ABORT_DEBUG])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU])
@@ -134,6 +136,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
@@ -143,7 +146,9 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STACK_TRACE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
@@ -204,6 +209,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF])
HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL])
HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
@@ -214,6 +220,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT])
+ REPLACE_ABORT=0; AC_SUBST([REPLACE_ABORT])
REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
REPLACE_CALLOC_FOR_CALLOC_POSIX=0;
AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
@@ -237,6 +244,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
+ REPLACE_RAND=0; AC_SUBST([REPLACE_RAND])
REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
REPLACE_REALLOC_FOR_REALLOC_GNU=0;
AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU])
@@ -246,6 +254,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF])
REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL])
REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL])
@@ -253,4 +262,5 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
+ CAN_PRINT_STACK_TRACE=0; AC_SUBST([CAN_PRINT_STACK_TRACE])
])
diff --git a/gnulib/m4/stpcpy.m4 b/gnulib/m4/stpcpy.m4
index f3acbee7be..c4d71dd9fa 100644
--- a/gnulib/m4/stpcpy.m4
+++ b/gnulib/m4/stpcpy.m4
@@ -1,5 +1,6 @@
-# stpcpy.m4 serial 11
-dnl Copyright (C) 2002, 2007, 2009-2023 Free Software Foundation, Inc.
+# stpcpy.m4
+# serial 11
+dnl Copyright (C) 2002, 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/strcase.m4 b/gnulib/m4/strcase.m4
index 3cf740d234..63021733bd 100644
--- a/gnulib/m4/strcase.m4
+++ b/gnulib/m4/strcase.m4
@@ -1,5 +1,6 @@
-# strcase.m4 serial 12
-dnl Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc.
+# strcase.m4
+# serial 12
+dnl Copyright (C) 2002, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/strcasestr.m4 b/gnulib/m4/strcasestr.m4
index 971e0b2314..811e680ff5 100644
--- a/gnulib/m4/strcasestr.m4
+++ b/gnulib/m4/strcasestr.m4
@@ -1,5 +1,6 @@
-# strcasestr.m4 serial 28
-dnl Copyright (C) 2005, 2007-2023 Free Software Foundation, Inc.
+# strcasestr.m4
+# serial 29
+dnl Copyright (C) 2005, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -97,7 +98,7 @@ static void quit (int sig) { _exit (sig + 128); }
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack strcasestr. */
+ since all such platforms (mingw, MSVC) also lack strcasestr. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
diff --git a/gnulib/m4/strdup.m4 b/gnulib/m4/strdup.m4
index ecfcdd0150..14b1de070b 100644
--- a/gnulib/m4/strdup.m4
+++ b/gnulib/m4/strdup.m4
@@ -1,6 +1,7 @@
-# strdup.m4 serial 15
+# strdup.m4
+# serial 15
-dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/strerror.m4 b/gnulib/m4/strerror.m4
index 0e1f7d73aa..0272c6f4ba 100644
--- a/gnulib/m4/strerror.m4
+++ b/gnulib/m4/strerror.m4
@@ -1,5 +1,6 @@
-# strerror.m4 serial 25
-dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc.
+# strerror.m4
+# serial 25
+dnl Copyright (C) 2002, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/string_h.m4 b/gnulib/m4/string_h.m4
index 7f51391cbf..f31264ae85 100644
--- a/gnulib/m4/string_h.m4
+++ b/gnulib/m4/string_h.m4
@@ -1,11 +1,11 @@
-# Configure a GNU-like replacement for <string.h>.
-
-# Copyright (C) 2007-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# string_h.m4
+# serial 39
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# serial 37
+# Configure a GNU-like replacement for <string.h>.
# Written by Paul Eggert.
@@ -132,6 +132,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
+ REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT])
REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
@@ -146,5 +147,6 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP])
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
])
diff --git a/gnulib/m4/strings_h.m4 b/gnulib/m4/strings_h.m4
index 4c41221b15..aaafb55966 100644
--- a/gnulib/m4/strings_h.m4
+++ b/gnulib/m4/strings_h.m4
@@ -1,10 +1,11 @@
-# Configure a replacement for <strings.h>.
+# strings_h.m4
# serial 9
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Configure a replacement for <strings.h>.
AC_DEFUN_ONCE([gl_STRINGS_H],
[
diff --git a/gnulib/m4/strndup.m4 b/gnulib/m4/strndup.m4
index 9ec9715c79..7a2c5860b8 100644
--- a/gnulib/m4/strndup.m4
+++ b/gnulib/m4/strndup.m4
@@ -1,5 +1,6 @@
-# strndup.m4 serial 23
-dnl Copyright (C) 2002-2003, 2005-2023 Free Software Foundation, Inc.
+# strndup.m4
+# serial 23
+dnl Copyright (C) 2002-2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/strnlen.m4 b/gnulib/m4/strnlen.m4
index d2cac59b6f..83a75c0c32 100644
--- a/gnulib/m4/strnlen.m4
+++ b/gnulib/m4/strnlen.m4
@@ -1,10 +1,60 @@
-# strnlen.m4 serial 14
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
+# strnlen.m4
+# serial 15
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+m4_version_prereq([2.73], [], [
+# Replace AC_FUNC_STRNLEN from Autoconf 2.72 and earlier,
+# which does not check for Android strnlen bugs.
+
+AC_DEFUN([AC_FUNC_STRNLEN],
+[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
+AC_CACHE_CHECK([for working strnlen], [ac_cv_func_strnlen_working],
+[AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ [/* Use pstrnlen to test; 'volatile' prevents the compiler
+ from optimizing the strnlen calls away. */
+ size_t (*volatile pstrnlen) (char const *, size_t) = strnlen;
+ char const s[] = "foobar";
+ int s_len = sizeof s - 1;
+ ]],
+ [[
+ /* AIX 4.3 is buggy: strnlen (S, 1) == 3. */
+ int i;
+ for (i = 0; i < s_len + 1; ++i)
+ {
+ int expected = i <= s_len ? i : s_len;
+ if (pstrnlen (s, i) != expected)
+ return 1;
+ }
+
+ /* Android 5.0 (API 21) strnlen ("", SIZE_MAX) incorrectly crashes. */
+ if (pstrnlen ("", -1) != 0)
+ return 1;]])],
+ [ac_cv_func_strnlen_working=yes],
+ [ac_cv_func_strnlen_working=no],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+ [[#if defined _AIX && !defined _AIX51
+ #error "AIX pre 5.1 is buggy"
+ #endif
+ #ifdef __ANDROID__
+ #include <android/api-level.h>
+ #if __ANDROID_API__ < 22
+ #error "Android API < 22 is buggy"
+ #endif
+ #endif
+ ]])],
+ [ac_cv_func_strnlen_working=yes],
+ [ac_cv_func_strnlen_working=no])])])
+test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])
+])# AC_FUNC_STRNLEN
+])
+
AC_DEFUN([gl_FUNC_STRNLEN],
[
AC_REQUIRE([gl_STRING_H_DEFAULTS])
diff --git a/gnulib/m4/strstr.m4 b/gnulib/m4/strstr.m4
index 7de203a7b7..d19559aa25 100644
--- a/gnulib/m4/strstr.m4
+++ b/gnulib/m4/strstr.m4
@@ -1,5 +1,6 @@
-# strstr.m4 serial 24
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# strstr.m4
+# serial 25
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -94,7 +95,7 @@ static void quit (int sig) { _exit (sig + 128); }
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also have quadratic strstr. */
+ since all such platforms (mingw, MSVC) also have quadratic strstr. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
diff --git a/gnulib/m4/sys_cdefs_h.m4 b/gnulib/m4/sys_cdefs_h.m4
new file mode 100644
index 0000000000..22fa6c3849
--- /dev/null
+++ b/gnulib/m4/sys_cdefs_h.m4
@@ -0,0 +1,25 @@
+# sys_cdefs_h.m4 - Is <sys/cdefs.h> compatible enough with glibc?
+# serial 2
+dnl Copyright 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_CHECK_HEADER_SYS_CDEFS_H],
+ [AC_CACHE_CHECK([for glibc-compatible sys/cdefs.h],
+ [gl_cv_header_sys_cdefs_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_DEFINES_PROVIDED
+ [#include <sys/cdefs.h>
+ enum { foo = __GNUC_PREREQ (14, 1) } bar;
+ ]],
+ [gl_cv_header_sys_cdefs_h=yes],
+ [gl_cv_header_sys_cdefs_h=no])])
+ if test "$gl_cv_header_sys_cdefs_h" = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+ AC_SUBST([HAVE_SYS_CDEFS_H])])
diff --git a/gnulib/m4/sys_random_h.m4 b/gnulib/m4/sys_random_h.m4
index 01d5feebb3..62fd519e36 100644
--- a/gnulib/m4/sys_random_h.m4
+++ b/gnulib/m4/sys_random_h.m4
@@ -1,5 +1,6 @@
-# sys_random_h.m4 serial 8
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# sys_random_h.m4
+# serial 8
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/sys_socket_h.m4 b/gnulib/m4/sys_socket_h.m4
index 98a10416ca..3bf3cb4777 100644
--- a/gnulib/m4/sys_socket_h.m4
+++ b/gnulib/m4/sys_socket_h.m4
@@ -1,5 +1,6 @@
-# sys_socket_h.m4 serial 29
-dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+# sys_socket_h.m4
+# serial 29
+dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/sys_stat_h.m4 b/gnulib/m4/sys_stat_h.m4
index ca57398aeb..3cc50ce677 100644
--- a/gnulib/m4/sys_stat_h.m4
+++ b/gnulib/m4/sys_stat_h.m4
@@ -1,5 +1,6 @@
-# sys_stat_h.m4 serial 42 -*- Autoconf -*-
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# sys_stat_h.m4
+# serial 42 -*- Autoconf -*-
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/sys_types_h.m4 b/gnulib/m4/sys_types_h.m4
index 627671fbdf..7c7f265527 100644
--- a/gnulib/m4/sys_types_h.m4
+++ b/gnulib/m4/sys_types_h.m4
@@ -1,5 +1,6 @@
-# sys_types_h.m4 serial 13
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# sys_types_h.m4
+# serial 14
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -22,6 +23,9 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
dnl Whether to override the 'off_t' type.
AC_REQUIRE([gl_TYPE_OFF_T])
+ dnl Whether to define the 'off64_t' type.
+ AC_REQUIRE([gl_TYPE_OFF64_T])
+
dnl Whether to override the 'dev_t' and 'ino_t' types.
m4_ifdef([gl_WINDOWS_STAT_INODES], [
AC_REQUIRE([gl_WINDOWS_STAT_INODES])
diff --git a/gnulib/m4/tempname.m4 b/gnulib/m4/tempname.m4
index abed7991da..795a9803fd 100644
--- a/gnulib/m4/tempname.m4
+++ b/gnulib/m4/tempname.m4
@@ -1,9 +1,9 @@
-#serial 5
-
-# Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# tempname.m4
+# serial 5
+dnl Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose
# it as a public API, and provide it on systems that are lacking.
diff --git a/gnulib/m4/threadlib.m4 b/gnulib/m4/threadlib.m4
index 303382881a..f5e81479cc 100644
--- a/gnulib/m4/threadlib.m4
+++ b/gnulib/m4/threadlib.m4
@@ -1,5 +1,6 @@
-# threadlib.m4 serial 39
-dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+# threadlib.m4
+# serial 42
+dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -206,7 +207,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
# If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
# needs -pthread for some reason. See:
# https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
- save_LIBS=$LIBS
+ saved_LIBS="$LIBS"
for gl_pthread in '' '-pthread'; do
LIBS="$LIBS $gl_pthread"
AC_LINK_IFELSE(
@@ -220,7 +221,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
[gl_pthread_api=yes
LIBPTHREAD=$gl_pthread
LIBPMULTITHREAD=$gl_pthread])
- LIBS=$save_LIBS
+ LIBS="$saved_LIBS"
test $gl_pthread_api = yes && break
done
echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api"
>&AS_MESSAGE_LOG_FD
@@ -269,6 +270,15 @@ changequote([,])dnl
[Define if the pthread_in_use() detection is hard.])
esac
fi
+ ],
+ [dnl This is needed on FreeBSD 5.2.1.
+ AC_CHECK_LIB([thr], [pthread_kill],
+ [if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lthr
+ fi
+ ])
])
elif test $gl_pthread_api != yes; then
# Some library is needed. Try libpthread and libc_r.
@@ -575,6 +585,10 @@ AC_DEFUN([gl_THREADLIB_BODY],
;;
esac
fi
+ else
+ dnl "$gl_use_threads" is "no".
+ AC_DEFINE([AVOID_ANY_THREADS], [1],
+ [Define if no multithread safety and no multithreading is desired.])
fi
AC_MSG_CHECKING([for multithread API to use])
AC_MSG_RESULT([$gl_threads_api])
diff --git a/gnulib/m4/time_h.m4 b/gnulib/m4/time_h.m4
index 632d18fc07..4ca7305792 100644
--- a/gnulib/m4/time_h.m4
+++ b/gnulib/m4/time_h.m4
@@ -1,12 +1,11 @@
-# Configure a more-standard replacement for <time.h>.
-
-# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
+# time_h.m4
+# serial 26
+dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation,
Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# serial 24
-
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Configure a more-standard replacement for <time.h>.
# Written by Paul Eggert and Jim Meyering.
@@ -146,6 +145,7 @@ AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZNAME])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1])
@@ -175,5 +175,6 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
+ REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES])
REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
])
diff --git a/gnulib/m4/uchar_h.m4 b/gnulib/m4/uchar_h.m4
index 299075f572..bb8801b164 100644
--- a/gnulib/m4/uchar_h.m4
+++ b/gnulib/m4/uchar_h.m4
@@ -1,5 +1,6 @@
-# uchar_h.m4 serial 31
-dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+# uchar_h.m4
+# serial 31
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/unicase_h.m4 b/gnulib/m4/unicase_h.m4
index 86a1b7c47e..20f2d11264 100644
--- a/gnulib/m4/unicase_h.m4
+++ b/gnulib/m4/unicase_h.m4
@@ -1,5 +1,6 @@
-# unicase_h.m4 serial 1
-dnl Copyright (C) 2023 Free Software Foundation, Inc.
+# unicase_h.m4
+# serial 1
+dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/unictype_h.m4 b/gnulib/m4/unictype_h.m4
index bab46356d3..477fec995d 100644
--- a/gnulib/m4/unictype_h.m4
+++ b/gnulib/m4/unictype_h.m4
@@ -1,5 +1,6 @@
-# unictype_h.m4 serial 1
-dnl Copyright (C) 2023 Free Software Foundation, Inc.
+# unictype_h.m4
+# serial 3
+dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -98,6 +99,8 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
+
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
+
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_JOIN_CONTROL_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
@@ -127,6 +130,7 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
+
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
@@ -140,6 +144,7 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
+
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE],
['LIBUNISTRING_DLL_VARIABLE'])
diff --git a/gnulib/m4/uninorm_h.m4 b/gnulib/m4/uninorm_h.m4
index b6b342d8cc..455a360f11 100644
--- a/gnulib/m4/uninorm_h.m4
+++ b/gnulib/m4/uninorm_h.m4
@@ -1,5 +1,6 @@
-# uninorm_h.m4 serial 1
-dnl Copyright (C) 2023 Free Software Foundation, Inc.
+# uninorm_h.m4
+# serial 1
+dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/unistd_h.m4 b/gnulib/m4/unistd_h.m4
index 1c96158155..04fa79c9ca 100644
--- a/gnulib/m4/unistd_h.m4
+++ b/gnulib/m4/unistd_h.m4
@@ -1,5 +1,6 @@
-# unistd_h.m4 serial 94
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# unistd_h.m4
+# serial 96
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -234,6 +235,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP])
REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
+ REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC])
REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
@@ -246,6 +248,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
REPLACE_GETPASS_FOR_GETPASS_GNU=0;
AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU])
+ REPLACE_GETUSERSHELL=0; AC_SUBST([REPLACE_GETUSERSHELL])
REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
diff --git a/gnulib/m4/vararrays.m4 b/gnulib/m4/vararrays.m4
index fd6230c296..9211f69d4d 100644
--- a/gnulib/m4/vararrays.m4
+++ b/gnulib/m4/vararrays.m4
@@ -1,13 +1,13 @@
-# Check for variable-length arrays.
-
+# vararrays.m4
# serial 6
+dnl Copyright (C) 2001, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# From Paul Eggert
+# Check for variable-length arrays.
-# Copyright (C) 2001, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# From Paul Eggert
m4_version_prereq([2.70], [], [
diff --git a/gnulib/m4/vasnprintf.m4 b/gnulib/m4/vasnprintf.m4
index df87b9e798..a02f4e1e1d 100644
--- a/gnulib/m4/vasnprintf.m4
+++ b/gnulib/m4/vasnprintf.m4
@@ -1,13 +1,46 @@
-# vasnprintf.m4 serial 50
-dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc.
+# vasnprintf.m4
+# serial 54
+dnl Copyright (C) 2002-2004, 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_VASNPRINTF],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([vasnprintf])
- if test $ac_cv_func_vasnprintf = no; then
+ if test $ac_cv_func_vasnprintf = yes; then
+ dnl On Cygwin, in directives with a huge width, the width is ignored, and
+ dnl the function returns a wrong result.
+ AC_CACHE_CHECK([whether vasnprintf works],
+ [gl_cv_func_vasnprintf_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <stdio.h>
+ ]],
+ [[size_t len;
+ char *res = vasnprintf (NULL, &len, "x%03000000000dy\n", -17);
+ /* On Cygwin 3.4.6, res is "x-17y\n" and len == 6: wrong. */
+ return (res != NULL && len < 10);
+ ]])
+ ],
+ [gl_cv_func_vasnprintf_works=yes],
+ [gl_cv_func_vasnprintf_works=no],
+ [case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_vasnprintf_works="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vasnprintf_works="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+ fi
+ if test $ac_cv_func_vasnprintf != yes \
+ || case "$gl_cv_func_vasnprintf_works" in
+ *yes) false;;
+ *) true;;
+ esac
+ then
gl_REPLACE_VASNPRINTF
fi
])
@@ -41,7 +74,6 @@ AC_DEFUN([gl_FUNC_VASNWPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
@@ -50,7 +82,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
@@ -94,6 +125,7 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
# Prerequisites of lib/vasnwprintf.c.
AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc])
AC_CHECK_DECLS([_snwprintf], , , [[#include <stdio.h>]])
AC_CHECK_DECLS([wcsnlen], , , [[#include <wchar.h>]])
@@ -183,7 +215,6 @@ int main()
AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS([wcslen])
dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
@@ -367,6 +398,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
esac
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the # flag with a
+# zero precision and a zero value in the 'x' and 'X' directives.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO])
+ case "$gl_cv_func_printf_flag_alt_precision_zero" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_ALT_PRECISION_ZERO], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ # flag with a zero precision and a zero value in the 'x' and 'X'
directives.])
+ ;;
+ esac
+])
+
# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
[
@@ -425,6 +472,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS],
gl_PREREQ_VASNPRINTF_FLAG_GROUPING
gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
gl_PREREQ_VASNPRINTF_FLAG_ZERO
+ gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO
gl_PREREQ_VASNPRINTF_PRECISION
gl_PREREQ_VASNPRINTF_ENOMEM
])
diff --git a/gnulib/m4/vasprintf.m4 b/gnulib/m4/vasprintf.m4
index 6e6156a754..73f7b8073d 100644
--- a/gnulib/m4/vasprintf.m4
+++ b/gnulib/m4/vasprintf.m4
@@ -1,5 +1,6 @@
-# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation,
+# vasprintf.m4
+# serial 6
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gnulib/m4/visibility.m4 b/gnulib/m4/visibility.m4
index f0468e89b5..ecf0968683 100644
--- a/gnulib/m4/visibility.m4
+++ b/gnulib/m4/visibility.m4
@@ -1,5 +1,6 @@
-# visibility.m4 serial 8
-dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
+# visibility.m4
+# serial 9
+dnl Copyright (C) 2005, 2008, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -31,18 +32,18 @@ AC_DEFUN([gl_VISIBILITY],
dnl user has put into $CC $CFLAGS $CPPFLAGS.
AC_CACHE_CHECK([whether the -Werror option is usable],
[gl_cv_cc_vis_werror],
- [gl_save_CFLAGS="$CFLAGS"
+ [gl_saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_vis_werror=yes],
[gl_cv_cc_vis_werror=no])
- CFLAGS="$gl_save_CFLAGS"
+ CFLAGS="$gl_saved_CFLAGS"
])
dnl Now check whether visibility declarations are supported.
AC_CACHE_CHECK([for simple visibility declarations],
[gl_cv_cc_visibility],
- [gl_save_CFLAGS="$CFLAGS"
+ [gl_saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
dnl We use the option -Werror and a function dummyfunc, because on some
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
@@ -68,7 +69,7 @@ AC_DEFUN([gl_VISIBILITY],
[[]])],
[gl_cv_cc_visibility=yes],
[gl_cv_cc_visibility=no])
- CFLAGS="$gl_save_CFLAGS"
+ CFLAGS="$gl_saved_CFLAGS"
])
if test $gl_cv_cc_visibility = yes; then
CFLAG_VISIBILITY="-fvisibility=hidden"
diff --git a/gnulib/m4/warn-on-use.m4 b/gnulib/m4/warn-on-use.m4
index 10649c5cba..6c8c76b883 100644
--- a/gnulib/m4/warn-on-use.m4
+++ b/gnulib/m4/warn-on-use.m4
@@ -1,5 +1,6 @@
-# warn-on-use.m4 serial 10
-dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# warn-on-use.m4
+# serial 11
+dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,7 +37,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead
dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
- ac_save_ac_compile="$ac_compile"
+ ac_saved_ac_compile="$ac_compile"
if test -n "$ac_compile_for_check_decl"; then
ac_compile="$ac_compile_for_check_decl"
fi
@@ -46,7 +47,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
[[#undef $gl_func
(void) $gl_func;]])],
[AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
- ac_compile="$ac_save_ac_compile"
+ ac_compile="$ac_saved_ac_compile"
AS_VAR_IF([gl_Symbol], [yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
dnl Shortcut for an AC_CHECK_DECL invocation that may come later:
diff --git a/gnulib/m4/wchar_h.m4 b/gnulib/m4/wchar_h.m4
index 31f5b0794d..995bdc659d 100644
--- a/gnulib/m4/wchar_h.m4
+++ b/gnulib/m4/wchar_h.m4
@@ -1,13 +1,13 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# wchar_h.m4
+# serial 64
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-dnl Written by Eric Blake.
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-# wchar_h.m4 serial 61
+dnl Written by Eric Blake.
AC_DEFUN_ONCE([gl_WCHAR_H],
[
@@ -86,8 +86,8 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
dnl z/OS when using the XPLINK object format (due to duplicate
dnl CSECT names). Instead, temporarily redefine $ac_compile so
dnl that the object file has the latter name from the start.
- save_ac_compile="$ac_compile"
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ saved_ac_compile="$ac_compile"
+ ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest1/`
if echo '#include "conftest.c"' >conftest1.c \
&& AC_TRY_EVAL([ac_compile]); then
AC_LANG_CONFTEST([
@@ -97,7 +97,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
int zero (void) { return 0; }
]])])
dnl See note above about renaming object files.
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest2/`
if echo '#include "conftest.c"' >conftest2.c \
&& AC_TRY_EVAL([ac_compile]); then
if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS
conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
@@ -107,7 +107,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
fi
fi
fi
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
;;
esac
@@ -186,6 +186,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WGETCWD])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
])
diff --git a/gnulib/m4/wchar_t.m4 b/gnulib/m4/wchar_t.m4
deleted file mode 100644
index 50bde08aec..0000000000
--- a/gnulib/m4/wchar_t.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
- AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';]],
- [[]])],
- [gt_cv_c_wchar_t=yes],
- [gt_cv_c_wchar_t=no])])
- if test $gt_cv_c_wchar_t = yes; then
- AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
- fi
-])
diff --git a/gnulib/m4/wcrtomb.m4 b/gnulib/m4/wcrtomb.m4
index 3152b37563..35dff6f037 100644
--- a/gnulib/m4/wcrtomb.m4
+++ b/gnulib/m4/wcrtomb.m4
@@ -1,5 +1,6 @@
-# wcrtomb.m4 serial 19
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# wcrtomb.m4
+# serial 19
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/wctype.m4 b/gnulib/m4/wctype.m4
index 4f3a836dc5..e5d7074011 100644
--- a/gnulib/m4/wctype.m4
+++ b/gnulib/m4/wctype.m4
@@ -1,5 +1,6 @@
-# wctype.m4 serial 6
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# wctype.m4
+# serial 6
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/wctype_h.m4 b/gnulib/m4/wctype_h.m4
index ac9c35b2da..a3b07c2a23 100644
--- a/gnulib/m4/wctype_h.m4
+++ b/gnulib/m4/wctype_h.m4
@@ -1,8 +1,9 @@
-# wctype_h.m4 serial 33
+# wctype_h.m4
+# serial 33
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/wcwidth.m4 b/gnulib/m4/wcwidth.m4
index e7829e98c8..f2fa198022 100644
--- a/gnulib/m4/wcwidth.m4
+++ b/gnulib/m4/wcwidth.m4
@@ -1,5 +1,6 @@
-# wcwidth.m4 serial 36
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# wcwidth.m4
+# serial 38
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,7 +13,6 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_HEADERS_ONCE([wchar.h])
@@ -41,9 +41,9 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes;
then
HAVE_WCWIDTH=1
dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
- dnl On macOS 12.5, NetBSD 9.0, OpenBSD 5.0, MidnightBSD 1.1,
+ dnl On macOS 12.5, NetBSD 9.3, OpenBSD 5.0, MidnightBSD 1.1,
dnl wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.
- dnl On macOS 12.5, NetBSD 9.0, MidnightBSD 1.1, OSF/1 5.1,
+ dnl On macOS 12.5, NetBSD 9.3, MidnightBSD 1.1, OSF/1 5.1,
dnl wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0.
dnl This leads to bugs in 'ls' (coreutils).
diff --git a/gnulib/m4/wint_t.m4 b/gnulib/m4/wint_t.m4
index dfd743b3a6..883fac28ed 100644
--- a/gnulib/m4/wint_t.m4
+++ b/gnulib/m4/wint_t.m4
@@ -1,5 +1,6 @@
-# wint_t.m4 serial 11
-dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+# wint_t.m4
+# serial 11
+dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/xalloc.m4 b/gnulib/m4/xalloc.m4
index fc56f59a00..d44d0f088a 100644
--- a/gnulib/m4/xalloc.m4
+++ b/gnulib/m4/xalloc.m4
@@ -1,5 +1,6 @@
-# xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
+# xalloc.m4
+# serial 18
+dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/xsize.m4 b/gnulib/m4/xsize.m4
index 649db9c5ea..e5784973e7 100644
--- a/gnulib/m4/xsize.m4
+++ b/gnulib/m4/xsize.m4
@@ -1,5 +1,6 @@
-# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc.
+# xsize.m4
+# serial 5
+dnl Copyright (C) 2003-2004, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gnulib/m4/zzgnulib.m4 b/gnulib/m4/zzgnulib.m4
index 362102b606..710fba4e29 100644
--- a/gnulib/m4/zzgnulib.m4
+++ b/gnulib/m4/zzgnulib.m4
@@ -1,5 +1,6 @@
-# zzgnulib.m4 serial 1
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# zzgnulib.m4
+# serial 1
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/config.rpath b/tp/Texinfo/XS/config.rpath
index 1e2595ff59..58870bd70d 100755
--- a/tp/Texinfo/XS/config.rpath
+++ b/tp/Texinfo/XS/config.rpath
@@ -1,23 +1,15 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
+# run time search path of shared libraries in a binary (executable or
+# shared library).
#
-# Copyright 1996-2023 Free Software Foundation, Inc.
+# Copyright 1996-2024 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-#
-# The first argument passed to this file is the canonical host specification,
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
@@ -25,6 +17,81 @@
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
+# func_usage
+# outputs to stdout the --help usage message.
+func_usage ()
+{
+ echo "\
+Usage: config.rpath [OPTION] HOST
+
+Prints shell variable assignments that describe how to hardcode a directory
+for the lookup of shared libraries into a binary (executable or shared
library).
+
+The first argument passed to this file is the canonical host specification,
+ CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+or
+ CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+
+The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+should be set by the caller.
+
+The set of defined variables is at the end of this script.
+
+Options:
+ --help print this help and exit
+ --version print version information and exit
+
+Send patches and bug reports to <bug-gnulib@gnu.org>."
+}
+
+# func_version
+# outputs to stdout the --version message.
+func_version ()
+{
+ echo "config.rpath (GNU gnulib, module havelib)"
+ echo "Copyright (C) 2024 Free Software Foundation, Inc.
+License: All-Permissive.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law."
+ echo
+ printf 'Written by %s.\n' "Bruno Haible"
+}
+
+# func_fatal_error message
+# outputs to stderr a fatal error message, and terminates the program.
+func_fatal_error ()
+{
+ echo "config.rpath: *** $1" 1>&2
+ echo "config.rpath: *** Stop." 1>&2
+ exit 1
+}
+
+# Command-line option processing.
+while test $# -gt 0; do
+ case "$1" in
+ --help | --hel | --he | --h )
+ func_usage
+ exit 0 ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v )
+ func_version
+ exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ -* )
+ func_fatal_error "unrecognized option: $1"
+ ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# -gt 1; then
+ func_fatal_error "too many arguments"
+fi
+if test $# -lt 1; then
+ func_fatal_error "too few arguments"
+fi
+
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
diff --git a/tp/Texinfo/XS/gnulib/lib/Makefile.am
b/tp/Texinfo/XS/gnulib/lib/Makefile.am
index 9436b44fb5..674a4e319f 100644
--- a/tp/Texinfo/XS/gnulib/lib/Makefile.am
+++ b/tp/Texinfo/XS/gnulib/lib/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -49,6 +49,7 @@ SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES =
+pkgdata_DATA =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
@@ -267,6 +268,7 @@ SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e
1G
SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+# is its recipe's first line if and only if @NMD@ lines are absent.
gl_V_at = $(AM_V_GEN)
## end gnulib module gen-header
@@ -305,7 +307,7 @@ V_GPERF_0 = @echo " GPERF " $@;
## begin gnulib module havelib
-EXTRA_DIST += $(top_srcdir)/./config.rpath
+EXTRA_DIST += $(top_srcdir)/config.rpath
## end gnulib module havelib
@@ -353,25 +355,48 @@ libgnu_la_SOURCES += iconv.c iconv_close.c
endif
$(srcdir)/iconv_open-aix.h: $(srcdir)/iconv_open-aix.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf >
$(srcdir)/iconv_open-aix.h-t && \
- mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf >
$(srcdir)/iconv_open-aix.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-aix\.gperf\([
"]\)|\1iconv_open-aix.gperf\2|' \
+ < $(srcdir)/iconv_open-aix.h-t1 > $(srcdir)/iconv_open-aix.h-t2 \
+ && rm -f $(srcdir)/iconv_open-aix.h-t1 \
+ && mv $(srcdir)/iconv_open-aix.h-t2 $(srcdir)/iconv_open-aix.h
$(srcdir)/iconv_open-hpux.h: $(srcdir)/iconv_open-hpux.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf >
$(srcdir)/iconv_open-hpux.h-t && \
- mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf >
$(srcdir)/iconv_open-hpux.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-hpux\.gperf\([
"]\)|\1iconv_open-hpux.gperf\2|' \
+ < $(srcdir)/iconv_open-hpux.h-t1 >
$(srcdir)/iconv_open-hpux.h-t2 \
+ && rm -f $(srcdir)/iconv_open-hpux.h-t1 \
+ && mv $(srcdir)/iconv_open-hpux.h-t2 $(srcdir)/iconv_open-hpux.h
$(srcdir)/iconv_open-irix.h: $(srcdir)/iconv_open-irix.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf >
$(srcdir)/iconv_open-irix.h-t && \
- mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf >
$(srcdir)/iconv_open-irix.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-irix\.gperf\([
"]\)|\1iconv_open-irix.gperf\2|' \
+ < $(srcdir)/iconv_open-irix.h-t1 >
$(srcdir)/iconv_open-irix.h-t2 \
+ && rm -f $(srcdir)/iconv_open-irix.h-t1 \
+ && mv $(srcdir)/iconv_open-irix.h-t2 $(srcdir)/iconv_open-irix.h
$(srcdir)/iconv_open-osf.h: $(srcdir)/iconv_open-osf.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf >
$(srcdir)/iconv_open-osf.h-t && \
- mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf >
$(srcdir)/iconv_open-osf.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-osf\.gperf\([
"]\)|\1iconv_open-osf.gperf\2|' \
+ < $(srcdir)/iconv_open-osf.h-t1 > $(srcdir)/iconv_open-osf.h-t2 \
+ && rm -f $(srcdir)/iconv_open-osf.h-t1 \
+ && mv $(srcdir)/iconv_open-osf.h-t2 $(srcdir)/iconv_open-osf.h
$(srcdir)/iconv_open-solaris.h: $(srcdir)/iconv_open-solaris.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf >
$(srcdir)/iconv_open-solaris.h-t && \
- mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf >
$(srcdir)/iconv_open-solaris.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-solaris\.gperf\([
"]\)|\1iconv_open-solaris.gperf\2|' \
+ < $(srcdir)/iconv_open-solaris.h-t1 >
$(srcdir)/iconv_open-solaris.h-t2 \
+ && rm -f $(srcdir)/iconv_open-solaris.h-t1 \
+ && mv $(srcdir)/iconv_open-solaris.h-t2 $(srcdir)/iconv_open-solaris.h
$(srcdir)/iconv_open-zos.h: $(srcdir)/iconv_open-zos.gperf
- $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-zos.gperf >
$(srcdir)/iconv_open-zos.h-t && \
- mv $(srcdir)/iconv_open-zos.h-t $(srcdir)/iconv_open-zos.h
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-zos.gperf >
$(srcdir)/iconv_open-zos.h-t1 \
+ && sed -e 's|\([ "]\)[^ "]*/iconv_open-zos\.gperf\([
"]\)|\1iconv_open-zos.gperf\2|' \
+ < $(srcdir)/iconv_open-zos.h-t1 > $(srcdir)/iconv_open-zos.h-t2 \
+ && rm -f $(srcdir)/iconv_open-zos.h-t1 \
+ && mv $(srcdir)/iconv_open-zos.h-t2 $(srcdir)/iconv_open-zos.h
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h
iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
-MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t
iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t iconv_open-zos.h-t
+MOSTLYCLEANFILES += iconv_open-aix.h-t1 iconv_open-aix.h-t2 \
+ iconv_open-hpux.h-t1 iconv_open-hpux.h-t2 \
+ iconv_open-irix.h-t1 iconv_open-irix.h-t2 \
+ iconv_open-osf.h-t1 iconv_open-osf.h-t2 \
+ iconv_open-solaris.h-t1 iconv_open-solaris.h-t2 \
+ iconv_open-zos.h-t1 iconv_open-zos.h-t2
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h
iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h
iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
@@ -495,11 +520,28 @@ EXTRA_DIST += memchr.valgrind
## begin gnulib module obstack
+BUILT_SOURCES += $(OBSTACK_H)
+
+# We need the following in order to create <obstack.h> when the system
+# doesn't have one that works with any size object.
+if GL_GENERATE_OBSTACK_H
+obstack.h: obstack.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''REPLACE_OBSTACK''@|$(REPLACE_OBSTACK)|g' \
+ -e 's|@''SMALL_PTRDIFF_T''@|$(SMALL_PTRDIFF_T)|g' \
+ $(srcdir)/obstack.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+obstack.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += obstack.h obstack.h-t
+
if GL_COND_OBJ_OBSTACK
libgnu_la_SOURCES += obstack.c
endif
-EXTRA_DIST += obstack.h
+EXTRA_DIST += obstack.in.h
## end gnulib module obstack
@@ -602,9 +644,10 @@ stddef.h: stddef.in.h $(top_builddir)/config.status
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
- -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
- -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''NULLPTR_T_NEEDS_STDDEF''@|$(NULLPTR_T_NEEDS_STDDEF)|g' \
+ -e 's|@''STDDEF_NOT_IDEMPOTENT''@|$(STDDEF_NOT_IDEMPOTENT)|g' \
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
$(srcdir)/stddef.in.h > $@-t
$(AM_V_at)mv $@-t $@
else
@@ -679,6 +722,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_DZPRINTF''@/$(GL_GNULIB_DZPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
@@ -699,12 +743,14 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_FZPRINTF''@/$(GL_GNULIB_FZPRINTF)/g' \
-e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
-e
's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e
's/@''GNULIB_OBSTACK_ZPRINTF''@/$(GL_GNULIB_OBSTACK_ZPRINTF)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
@@ -718,20 +764,29 @@ stdio.h: stdio.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SNZPRINTF''@/$(GL_GNULIB_SNZPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
-e
's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
-e
's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SZPRINTF''@/$(GL_GNULIB_SZPRINTF)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VASZPRINTF''@/$(GL_GNULIB_VASZPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VDZPRINTF''@/$(GL_GNULIB_VDZPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFZPRINTF''@/$(GL_GNULIB_VFZPRINTF)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSNZPRINTF''@/$(GL_GNULIB_VSNZPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSZPRINTF''@/$(GL_GNULIB_VSZPRINTF)/g' \
+ -e 's/@''GNULIB_VZPRINTF''@/$(GL_GNULIB_VZPRINTF)/g' \
+ -e 's/@''GNULIB_ZPRINTF''@/$(GL_GNULIB_ZPRINTF)/g' \
-e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
-e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
-e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
@@ -829,6 +884,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ABORT_DEBUG''@/$(GL_GNULIB_ABORT_DEBUG)/g' \
-e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
-e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
-e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
@@ -854,6 +910,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
-e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
-e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RAND''@/$(GL_GNULIB_RAND)/g' \
-e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
-e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
-e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
@@ -863,7 +920,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
-e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STACK_TRACE''@/$(GL_GNULIB_STACK_TRACE)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOF''@/$(GL_GNULIB_STRTOF)/g' \
-e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
-e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
@@ -916,6 +975,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
-e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOF''@|$(HAVE_STRTOF)|g' \
-e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
-e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
@@ -928,6 +988,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
< $@-t1 > $@-t2
$(AM_V_at)sed \
-e 's|@''REPLACE__EXIT''@|$(REPLACE__EXIT)|g' \
+ -e 's|@''REPLACE_ABORT''@|$(REPLACE_ABORT)|g' \
-e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
-e
's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
-e
's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
@@ -951,6 +1012,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RAND''@|$(REPLACE_RAND)|g' \
-e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e
's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
@@ -960,6 +1022,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOF''@|$(REPLACE_STRTOF)|g' \
-e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
-e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
-e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
@@ -967,6 +1030,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) \
-e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e 's|@''CAN_PRINT_STACK_TRACE''@|$(CAN_PRINT_STACK_TRACE)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -1000,9 +1064,7 @@ EXTRA_DIST += streq.h
## begin gnulib module striconveh
libgnu_la_SOURCES += striconveh.h striconveh.c
-if GL_COND_LIBTOOL
libgnu_la_LDFLAGS += $(LTLIBICONV)
-endif
EXTRA_DIST += iconveh.h
@@ -1103,6 +1165,7 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
+ -e 's|@''REPLACE_MEMSET_EXPLICIT''@|$(REPLACE_MEMSET_EXPLICIT)|g'
\
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
@@ -1118,6 +1181,7 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
-e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g'
\
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRVERSCMP''@|$(REPLACE_STRVERSCMP)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -1162,10 +1226,12 @@ sys/types.h: sys_types.in.h
$(top_builddir)/config.status
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''HAVE_OFF64_T''@|$(HAVE_OFF64_T)|g' \
-e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
$(srcdir)/sys_types.in.h > $@-t
$(AM_V_at)mv $@-t $@
MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+MOSTLYCLEANDIRS += sys
EXTRA_DIST += sys_types.in.h
@@ -1370,6 +1436,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
-e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
-e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_FDATASYNC''@|$(REPLACE_FDATASYNC)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
@@ -1382,6 +1449,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
-e
's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_GETUSERSHELL''@|$(REPLACE_GETUSERSHELL)|g' \
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -1617,6 +1685,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
-e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
-e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_WGETCWD''@/$(GL_GNULIB_WGETCWD)/g' \
-e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
< $(srcdir)/wchar.in.h > $@-t1
diff --git a/tp/Texinfo/XS/gnulib/lib/_Noreturn.h
b/tp/Texinfo/XS/gnulib/lib/_Noreturn.h
index 6ecea98b54..9806f2b1a0 100644
--- a/tp/Texinfo/XS/gnulib/lib/_Noreturn.h
+++ b/tp/Texinfo/XS/gnulib/lib/_Noreturn.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that a function does not return.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -34,7 +34,7 @@
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
- && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __clang__
\
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))))
diff --git a/tp/Texinfo/XS/gnulib/lib/alignof.h
b/tp/Texinfo/XS/gnulib/lib/alignof.h
index a790972763..581aaee9bc 100644
--- a/tp/Texinfo/XS/gnulib/lib/alignof.h
+++ b/tp/Texinfo/XS/gnulib/lib/alignof.h
@@ -1,5 +1,5 @@
/* Determine alignment of types.
- Copyright (C) 2003-2004, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/alloca.in.h
b/tp/Texinfo/XS/gnulib/lib/alloca.in.h
index a1bb3d758d..6aa47df8ec 100644
--- a/tp/Texinfo/XS/gnulib/lib/alloca.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/arg-nonnull.h
b/tp/Texinfo/XS/gnulib/lib/arg-nonnull.h
index 9498ae1f7d..46c711ca1a 100644
--- a/tp/Texinfo/XS/gnulib/lib/arg-nonnull.h
+++ b/tp/Texinfo/XS/gnulib/lib/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/tp/Texinfo/XS/gnulib/lib/asnprintf.c
b/tp/Texinfo/XS/gnulib/lib/asnprintf.c
index f4861bf845..a6c09bc205 100644
--- a/tp/Texinfo/XS/gnulib/lib/asnprintf.c
+++ b/tp/Texinfo/XS/gnulib/lib/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/asprintf.c
b/tp/Texinfo/XS/gnulib/lib/asprintf.c
index ba58e06481..b0c334788a 100644
--- a/tp/Texinfo/XS/gnulib/lib/asprintf.c
+++ b/tp/Texinfo/XS/gnulib/lib/asprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2007, 2009-2023 Free Software Foundation,
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/assert.in.h
b/tp/Texinfo/XS/gnulib/lib/assert.in.h
index b0ab99c776..6e4995e145 100644
--- a/tp/Texinfo/XS/gnulib/lib/assert.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/assert.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <assert.h>
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/attribute.h
b/tp/Texinfo/XS/gnulib/lib/attribute.h
index e4e36092b0..186faa5526 100644
--- a/tp/Texinfo/XS/gnulib/lib/attribute.h
+++ b/tp/Texinfo/XS/gnulib/lib/attribute.h
@@ -1,6 +1,6 @@
/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
- Copyright 2020-2023 Free Software Foundation, Inc.
+ Copyright 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,12 +20,49 @@
/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
macros used within Gnulib. */
-/* These attributes can be placed in two ways:
- - At the start of a declaration (i.e. even before storage-class
- specifiers!); then they apply to all entities that are declared
- by the declaration.
- - Immediately after the name of an entity being declared by the
- declaration; then they apply to that entity only. */
+/* The placement of these attributes depends on the kind of declaration
+ and, in some cases, also on the programming language (C vs. C++).
+
+ In function declarations and function definitions:
+
+ * ATTRIBUTE_NOTHROW must come after the parameter list.
+
+ * The macros
+ ATTRIBUTE_CONST
+ ATTRIBUTE_PURE
+ DEPRECATED
+ MAYBE_UNUSED
+ NODISCARD
+ REPRODUCIBLE
+ UNSEQUENCED
+ must come before the return type, and more precisely:
+ - In a function declaration/definition without a storage-class
+ specifier: at the beginning of the declaration/definition.
+ - In a function declaration/definition with a storage-class
+ specifier:
+ - In C: before the storage-class specifier.
+ - In C++: between the storage-class specifier and the return type.
+
+ * The other macros can be placed
+ - Either
+ - In a function declaration/definition without a storage-class
+ specifier: at the beginning of the declaration/definition.
+ - In a function declaration/definition with a storage-class
+ specifier: between the storage-class specifier and the return
+ type.
+ - Or after the parameter list,
+ ∙ but after ATTRIBUTE_NOTHROW if present.
+
+ In other declarations, such as variable declarations:
+
+ * Either
+ - In C: before the storage-class specifier.
+ - In C++: between the storage-class specifier and the return type.
+ Then they apply to all entities that are declared by the declaration.
+
+ * Or immediately after the name of an entity being declared by the
+ declaration. Then they apply to that entity only.
+ */
#ifndef _GL_ATTRIBUTE_H
#define _GL_ATTRIBUTE_H
@@ -49,8 +86,9 @@
_GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED,
_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL,
_GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED,
- _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL,
- _GL_ATTRIBUTE_SENTINEL. */
+ _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL, _GL_ATTRIBUTE_SENTINEL,
+ _GL_ATTRIBUTE_UNSEQUENCED. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -88,7 +126,7 @@
is the size of the returned memory block.
ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
to determine the size of the returned memory block. */
-/* Applies to: function, pointer to function, function types. */
+/* Applies to: functions, pointer to functions, function types. */
#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
/* ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
@@ -170,7 +208,7 @@
/* Attributes regarding debugging information emitted by the compiler. */
/* Omit the function from stack traces when debugging. */
-/* Applies to: function. */
+/* Applies to: functions. */
#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */
@@ -192,25 +230,64 @@
/* Always inline the function, and report an error if the compiler
cannot inline. */
-/* Applies to: function. */
+/* Applies to: functions. */
#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
-/* It is OK for a compiler to omit duplicate calls with the same arguments.
+/* It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used.
This attribute is safe for a function that neither depends on
- nor affects observable state, and always returns exactly once -
- e.g., does not loop forever, and does not call longjmp.
- (This attribute is stricter than ATTRIBUTE_PURE.) */
+ nor affects state, and always returns exactly once -
+ e.g., does not raise an exception, call longjmp, or loop forever.
+ (This attribute is stricter than ATTRIBUTE_PURE because the
+ function cannot observe state. It is stricter than UNSEQUENCED
+ because the function must return exactly once and cannot depend on
+ state addressed by its arguments.) */
/* Applies to: functions. */
#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
-/* It is OK for a compiler to omit duplicate calls with the same
- arguments if observable state is not changed between calls.
- This attribute is safe for a function that does not affect
- observable state, and always returns exactly once.
- (This attribute is looser than ATTRIBUTE_CONST.) */
+/* It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same.
+ This attribute is safe for a function that is effectless, idempotent,
+ stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of
+ these terms.
+ (This attribute is stricter than REPRODUCIBLE because the function
+ must be stateless and independent. It is looser than ATTRIBUTE_CONST
+ because the function need not return exactly once and can depend
+ on state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function type. */
+#define UNSEQUENCED _GL_ATTRIBUTE_UNSEQUENCED
+
+/* It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used, and if observable state is the same.
+ This attribute is safe for a function that does not affect observable state
+ and always returns exactly once.
+ (This attribute is looser than ATTRIBUTE_CONST because the function
+ can depend on observable state. It is stricter than REPRODUCIBLE
+ because the function must return exactly once and cannot affect
+ state addressed by its arguments.) */
/* Applies to: functions. */
#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+/* It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same and is updated in time for
+ the rest of the program.
+ This attribute is safe for a function that is effectless and idempotent; see
+ ISO C 23 § 6.7.12.7 for a definition of these terms.
+ (This attribute is looser than UNSEQUENCED because the function need
+ not be stateless and idempotent. It is looser than ATTRIBUTE_PURE
+ because the function need not return exactly once and can affect
+ state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function type. */
+#define REPRODUCIBLE _GL_ATTRIBUTE_REPRODUCIBLE
+
/* The function is rarely executed. */
/* Applies to: functions. */
#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
diff --git a/tp/Texinfo/XS/gnulib/lib/c++defs.h
b/tp/Texinfo/XS/gnulib/lib/c++defs.h
index 458c014de5..7082af3fc2 100644
--- a/tp/Texinfo/XS/gnulib/lib/c++defs.h
+++ b/tp/Texinfo/XS/gnulib/lib/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -93,11 +93,22 @@
# define _GL_EXTERN_C extern
#endif
-/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+/* _GL_EXTERN_C_FUNC declaration;
+ performs the declaration of a function with C linkage. */
+#if defined __cplusplus
+# define _GL_EXTERN_C_FUNC extern "C"
+#else
+/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
+ are not allowed between 'extern' and the return type (see gnulib-common.m4).
+ */
+# define _GL_EXTERN_C_FUNC
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
- _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
@@ -105,21 +116,27 @@
because
[[...]] extern "C" <declaration>;
is invalid syntax in C++.)
+
+ Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
+ of the _GL_FUNCDECL_RPL invocation, at the end of the declaration.
*/
-#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
- _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
-#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
- _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
+ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
+ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
-/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
- _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
+
+ Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
+ of the _GL_FUNCDECL_SYS invocation, at the end of the declaration.
*/
-#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
- _GL_EXTERN_C rettype func parameters_and_attributes
+#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
+ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
/* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
@@ -297,7 +314,7 @@
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func
# else
diff --git a/tp/Texinfo/XS/gnulib/lib/c-ctype.c
b/tp/Texinfo/XS/gnulib/lib/c-ctype.c
index a4343f445f..d3f1b12d5a 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-ctype.c
+++ b/tp/Texinfo/XS/gnulib/lib/c-ctype.c
@@ -1,6 +1,6 @@
/* Character handling in C locale.
- Copyright (C) 2003-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/c-ctype.h
b/tp/Texinfo/XS/gnulib/lib/c-ctype.h
index cb0f4f3ba1..b582de4a7f 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-ctype.h
+++ b/tp/Texinfo/XS/gnulib/lib/c-ctype.h
@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
- Copyright (C) 2000-2003, 2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2006, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/c-strcase.h
b/tp/Texinfo/XS/gnulib/lib/c-strcase.h
index 5dfa96c41f..b75e8dd1cb 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-strcase.h
+++ b/tp/Texinfo/XS/gnulib/lib/c-strcase.h
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison functions in C locale.
- Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2023 Free Software
+ Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/c-strcasecmp.c
b/tp/Texinfo/XS/gnulib/lib/c-strcasecmp.c
index 8a958dc4fd..1fa575a856 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-strcasecmp.c
+++ b/tp/Texinfo/XS/gnulib/lib/c-strcasecmp.c
@@ -1,5 +1,5 @@
/* c-strcasecmp.c -- case insensitive string comparator in C locale
- Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/c-strcaseeq.h
b/tp/Texinfo/XS/gnulib/lib/c-strcaseeq.h
index 1d0759a56d..0348c559ca 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-strcaseeq.h
+++ b/tp/Texinfo/XS/gnulib/lib/c-strcaseeq.h
@@ -1,5 +1,5 @@
/* Optimized case-insensitive string comparison in C locale.
- Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -19,6 +19,11 @@
#include "c-strcase.h"
#include "c-ctype.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* STRCASEEQ allows to optimize string comparison with a small literal string.
STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0)
is semantically equivalent to
@@ -179,3 +184,8 @@ strcaseeq0 (const char *s1, const char *s2, char s20, char
s21, char s22, char s
(c_strcasecmp (s1, s2) == 0)
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/c-strncasecmp.c
b/tp/Texinfo/XS/gnulib/lib/c-strncasecmp.c
index 4ca8c5f400..4c8b0b6b84 100644
--- a/tp/Texinfo/XS/gnulib/lib/c-strncasecmp.c
+++ b/tp/Texinfo/XS/gnulib/lib/c-strncasecmp.c
@@ -1,5 +1,5 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale
- Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/errno.in.h
b/tp/Texinfo/XS/gnulib/lib/errno.in.h
index 3dda9c260e..18eb8a0c58 100644
--- a/tp/Texinfo/XS/gnulib/lib/errno.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -133,7 +133,7 @@
/* These are intentionally the same values as the WSA* error numbers, defined
in <winsock2.h>. */
-# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
+# define ESOCKTNOSUPPORT 10044
# define EPFNOSUPPORT 10046 /* not required by POSIX */
# define ESHUTDOWN 10058 /* not required by POSIX */
# define ETOOMANYREFS 10059 /* not required by POSIX */
@@ -270,10 +270,17 @@
# define GNULIB_defined_ENOTRECOVERABLE 1
# endif
+/* On LynxOS, the macro EILSEQ is not defined. */
# ifndef EILSEQ
# define EILSEQ 2015
# define GNULIB_defined_EILSEQ 1
# endif
+/* On Haiku, the macro ESOCKTNOSUPPORT is not defined. */
+# ifndef ESOCKTNOSUPPORT
+# define ESOCKTNOSUPPORT 2016
+# define GNULIB_defined_ESOCKTNOSUPPORT 1
+# endif
+
#endif /* _@GUARD_PREFIX@_ERRNO_H */
#endif /* _@GUARD_PREFIX@_ERRNO_H */
diff --git a/tp/Texinfo/XS/gnulib/lib/exitfail.c
b/tp/Texinfo/XS/gnulib/lib/exitfail.c
index d67a130c05..8a5962e82f 100644
--- a/tp/Texinfo/XS/gnulib/lib/exitfail.c
+++ b/tp/Texinfo/XS/gnulib/lib/exitfail.c
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/exitfail.h
b/tp/Texinfo/XS/gnulib/lib/exitfail.h
index 85a6af64ad..fa264b5c8c 100644
--- a/tp/Texinfo/XS/gnulib/lib/exitfail.h
+++ b/tp/Texinfo/XS/gnulib/lib/exitfail.h
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -15,4 +15,14 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern int volatile exit_failure;
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/float+.h
b/tp/Texinfo/XS/gnulib/lib/float+.h
index e7531e46a3..104f477faa 100644
--- a/tp/Texinfo/XS/gnulib/lib/float+.h
+++ b/tp/Texinfo/XS/gnulib/lib/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/float.c b/tp/Texinfo/XS/gnulib/lib/float.c
index f81ff33d3b..7a563048e2 100644
--- a/tp/Texinfo/XS/gnulib/lib/float.c
+++ b/tp/Texinfo/XS/gnulib/lib/float.c
@@ -1,5 +1,5 @@
/* Auxiliary definitions for <float.h>.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
@@ -20,14 +20,101 @@
/* Specification. */
#include <float.h>
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined
__linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+#if GNULIB_defined_long_double_union
+# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined
__linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
const union gl_long_double_union gl_LDBL_MAX =
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
-#elif defined __i386__
+# elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
-#else
+# endif
+# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* We can't even simply evaluate the formula (LDBL_MIN /
9223372036854775808.0L)
+ at run time, because it would require BEGIN_LONG_DOUBLE_ROUNDING /
+ END_LONG_DOUBLE_ROUNDING invocations. It simpler to just write down the
+ representation of LDBL_TRUE_MIN, based on
+
<https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>.
*/
+const union gl_long_double_union gl_LDBL_TRUE_MIN =
+ { { 0x00000001, 0x00000000, 0 } };
+# endif
+#endif
+
+#if GNULIB_defined_FLT_SNAN
+/* Define like memory_positive_SNaNf(), see signed-snan.h and snan.h,
+ or like setpayloadsigf() with an arbitrary payload. */
+gl_FLT_SNAN_t gl_FLT_SNAN =
+# if FLT_MANT_DIG == 24
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 8 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FE00000U } }
+# else
+ /* sign bit: 0, 8 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FA00000U } }
+# endif
+# endif
+ ;
+#endif
+
+#if GNULIB_defined_DBL_SNAN
+/* Define like memory_positive_SNaNd(), see signed-snan.h and snan.h,
+ or like setpayloadsig() with an arbitrary payload. */
+gl_DBL_SNAN_t gl_DBL_SNAN =
+# if DBL_MANT_DIG == 53
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FFC000000000000ULL } }
+# else
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FF4000000000000ULL } }
+# endif
+# endif
+ ;
+#endif
+
+#if GNULIB_defined_LDBL_SNAN
+# ifdef WORDS_BIGENDIAN
+# define TWO(hi,lo) { hi, lo }
+# else
+# define TWO(hi,lo) { lo, hi }
+# endif
+/* Define like memory_positive_SNaNl(), see signed-snan.h and snan.h,
+ or like setpayloadsigl() with an arbitrary payload. */
+gl_LDBL_SNAN_t gl_LDBL_SNAN =
+# if LDBL_MANT_DIG == 53 /* on arm, hppa, mips, sh, but also MSVC */
+# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined
__sh__
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { { 0x7FFC000000000000ULL } }
+# else
+ /* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FF4000000000000ULL } }
+# endif
+# elif LDBL_MANT_DIG == 64 /* on i386, x86_64, ia64, m68k */
+# if defined __m68k__
+ /* sign bit: 0, 15 exponent bits: all 1, 16 gap bits: all 0,
+ always=1 bit: 1, next bit: 0, payload: 0b10...0 */
+ { { 0x7FFF0000ULL, 0xA0000000ULL, 0x00000000ULL } }
+# else
+ /* sign bit: 0, 15 exponent bits: all 1, always=1 bit: 1, next bit: 0,
payload: 0b10...0
+ (see
<https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>)
*/
+ { TWO (0x00007FFFULL, 0xA000000000000000ULL) }
+# endif
+# elif LDBL_MANT_DIG == 106 /* on powerpc, powerpc64, powerpc64le */
+ /* most-significant double:
+ sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0,
+ least-significant double: 0.0 */
+ { { 0x7FF4000000000000ULL, 0ULL } }
+# elif LDBL_MANT_DIG == 113 /* on alpha, arm64, loongarch64, mips64, riscv64,
s390x, sparc64 */
+# if (defined __mips__ && !MIPS_NAN2008_FLOAT)
+ /* sign bit: 0, 15 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
+ { TWO (0x7FFFC00000000000ULL, 0ULL) }
+# else
+ /* sign bit: 0, 15 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
+ { TWO (0x7FFF400000000000ULL, 0ULL) }
+# endif
+# endif
+ ;
+#endif
+
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
-#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/float.in.h
b/tp/Texinfo/XS/gnulib/lib/float.in.h
index bf2c502c7f..5e78b4f296 100644
--- a/tp/Texinfo/XS/gnulib/lib/float.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -28,6 +28,8 @@
#ifndef _@GUARD_PREFIX@_FLOAT_H
#define _@GUARD_PREFIX@_FLOAT_H
+/* ============================ ISO C99 support ============================ */
+
/* 'long double' properties. */
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
@@ -179,6 +181,156 @@ extern const union gl_long_double_union gl_LDBL_MAX;
# endif
#endif
+/* ============================ ISO C11 support ============================ */
+
+/* 'float' properties */
+
+#ifndef FLT_HAS_SUBNORM
+# define FLT_HAS_SUBNORM 1
+#endif
+#ifndef FLT_DECIMAL_DIG
+/* FLT_MANT_DIG = 24 => FLT_DECIMAL_DIG = 9 */
+# define FLT_DECIMAL_DIG ((int)(FLT_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#if defined _AIX && !defined __GNUC__
+/* On AIX, the value of FLT_TRUE_MIN in /usr/include/float.h is a 'double',
+ not a 'float'. */
+# undef FLT_TRUE_MIN
+#endif
+#ifndef FLT_TRUE_MIN
+/* FLT_MIN / 2^(FLT_MANT_DIG-1) */
+# define FLT_TRUE_MIN (FLT_MIN / 8388608.0f)
+#endif
+
+/* 'double' properties */
+
+#ifndef DBL_HAS_SUBNORM
+# define DBL_HAS_SUBNORM 1
+#endif
+#ifndef DBL_DECIMAL_DIG
+/* DBL_MANT_DIG = 53 => DBL_DECIMAL_DIG = 17 */
+# define DBL_DECIMAL_DIG ((int)(DBL_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#ifndef DBL_TRUE_MIN
+/* DBL_MIN / 2^(DBL_MANT_DIG-1) */
+# define DBL_TRUE_MIN (DBL_MIN / 4503599627370496.0)
+#endif
+
+/* 'long double' properties */
+
+#ifndef LDBL_HAS_SUBNORM
+# define LDBL_HAS_SUBNORM 1
+#endif
+#ifndef LDBL_DECIMAL_DIG
+/* LDBL_MANT_DIG = 53 => LDBL_DECIMAL_DIG = 17 */
+/* LDBL_MANT_DIG = 64 => LDBL_DECIMAL_DIG = 21 */
+/* LDBL_MANT_DIG = 106 => LDBL_DECIMAL_DIG = 33 */
+/* LDBL_MANT_DIG = 113 => LDBL_DECIMAL_DIG = 36 */
+# define LDBL_DECIMAL_DIG ((int)(LDBL_MANT_DIG * 0.3010299956639812 + 2))
+#endif
+#ifndef LDBL_TRUE_MIN
+/* LDBL_MIN / 2^(LDBL_MANT_DIG-1) */
+# if LDBL_MANT_DIG == 53
+# define LDBL_TRUE_MIN (LDBL_MIN / 4503599627370496.0L)
+# elif LDBL_MANT_DIG == 64
+# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* Work around FreeBSD/x86 problem mentioned above. */
+extern const union gl_long_double_union gl_LDBL_TRUE_MIN;
+# define LDBL_TRUE_MIN (gl_LDBL_TRUE_MIN.ld)
+# else
+# define LDBL_TRUE_MIN (LDBL_MIN / 9223372036854775808.0L)
+# endif
+# elif LDBL_MANT_DIG == 106
+# define LDBL_TRUE_MIN (LDBL_MIN / 40564819207303340847894502572032.0L)
+# elif LDBL_MANT_DIG == 113
+# define LDBL_TRUE_MIN (LDBL_MIN / 5192296858534827628530496329220096.0L)
+# endif
+#endif
+
+/* ============================ ISO C23 support ============================ */
+
+/* 'float' properties */
+
+#ifndef FLT_IS_IEC_60559
+# if defined __m68k__
+# define FLT_IS_IEC_60559 0
+# else
+# define FLT_IS_IEC_60559 1
+# endif
+#endif
+#ifndef FLT_NORM_MAX
+# define FLT_NORM_MAX FLT_MAX
+#endif
+#ifndef FLT_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define FLT_SNAN __builtin_nansf ("")
+# else
+typedef union { unsigned int word[1]; float value; } gl_FLT_SNAN_t;
+extern gl_FLT_SNAN_t gl_FLT_SNAN;
+# define FLT_SNAN (gl_FLT_SNAN.value)
+# define GNULIB_defined_FLT_SNAN 1
+# endif
+#endif
+
+/* 'double' properties */
+
+#ifndef DBL_IS_IEC_60559
+# if defined __m68k__
+# define DBL_IS_IEC_60559 0
+# else
+# define DBL_IS_IEC_60559 1
+# endif
+#endif
+#ifndef DBL_NORM_MAX
+# define DBL_NORM_MAX DBL_MAX
+#endif
+#ifndef DBL_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define DBL_SNAN __builtin_nans ("")
+# else
+typedef union { unsigned long long word[1]; double value; } gl_DBL_SNAN_t;
+extern gl_DBL_SNAN_t gl_DBL_SNAN;
+# define DBL_SNAN (gl_DBL_SNAN.value)
+# define GNULIB_defined_DBL_SNAN 1
+# endif
+#endif
+
+/* 'long double' properties */
+
+#ifndef LDBL_IS_IEC_60559
+# if defined __m68k__
+# define LDBL_IS_IEC_60559 0
+# elif LDBL_MANT_DIG == 53 || LDBL_MANT_DIG == 113
+# define LDBL_IS_IEC_60559 1
+# else
+# define LDBL_IS_IEC_60559 0
+# endif
+#endif
+#ifndef LDBL_NORM_MAX
+# define LDBL_NORM_MAX LDBL_MAX
+#endif
+#ifndef LDBL_SNAN
+/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
+# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined
__sh__
+# define LDBL_SNAN __builtin_nansl ("")
+# else
+# if LDBL_MANT_DIG == 53
+typedef union { unsigned long long word[1]; long double value; }
gl_LDBL_SNAN_t;
+# elif defined __m68k__
+typedef union { unsigned int word[3]; long double value; } gl_LDBL_SNAN_t;
+# else
+typedef union { unsigned long long word[2]; long double value; }
gl_LDBL_SNAN_t;
+# endif
+extern gl_LDBL_SNAN_t gl_LDBL_SNAN;
+# define LDBL_SNAN (gl_LDBL_SNAN.value)
+# define GNULIB_defined_LDBL_SNAN 1
+# endif
+#endif
+
+/* ================================= Other ================================= */
+
#if @REPLACE_ITOLD@
/* Pull in a function that fixes the 'int' to 'long double' conversion
of glibc 2.7. */
diff --git a/tp/Texinfo/XS/gnulib/lib/free.c b/tp/Texinfo/XS/gnulib/lib/free.c
index 372a6b0fec..2f0c40ba89 100644
--- a/tp/Texinfo/XS/gnulib/lib/free.c
+++ b/tp/Texinfo/XS/gnulib/lib/free.c
@@ -1,6 +1,6 @@
/* Make free() preserve errno.
- Copyright (C) 2003, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/getdelim.c
b/tp/Texinfo/XS/gnulib/lib/getdelim.c
index e414df648f..58063b156e 100644
--- a/tp/Texinfo/XS/gnulib/lib/getdelim.c
+++ b/tp/Texinfo/XS/gnulib/lib/getdelim.c
@@ -1,5 +1,5 @@
/* getdelim.c --- Implementation of replacement getdelim function.
- Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2023 Free Software
+ Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/getline.c
b/tp/Texinfo/XS/gnulib/lib/getline.c
index 85f16ab8ba..2d03b64689 100644
--- a/tp/Texinfo/XS/gnulib/lib/getline.c
+++ b/tp/Texinfo/XS/gnulib/lib/getline.c
@@ -1,5 +1,5 @@
/* getline.c --- Implementation of replacement getline function.
- Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/gettext.h
b/tp/Texinfo/XS/gnulib/lib/gettext.h
index d0462c47e1..39d5ae4daa 100644
--- a/tp/Texinfo/XS/gnulib/lib/gettext.h
+++ b/tp/Texinfo/XS/gnulib/lib/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv.c b/tp/Texinfo/XS/gnulib/lib/iconv.c
index 9f6f7a90f1..310f4043eb 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv.c
+++ b/tp/Texinfo/XS/gnulib/lib/iconv.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 1999-2001, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2001, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv.in.h
b/tp/Texinfo/XS/gnulib/lib/iconv.in.h
index 56de44ca93..da6dc2ebd6 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <iconv.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -48,7 +48,7 @@
# define iconv_open rpl_iconv_open
# endif
_GL_FUNCDECL_RPL (iconv_open, iconv_t,
- (const char *tocode, const char *fromcode)
+ (const char *tocode, const char *fromcode),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (iconv_open, iconv_t,
(const char *tocode, const char *fromcode));
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_close.c
b/tp/Texinfo/XS/gnulib/lib/iconv_close.c
index 41ea96e792..692cbb84f7 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_close.c
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_close.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.gperf
index c1625d1d5d..55cccd0320 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.h
index 85ed7674ba..d584307cdd 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-aix.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */
+/* Command-line: gperf -m 10 iconv_open-aix.gperf */
/* Computed positions: -k'4,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-aix.gperf"
+#line 17 "iconv_open-aix.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 32
@@ -156,74 +156,74 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 59 "./iconv_open-aix.gperf"
+#line 59 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
-#line 58 "./iconv_open-aix.gperf"
+#line 58 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
-#line 41 "./iconv_open-aix.gperf"
+#line 41 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
-#line 57 "./iconv_open-aix.gperf"
+#line 57 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
-#line 30 "./iconv_open-aix.gperf"
+#line 30 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
-#line 43 "./iconv_open-aix.gperf"
+#line 43 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
-#line 40 "./iconv_open-aix.gperf"
+#line 40 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
-#line 35 "./iconv_open-aix.gperf"
+#line 35 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
-#line 49 "./iconv_open-aix.gperf"
+#line 49 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
-#line 56 "./iconv_open-aix.gperf"
+#line 56 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
-#line 60 "./iconv_open-aix.gperf"
+#line 60 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
-#line 39 "./iconv_open-aix.gperf"
+#line 39 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
{-1},
-#line 33 "./iconv_open-aix.gperf"
+#line 33 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
-#line 38 "./iconv_open-aix.gperf"
+#line 38 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
-#line 31 "./iconv_open-aix.gperf"
+#line 31 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
-#line 47 "./iconv_open-aix.gperf"
+#line 47 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
-#line 51 "./iconv_open-aix.gperf"
+#line 51 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
-#line 36 "./iconv_open-aix.gperf"
+#line 36 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
-#line 42 "./iconv_open-aix.gperf"
+#line 42 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
-#line 53 "./iconv_open-aix.gperf"
+#line 53 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
-#line 34 "./iconv_open-aix.gperf"
+#line 34 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
-#line 45 "./iconv_open-aix.gperf"
+#line 45 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
-#line 48 "./iconv_open-aix.gperf"
+#line 48 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
-#line 55 "./iconv_open-aix.gperf"
+#line 55 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
-#line 37 "./iconv_open-aix.gperf"
+#line 37 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
{-1},
-#line 50 "./iconv_open-aix.gperf"
+#line 50 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
-#line 32 "./iconv_open-aix.gperf"
+#line 32 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
-#line 29 "./iconv_open-aix.gperf"
+#line 29 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
{-1}, {-1},
-#line 54 "./iconv_open-aix.gperf"
+#line 54 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
{-1},
-#line 46 "./iconv_open-aix.gperf"
+#line 46 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
-#line 52 "./iconv_open-aix.gperf"
+#line 52 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
{-1}, {-1},
-#line 44 "./iconv_open-aix.gperf"
+#line 44 "iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.gperf
index 691995c83b..ddf51e30fc 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.h
index fe3c28932f..bc027b931d 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-hpux.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */
+/* Command-line: gperf -m 10 iconv_open-hpux.gperf */
/* Computed positions: -k'4,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-hpux.gperf"
+#line 17 "iconv_open-hpux.gperf"
struct mapping { int standard_name; const char vendor_name[9 + 1]; };
#define TOTAL_KEYWORDS 44
@@ -180,93 +180,93 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 56 "./iconv_open-hpux.gperf"
+#line 56 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
-#line 50 "./iconv_open-hpux.gperf"
+#line 50 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
-#line 51 "./iconv_open-hpux.gperf"
+#line 51 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
-#line 39 "./iconv_open-hpux.gperf"
+#line 39 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
-#line 65 "./iconv_open-hpux.gperf"
+#line 65 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
-#line 54 "./iconv_open-hpux.gperf"
+#line 54 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
-#line 32 "./iconv_open-hpux.gperf"
+#line 32 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
-#line 69 "./iconv_open-hpux.gperf"
+#line 69 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
-#line 29 "./iconv_open-hpux.gperf"
+#line 29 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
-#line 35 "./iconv_open-hpux.gperf"
+#line 35 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
-#line 55 "./iconv_open-hpux.gperf"
+#line 55 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
-#line 70 "./iconv_open-hpux.gperf"
+#line 70 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
-#line 41 "./iconv_open-hpux.gperf"
+#line 41 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
-#line 57 "./iconv_open-hpux.gperf"
+#line 57 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
-#line 68 "./iconv_open-hpux.gperf"
+#line 68 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
-#line 42 "./iconv_open-hpux.gperf"
+#line 42 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
-#line 31 "./iconv_open-hpux.gperf"
+#line 31 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
-#line 36 "./iconv_open-hpux.gperf"
+#line 36 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
-#line 47 "./iconv_open-hpux.gperf"
+#line 47 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
-#line 33 "./iconv_open-hpux.gperf"
+#line 33 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
-#line 43 "./iconv_open-hpux.gperf"
+#line 43 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
-#line 48 "./iconv_open-hpux.gperf"
+#line 48 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
-#line 49 "./iconv_open-hpux.gperf"
+#line 49 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
-#line 45 "./iconv_open-hpux.gperf"
+#line 45 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
-#line 52 "./iconv_open-hpux.gperf"
+#line 52 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
-#line 37 "./iconv_open-hpux.gperf"
+#line 37 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
-#line 40 "./iconv_open-hpux.gperf"
+#line 40 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
-#line 38 "./iconv_open-hpux.gperf"
+#line 38 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
-#line 46 "./iconv_open-hpux.gperf"
+#line 46 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
-#line 67 "./iconv_open-hpux.gperf"
+#line 67 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
-#line 30 "./iconv_open-hpux.gperf"
+#line 30 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
-#line 71 "./iconv_open-hpux.gperf"
+#line 71 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
-#line 58 "./iconv_open-hpux.gperf"
+#line 58 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
-#line 72 "./iconv_open-hpux.gperf"
+#line 72 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
-#line 64 "./iconv_open-hpux.gperf"
+#line 64 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
-#line 59 "./iconv_open-hpux.gperf"
+#line 59 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
-#line 62 "./iconv_open-hpux.gperf"
+#line 62 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
-#line 66 "./iconv_open-hpux.gperf"
+#line 66 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
-#line 34 "./iconv_open-hpux.gperf"
+#line 34 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
-#line 63 "./iconv_open-hpux.gperf"
+#line 63 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
-#line 61 "./iconv_open-hpux.gperf"
+#line 61 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
-#line 60 "./iconv_open-hpux.gperf"
+#line 60 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
-#line 44 "./iconv_open-hpux.gperf"
+#line 44 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
-#line 53 "./iconv_open-hpux.gperf"
+#line 53 "iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.gperf
index a6b84f91f3..cd0ad544af 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.h
index 9eec045703..9ebe29e3dd 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-irix.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */
+/* Command-line: gperf -m 10 iconv_open-irix.gperf */
/* Computed positions: -k'1,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-irix.gperf"
+#line 17 "iconv_open-irix.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 19
@@ -130,43 +130,43 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1},
-#line 40 "./iconv_open-irix.gperf"
+#line 40 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
-#line 45 "./iconv_open-irix.gperf"
+#line 45 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
-#line 44 "./iconv_open-irix.gperf"
+#line 44 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
-#line 41 "./iconv_open-irix.gperf"
+#line 41 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
-#line 46 "./iconv_open-irix.gperf"
+#line 46 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
-#line 33 "./iconv_open-irix.gperf"
+#line 33 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
-#line 38 "./iconv_open-irix.gperf"
+#line 38 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
-#line 29 "./iconv_open-irix.gperf"
+#line 29 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
-#line 43 "./iconv_open-irix.gperf"
+#line 43 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
-#line 39 "./iconv_open-irix.gperf"
+#line 39 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
-#line 30 "./iconv_open-irix.gperf"
+#line 30 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
-#line 42 "./iconv_open-irix.gperf"
+#line 42 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
-#line 37 "./iconv_open-irix.gperf"
+#line 37 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
-#line 36 "./iconv_open-irix.gperf"
+#line 36 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
-#line 35 "./iconv_open-irix.gperf"
+#line 35 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
-#line 34 "./iconv_open-irix.gperf"
+#line 34 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
-#line 32 "./iconv_open-irix.gperf"
+#line 32 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
-#line 31 "./iconv_open-irix.gperf"
+#line 31 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
-#line 47 "./iconv_open-irix.gperf"
+#line 47 "iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.gperf
index 9cffd4802e..417f7e3ec4 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.h
index cf23c0832a..a85846f6c4 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-osf.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */
+/* Command-line: gperf -m 10 iconv_open-osf.gperf */
/* Computed positions: -k'4,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-osf.gperf"
+#line 17 "iconv_open-osf.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 38
@@ -168,84 +168,84 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 57 "./iconv_open-osf.gperf"
+#line 57 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
-#line 40 "./iconv_open-osf.gperf"
+#line 40 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
-#line 52 "./iconv_open-osf.gperf"
+#line 52 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
-#line 63 "./iconv_open-osf.gperf"
+#line 63 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
-#line 62 "./iconv_open-osf.gperf"
+#line 62 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
-#line 66 "./iconv_open-osf.gperf"
+#line 66 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
-#line 33 "./iconv_open-osf.gperf"
+#line 33 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
-#line 38 "./iconv_open-osf.gperf"
+#line 38 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
-#line 64 "./iconv_open-osf.gperf"
+#line 64 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
-#line 43 "./iconv_open-osf.gperf"
+#line 43 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
-#line 60 "./iconv_open-osf.gperf"
+#line 60 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
-#line 41 "./iconv_open-osf.gperf"
+#line 41 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
-#line 47 "./iconv_open-osf.gperf"
+#line 47 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
-#line 61 "./iconv_open-osf.gperf"
+#line 61 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
-#line 59 "./iconv_open-osf.gperf"
+#line 59 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
-#line 58 "./iconv_open-osf.gperf"
+#line 58 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
-#line 36 "./iconv_open-osf.gperf"
+#line 36 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
-#line 65 "./iconv_open-osf.gperf"
+#line 65 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
{-1},
-#line 37 "./iconv_open-osf.gperf"
+#line 37 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
-#line 35 "./iconv_open-osf.gperf"
+#line 35 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
-#line 34 "./iconv_open-osf.gperf"
+#line 34 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
{-1},
-#line 44 "./iconv_open-osf.gperf"
+#line 44 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
-#line 54 "./iconv_open-osf.gperf"
+#line 54 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
-#line 49 "./iconv_open-osf.gperf"
+#line 49 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
-#line 51 "./iconv_open-osf.gperf"
+#line 51 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
-#line 48 "./iconv_open-osf.gperf"
+#line 48 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
-#line 39 "./iconv_open-osf.gperf"
+#line 39 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
-#line 53 "./iconv_open-osf.gperf"
+#line 53 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
-#line 30 "./iconv_open-osf.gperf"
+#line 30 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
-#line 56 "./iconv_open-osf.gperf"
+#line 56 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
-#line 50 "./iconv_open-osf.gperf"
+#line 50 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
-#line 42 "./iconv_open-osf.gperf"
+#line 42 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
-#line 55 "./iconv_open-osf.gperf"
+#line 55 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
-#line 29 "./iconv_open-osf.gperf"
+#line 29 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
-#line 46 "./iconv_open-osf.gperf"
+#line 46 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
-#line 32 "./iconv_open-osf.gperf"
+#line 32 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
{-1}, {-1},
-#line 31 "./iconv_open-osf.gperf"
+#line 31 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
-#line 45 "./iconv_open-osf.gperf"
+#line 45 "iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.gperf
index c522683356..d5411de0c1 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009, 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2020-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.h
index b38b16c849..07233dfdc4 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-solaris.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */
+/* Command-line: gperf -m 10 iconv_open-solaris.gperf */
/* Computed positions: -k'10' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-solaris.gperf"
+#line 17 "iconv_open-solaris.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 13
@@ -132,32 +132,32 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1},
-#line 35 "./iconv_open-solaris.gperf"
+#line 35 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "646"},
-#line 46 "./iconv_open-solaris.gperf"
+#line 46 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
-#line 34 "./iconv_open-solaris.gperf"
+#line 34 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7},
{-1}, {-1},
-#line 36 "./iconv_open-solaris.gperf"
+#line 36 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
-#line 45 "./iconv_open-solaris.gperf"
+#line 45 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
-#line 44 "./iconv_open-solaris.gperf"
+#line 44 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
-#line 43 "./iconv_open-solaris.gperf"
+#line 43 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
-#line 42 "./iconv_open-solaris.gperf"
+#line 42 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
-#line 41 "./iconv_open-solaris.gperf"
+#line 41 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
-#line 40 "./iconv_open-solaris.gperf"
+#line 40 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
-#line 39 "./iconv_open-solaris.gperf"
+#line 39 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
-#line 38 "./iconv_open-solaris.gperf"
+#line 38 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
-#line 37 "./iconv_open-solaris.gperf"
+#line 37 "iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.gperf
b/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.gperf
index f188e1392d..a7fc3dc7c1 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.gperf
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.h
b/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.h
index 5f847251f6..38e3e29b00 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open-zos.h
@@ -1,5 +1,5 @@
/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -m 10 ./iconv_open-zos.gperf */
+/* Command-line: gperf -m 10 iconv_open-zos.gperf */
/* Computed positions: -k'4,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -29,7 +29,7 @@
#error "gperf generated tables don't work with this execution character set.
Please report a bug to <bug-gperf@gnu.org>."
#endif
-#line 17 "./iconv_open-zos.gperf"
+#line 17 "iconv_open-zos.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 49
@@ -201,108 +201,108 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1},
-#line 76 "./iconv_open-zos.gperf"
+#line 76 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str3, "IBM-1386"},
{-1},
-#line 28 "./iconv_open-zos.gperf"
+#line 28 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "00367"},
{-1},
-#line 68 "./iconv_open-zos.gperf"
+#line 68 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-5349"},
-#line 75 "./iconv_open-zos.gperf"
+#line 75 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-eucKR"},
-#line 72 "./iconv_open-zos.gperf"
+#line 72 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "09449"},
-#line 48 "./iconv_open-zos.gperf"
+#line 48 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "00857"},
-#line 36 "./iconv_open-zos.gperf"
+#line 36 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "05012"},
-#line 31 "./iconv_open-zos.gperf"
+#line 31 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "00913"},
-#line 38 "./iconv_open-zos.gperf"
+#line 38 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-13"},
-#line 35 "./iconv_open-zos.gperf"
+#line 35 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
-#line 42 "./iconv_open-zos.gperf"
+#line 42 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-437"},
-#line 63 "./iconv_open-zos.gperf"
+#line 63 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "01129"},
-#line 54 "./iconv_open-zos.gperf"
+#line 54 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-869"},
-#line 37 "./iconv_open-zos.gperf"
+#line 37 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-9"},
-#line 56 "./iconv_open-zos.gperf"
+#line 56 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "IBM-922"},
-#line 67 "./iconv_open-zos.gperf"
+#line 67 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "IBM-5348"},
-#line 45 "./iconv_open-zos.gperf"
+#line 45 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "IBM-852"},
-#line 65 "./iconv_open-zos.gperf"
+#line 65 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-5346"},
-#line 44 "./iconv_open-zos.gperf"
+#line 44 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "09042"},
-#line 50 "./iconv_open-zos.gperf"
+#line 50 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "IBM-862"},
-#line 30 "./iconv_open-zos.gperf"
+#line 30 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-2"},
-#line 57 "./iconv_open-zos.gperf"
+#line 57 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-943"},
-#line 73 "./iconv_open-zos.gperf"
+#line 73 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "IBM-eucCN"},
-#line 70 "./iconv_open-zos.gperf"
+#line 70 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "09447"},
-#line 46 "./iconv_open-zos.gperf"
+#line 46 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "13143"},
-#line 40 "./iconv_open-zos.gperf"
+#line 40 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "00878"},
-#line 62 "./iconv_open-zos.gperf"
+#line 62 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "IBM-1125"},
-#line 52 "./iconv_open-zos.gperf"
+#line 52 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "00865"},
-#line 33 "./iconv_open-zos.gperf"
+#line 33 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "ISO8859-5"},
-#line 39 "./iconv_open-zos.gperf"
+#line 39 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-15"},
-#line 71 "./iconv_open-zos.gperf"
+#line 71 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "09448"},
-#line 47 "./iconv_open-zos.gperf"
+#line 47 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "IBM-856"},
-#line 41 "./iconv_open-zos.gperf"
+#line 41 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "01168"},
-#line 69 "./iconv_open-zos.gperf"
+#line 69 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-5350"},
-#line 53 "./iconv_open-zos.gperf"
+#line 53 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "04962"},
-#line 34 "./iconv_open-zos.gperf"
+#line 34 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "ISO8859-6"},
-#line 61 "./iconv_open-zos.gperf"
+#line 61 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
-#line 51 "./iconv_open-zos.gperf"
+#line 51 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "IBM-864"},
-#line 32 "./iconv_open-zos.gperf"
+#line 32 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
-#line 66 "./iconv_open-zos.gperf"
+#line 66 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-5347"},
-#line 43 "./iconv_open-zos.gperf"
+#line 43 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "00775"},
-#line 58 "./iconv_open-zos.gperf"
+#line 58 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "IBM-943"},
-#line 64 "./iconv_open-zos.gperf"
+#line 64 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "01131"},
-#line 49 "./iconv_open-zos.gperf"
+#line 49 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "IBM-861"},
-#line 29 "./iconv_open-zos.gperf"
+#line 29 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "ISO8859-1"},
-#line 74 "./iconv_open-zos.gperf"
+#line 74 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str50, "01350"},
{-1},
-#line 59 "./iconv_open-zos.gperf"
+#line 59 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str52, "IBM-1363"},
{-1}, {-1},
-#line 55 "./iconv_open-zos.gperf"
+#line 55 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str55, "TIS-620"},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 60 "./iconv_open-zos.gperf"
+#line 60 "iconv_open-zos.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str64, "IBM-1046"}
};
diff --git a/tp/Texinfo/XS/gnulib/lib/iconv_open.c
b/tp/Texinfo/XS/gnulib/lib/iconv_open.c
index be70de2b7b..2be02eff9e 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconv_open.c
+++ b/tp/Texinfo/XS/gnulib/lib/iconv_open.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/iconveh.h
b/tp/Texinfo/XS/gnulib/lib/iconveh.h
index 2220d36e19..c607373411 100644
--- a/tp/Texinfo/XS/gnulib/lib/iconveh.h
+++ b/tp/Texinfo/XS/gnulib/lib/iconveh.h
@@ -1,5 +1,5 @@
/* Character set conversion handler type.
- Copyright (C) 2001-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/idx.h b/tp/Texinfo/XS/gnulib/lib/idx.h
index 23020b7ec0..43793f2d62 100644
--- a/tp/Texinfo/XS/gnulib/lib/idx.h
+++ b/tp/Texinfo/XS/gnulib/lib/idx.h
@@ -1,5 +1,5 @@
/* A type for indices and sizes.
- Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -111,6 +111,11 @@
help producing good code and good warnings. The type 'idx_t' could
then be typedef'ed to a range type that is signed after promotion. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* In the future, idx_t could be typedef'ed to a signed range type.
The clang "extended integer types", supported in Clang 11 or newer
<https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
@@ -131,4 +136,9 @@ typedef ptrdiff_t idx_t;
Perhaps there should be another macro IDX_VALUE_BITS that does not
count the sign bit and is therefore one less than PTRDIFF_WIDTH. */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _IDX_H */
diff --git a/tp/Texinfo/XS/gnulib/lib/intprops-internal.h
b/tp/Texinfo/XS/gnulib/lib/intprops-internal.h
index 41039a093b..c8cc0e2019 100644
--- a/tp/Texinfo/XS/gnulib/lib/intprops-internal.h
+++ b/tp/Texinfo/XS/gnulib/lib/intprops-internal.h
@@ -1,6 +1,6 @@
/* intprops-internal.h -- properties of integer types not visible to users
- Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -21,7 +21,7 @@
#include <limits.h>
/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wtype-limits"
#endif
@@ -163,13 +163,15 @@
#if _GL_HAS_BUILTIN_MUL_OVERFLOW
# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
|| (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
- && !defined __EDG__)
+ && !defined __clang__ && !defined __EDG__)
# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
# else
/* Work around GCC bug 91450. */
# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) &&
_GL_EXPR_SIGNED (b) \
- && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+ && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, \
+ (__typeof__ (*(r))) 0, \
+ (__typeof__ (*(r))) -1)) \
? ((void) __builtin_mul_overflow (a, b, r), 1) \
: __builtin_mul_overflow (a, b, r))
# endif
@@ -183,10 +185,10 @@
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
https://llvm.org/bugs/show_bug.cgi?id=25390
- For now, assume all versions of GCC-like compilers generate bogus
+ For now, assume GCC < 14 and all Clang versions generate bogus
warnings for _Generic. This matters only for compilers that
lack relevant builtins. */
-#if __GNUC__ || defined __clang__
+#if (__GNUC__ && __GNUC__ < 14) || defined __clang__
# define _GL__GENERIC_BOGUS 1
#else
# define _GL__GENERIC_BOGUS 0
diff --git a/tp/Texinfo/XS/gnulib/lib/inttypes.in.h
b/tp/Texinfo/XS/gnulib/lib/inttypes.in.h
index 22643876ab..e9c80f3dca 100644
--- a/tp/Texinfo/XS/gnulib/lib/inttypes.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2024 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
@@ -970,7 +970,7 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
# define strtoimax rpl_strtoimax
# endif
_GL_FUNCDECL_RPL (strtoimax, intmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int));
@@ -978,7 +978,7 @@ _GL_CXXALIAS_RPL (strtoimax, intmax_t,
# if !@HAVE_DECL_STRTOIMAX@
# undef strtoimax
_GL_FUNCDECL_SYS (strtoimax, intmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoimax, intmax_t,
@@ -1000,7 +1000,7 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
# define strtoumax rpl_strtoumax
# endif
_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int));
@@ -1008,7 +1008,7 @@ _GL_CXXALIAS_RPL (strtoumax, uintmax_t,
# if !@HAVE_DECL_STRTOUMAX@
# undef strtoumax
_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
- (const char *restrict, char **restrict, int)
+ (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
diff --git a/tp/Texinfo/XS/gnulib/lib/itold.c b/tp/Texinfo/XS/gnulib/lib/itold.c
index 0ef4464eea..e6fbcff408 100644
--- a/tp/Texinfo/XS/gnulib/lib/itold.c
+++ b/tp/Texinfo/XS/gnulib/lib/itold.c
@@ -1,5 +1,5 @@
/* Replacement for 'int' to 'long double' conversion routine.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/libunistring.valgrind
b/tp/Texinfo/XS/gnulib/lib/libunistring.valgrind
index c2c58208da..c4d6a5c2b3 100644
--- a/tp/Texinfo/XS/gnulib/lib/libunistring.valgrind
+++ b/tp/Texinfo/XS/gnulib/lib/libunistring.valgrind
@@ -1,6 +1,6 @@
# Suppress valgrind messages in an installed libunistring.
-# Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# Copyright (C) 2010-2024 Free Software Foundation, Inc.
#
# This file is free software.
# It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
diff --git a/tp/Texinfo/XS/gnulib/lib/limits.in.h
b/tp/Texinfo/XS/gnulib/lib/limits.in.h
index e2e173eb2d..c65eb4c1cf 100644
--- a/tp/Texinfo/XS/gnulib/lib/limits.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/limits.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <limits.h>.
- Copyright 2016-2023 Free Software Foundation, Inc.
+ Copyright 2016-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -130,7 +130,7 @@
# define BOOL_WIDTH 1
# define BOOL_MAX 1
# elif ! defined BOOL_MAX
-# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1)
+# define BOOL_MAX 1
# endif
#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/localcharset.c
b/tp/Texinfo/XS/gnulib/lib/localcharset.c
index 7ed9c957db..93c4baa471 100644
--- a/tp/Texinfo/XS/gnulib/lib/localcharset.c
+++ b/tp/Texinfo/XS/gnulib/lib/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -1054,7 +1054,7 @@ locale_charset (void)
}
}
if (0)
- done_table_lookup: ;
+ done_table_lookup: {}
else
# endif
{
diff --git a/tp/Texinfo/XS/gnulib/lib/localcharset.h
b/tp/Texinfo/XS/gnulib/lib/localcharset.h
index 25c9bb9c6e..472140248c 100644
--- a/tp/Texinfo/XS/gnulib/lib/localcharset.h
+++ b/tp/Texinfo/XS/gnulib/lib/localcharset.h
@@ -1,5 +1,5 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2003, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2009-2024 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/malloca.c
b/tp/Texinfo/XS/gnulib/lib/malloca.c
index f055b1e5ca..e75c72df84 100644
--- a/tp/Texinfo/XS/gnulib/lib/malloca.c
+++ b/tp/Texinfo/XS/gnulib/lib/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
This file is free software: you can redistribute it and/or modify
@@ -22,6 +22,9 @@
#include "malloca.h"
#include <stdckdint.h>
+#if defined __CHERI_PURE_CAPABILITY__
+# include <cheri.h>
+#endif
#include "idx.h"
@@ -36,10 +39,15 @@
allocation.
- NULL comes from a failed heap allocation. */
+#if defined __CHERI_PURE_CAPABILITY__
+/* Type for holding the original malloc() result. */
+typedef uintptr_t small_t;
+#else
/* Type for holding very small pointer differences. */
typedef unsigned char small_t;
/* Verify that it is wide enough. */
static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
+#endif
void *
mmalloca (size_t n)
@@ -56,20 +64,28 @@ mmalloca (size_t n)
if (mem != NULL)
{
- uintptr_t umem = (uintptr_t)mem, umemplus;
+ uintptr_t umem = (uintptr_t) mem;
/* The ckd_add avoids signed integer overflow on
theoretical platforms where UINTPTR_MAX <= INT_MAX. */
+ uintptr_t umemplus;
ckd_add (&umemplus, umem, sizeof (small_t) + sa_alignment_max - 1);
- idx_t offset = ((umemplus & ~alignment2_mask)
+ idx_t offset = (umemplus - umemplus % (2 * sa_alignment_max)
+ sa_alignment_max - umem);
- void *vp = mem + offset;
- small_t *p = vp;
+ void *p = mem + offset;
/* Here p >= mem + sizeof (small_t),
and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
hence p + n <= mem + nplus.
So, the memory range [p, p+n) lies in the allocated memory range
[mem, mem + nplus). */
- p[-1] = offset;
+ small_t *sp = p;
+# if defined __CHERI_PURE_CAPABILITY__
+ sp[-1] = umem;
+ p = (char *) cheri_bounds_set ((char *) p - sizeof (small_t),
+ sizeof (small_t) + n)
+ + sizeof (small_t);
+# else
+ sp[-1] = offset;
+# endif
/* p ≡ sa_alignment_max mod 2*sa_alignment_max. */
return p;
}
@@ -90,15 +106,22 @@ void
freea (void *p)
{
/* Check argument. */
- if ((uintptr_t) p & (sa_alignment_max - 1))
+ uintptr_t u = (uintptr_t) p;
+ if (u & (sa_alignment_max - 1))
{
/* p was not the result of a malloca() call. Invalid argument. */
abort ();
}
/* Determine whether p was a non-NULL pointer returned by mmalloca(). */
- if ((uintptr_t) p & sa_alignment_max)
+ if (u & sa_alignment_max)
{
- void *mem = (char *) p - ((small_t *) p)[-1];
+ char *cp = p;
+ small_t *sp = p;
+# if defined __CHERI_PURE_CAPABILITY__
+ void *mem = sp[-1];
+# else
+ void *mem = cp - sp[-1];
+# endif
free (mem);
}
}
diff --git a/tp/Texinfo/XS/gnulib/lib/malloca.h
b/tp/Texinfo/XS/gnulib/lib/malloca.h
index f68ddfe010..c520842171 100644
--- a/tp/Texinfo/XS/gnulib/lib/malloca.h
+++ b/tp/Texinfo/XS/gnulib/lib/malloca.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
@@ -28,6 +28,9 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
+#if defined __CHERI_PURE_CAPABILITY__
+# include <cheri.h>
+#endif
#include "xalloc-oversized.h"
@@ -68,12 +71,24 @@ extern void freea (void *p);
memory allocated on the stack, that must be freed using freea() before
the function returns. Upon failure, it returns NULL. */
#if HAVE_ALLOCA
-# define malloca(N) \
- ((N) < 4032 - (2 * sa_alignment_max - 1) \
- ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
- + (2 * sa_alignment_max - 1)) \
- & ~(uintptr_t)(2 * sa_alignment_max - 1)) \
- : mmalloca (N))
+# if defined __CHERI_PURE_CAPABILITY__
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1) \
+ ? cheri_bounds_set ((void *) (((uintptr_t) \
+ (char *) \
+ alloca ((N) + 2 * sa_alignment_max - 1) \
+ + (2 * sa_alignment_max - 1)) \
+ & ~(uintptr_t)(2 * sa_alignment_max - 1)), \
+ (N)) \
+ : mmalloca (N))
+# else
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1)
\
+ ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1)
\
+ + (2 * sa_alignment_max - 1))
\
+ & ~(uintptr_t)(2 * sa_alignment_max - 1))
\
+ : mmalloca (N))
+# endif
#else
# define malloca(N) \
mmalloca (N)
diff --git a/tp/Texinfo/XS/gnulib/lib/mbszero.c
b/tp/Texinfo/XS/gnulib/lib/mbszero.c
index 6da91c6b20..25af2848ea 100644
--- a/tp/Texinfo/XS/gnulib/lib/mbszero.c
+++ b/tp/Texinfo/XS/gnulib/lib/mbszero.c
@@ -1,5 +1,5 @@
/* Put an mbstate_t into an initial conversion state.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/memchr.c
b/tp/Texinfo/XS/gnulib/lib/memchr.c
index 8e9557937e..67687a8f17 100644
--- a/tp/Texinfo/XS/gnulib/lib/memchr.c
+++ b/tp/Texinfo/XS/gnulib/lib/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2023
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2024
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/tp/Texinfo/XS/gnulib/lib/memchr.valgrind
b/tp/Texinfo/XS/gnulib/lib/memchr.valgrind
index 97690f2c50..0295d7e62f 100644
--- a/tp/Texinfo/XS/gnulib/lib/memchr.valgrind
+++ b/tp/Texinfo/XS/gnulib/lib/memchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in memchr().
-# Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# Copyright (C) 2009-2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/obstack.c
b/tp/Texinfo/XS/gnulib/lib/obstack.c
index ca2e61c8cc..b00cd88e1a 100644
--- a/tp/Texinfo/XS/gnulib/lib/obstack.c
+++ b/tp/Texinfo/XS/gnulib/lib/obstack.c
@@ -1,5 +1,5 @@
/* obstack.c - subroutines used implicitly by object stack macros
- Copyright (C) 1988-2023 Free Software Foundation, Inc.
+ Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
@@ -23,43 +23,23 @@
# include "obstack.h"
#endif
-/* NOTE BEFORE MODIFYING THIS FILE: _OBSTACK_INTERFACE_VERSION in
- obstack.h must be incremented whenever callers compiled using an old
+/* NOTE BEFORE MODIFYING THIS FILE IN GNU LIBC: _OBSTACK_INTERFACE_VERSION in
+ gnu-versions.h must be incremented whenever callers compiled using an old
obstack.h can no longer properly call the functions in this file. */
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself, and the installed library
- supports the same library interface we do. This code is part of the GNU
- C Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand 'configure --with-gnu-libc' and omit the object
- files, it is simpler to just do this in the source for each such file. */
-#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
-# include <gnu-versions.h>
-# if (_GNU_OBSTACK_INTERFACE_VERSION == _OBSTACK_INTERFACE_VERSION \
- || (_GNU_OBSTACK_INTERFACE_VERSION == 1 \
- && _OBSTACK_INTERFACE_VERSION == 2 \
- && defined SIZEOF_INT && defined SIZEOF_SIZE_T \
- && SIZEOF_INT == SIZEOF_SIZE_T))
-# define _OBSTACK_ELIDE_CODE
-# endif
-#endif
-
-#ifndef _OBSTACK_ELIDE_CODE
/* If GCC, or if an oddball (testing?) host that #defines __alignof__,
use the already-supplied __alignof__. Otherwise, this must be Gnulib
(as glibc assumes GCC); defer to Gnulib's alignof_type. */
-# if !defined __GNUC__ && !defined __alignof__
-# include <alignof.h>
-# define __alignof__(type) alignof_type (type)
-# endif
-# include <stdlib.h>
-# include <stdint.h>
+#if !defined __GNUC__ && !defined __alignof__
+# include <alignof.h>
+# define __alignof__(type) alignof_type (type)
+#endif
+#include <stdlib.h>
+#include <stdint.h>
-# ifndef MAX
-# define MAX(a,b) ((a) > (b) ? (a) : (b))
-# endif
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
/* Determine default alignment. */
@@ -300,30 +280,30 @@ _obstack_memory_used (struct obstack *h)
return nbytes;
}
-# ifndef _OBSTACK_NO_ERROR_HANDLER
+#ifndef _OBSTACK_NO_ERROR_HANDLER
/* Define the error handler. */
-# include <stdio.h>
+# include <stdio.h>
/* Exit value used when 'print_and_abort' is used. */
-# ifdef _LIBC
+# ifdef _LIBC
int obstack_exit_failure = EXIT_FAILURE;
-# else
-# include "exitfail.h"
-# define obstack_exit_failure exit_failure
-# endif
-
-# ifdef _LIBC
-# include <libintl.h>
-# else
-# include "gettext.h"
-# endif
-# ifndef _
-# define _(msgid) gettext (msgid)
-# endif
-
-# ifdef _LIBC
-# include <libio/iolibio.h>
-# endif
+# else
+# include "exitfail.h"
+# define obstack_exit_failure exit_failure
+# endif
+
+# ifdef _LIBC
+# include <libintl.h>
+# else
+# include "gettext.h"
+# endif
+# ifndef _
+# define _(msgid) gettext (msgid)
+# endif
+
+# ifdef _LIBC
+# include <libio/iolibio.h>
+# endif
static __attribute_noreturn__ void
print_and_abort (void)
@@ -333,11 +313,11 @@ print_and_abort (void)
happen because the "memory exhausted" message appears in other places
like this and the translation should be reused instead of creating
a very similar string which requires a separate translation. */
-# ifdef _LIBC
+# ifdef _LIBC
(void) __fxprintf (NULL, "%s\n", _("memory exhausted"));
-# else
+# else
fprintf (stderr, "%s\n", _("memory exhausted"));
-# endif
+# endif
exit (obstack_exit_failure);
}
@@ -349,5 +329,4 @@ print_and_abort (void)
'print_and_abort'. */
__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
= print_and_abort;
-# endif /* !_OBSTACK_NO_ERROR_HANDLER */
-#endif /* !_OBSTACK_ELIDE_CODE */
+#endif /* !_OBSTACK_NO_ERROR_HANDLER */
diff --git a/tp/Texinfo/XS/gnulib/lib/obstack.h
b/tp/Texinfo/XS/gnulib/lib/obstack.in.h
similarity index 93%
rename from tp/Texinfo/XS/gnulib/lib/obstack.h
rename to tp/Texinfo/XS/gnulib/lib/obstack.in.h
index af8c5ba01c..28fb4d8916 100644
--- a/tp/Texinfo/XS/gnulib/lib/obstack.h
+++ b/tp/Texinfo/XS/gnulib/lib/obstack.in.h
@@ -1,5 +1,5 @@
/* obstack.h - object stack macros
- Copyright (C) 1988-2023 Free Software Foundation, Inc.
+ Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
@@ -97,9 +97,11 @@
as you would with a stack.)
*/
+/* Documentation (part of the GNU libc manual):
+ <https://www.gnu.org/software/libc/manual/html_node/Obstacks.html> */
-/* Don't do the contents of this file more than once. */
+/* Don't do the contents of this file more than once. */
#ifndef _OBSTACK_H
#define _OBSTACK_H 1
@@ -108,12 +110,9 @@
#error "Please include config.h first."
#endif
-#ifndef _OBSTACK_INTERFACE_VERSION
-# define _OBSTACK_INTERFACE_VERSION 2
-#endif
-
#include <stddef.h> /* For size_t and ptrdiff_t. */
-#include <string.h> /* For __GNU_LIBRARY__, and memcpy. */
+#include <stdint.h> /* For uintptr_t. */
+#include <string.h> /* For memcpy. */
#if __STDC_VERSION__ < 199901L || defined __HP_cc
# define __FLEXIBLE_ARRAY_MEMBER 1
@@ -121,35 +120,32 @@
# define __FLEXIBLE_ARRAY_MEMBER
#endif
-#if _OBSTACK_INTERFACE_VERSION == 1
-/* For binary compatibility with obstack version 1, which used "int"
- and "long" for these two types. */
+/* These macros highlight the places where this implementation
+ is different from the one in GNU libc. */
+#ifdef _LIBC
# define _OBSTACK_SIZE_T unsigned int
# define _CHUNK_SIZE_T unsigned long
# define _OBSTACK_CAST(type, expr) ((type) (expr))
#else
-/* Version 2 with sane types, especially for 64-bit hosts. */
+/* In Gnulib, we use sane types, especially for 64-bit hosts. */
# define _OBSTACK_SIZE_T size_t
# define _CHUNK_SIZE_T size_t
# define _OBSTACK_CAST(type, expr) (expr)
#endif
-/* If B is the base of an object addressed by P, return the result of
- aligning P to the next multiple of A + 1. B and P must be of type
- char *. A + 1 must be a power of 2. */
-
-#define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A)))
-
-/* Similar to __BPTR_ALIGN (B, P, A), except optimize the common case
- where pointers can be converted to integers, aligned as integers,
- and converted back again. If ptrdiff_t is narrower than a
- pointer (e.g., the AS/400), play it safe and compute the alignment
- relative to B. Otherwise, use the faster strategy of computing the
- alignment relative to 0. */
-
-#define __PTR_ALIGN(B, P, A) \
- __BPTR_ALIGN (sizeof (ptrdiff_t) < sizeof (void *) ? (B) : (char *) 0, \
- P, A)
+/* __PTR_ALIGN(B, P, A) returns the result of aligning P to the next multiple
+ of A + 1. B must be the base of an object addressed by P. B and P must be
+ of type char *. A + 1 must be a power of 2.
+ If ptrdiff_t is narrower than a pointer (e.g., the AS/400), play it
+ safe and compute the alignment relative to B. Otherwise, use the
+ faster strategy of computing the alignment through uintptr_t. */
+#if @SMALL_PTRDIFF_T@
+# define __PTR_ALIGN(B, P, A) \
+ ((B) + (((P) - (B) + (A)) & ~(A)))
+#else
+# define __PTR_ALIGN(B, P, A) \
+ ((P) + ((- (uintptr_t) (P)) & (A)))
+#endif
#ifndef __attribute_pure__
# define __attribute_pure__ _GL_ATTRIBUTE_PURE
@@ -164,12 +160,6 @@
# endif
#endif
-#define _obstack_begin rpl_obstack_begin
-#define _obstack_newchunk rpl_obstack_newchunk
-#define _obstack_allocated_p rpl_obstack_allocated_p
-#define _obstack_free rpl_obstack_free
-#define _obstack_memory_used rpl_obstack_memory_used
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -220,6 +210,14 @@ struct obstack /* control current object in
current chunk */
/* Declare the external functions we use; they are in obstack.c. */
+#if @REPLACE_OBSTACK@
+# define _obstack_newchunk rpl_obstack_newchunk
+# define _obstack_free rpl_obstack_free
+# define _obstack_begin rpl_obstack_begin
+# define _obstack_begin_1 rpl_obstack_begin_1
+# define _obstack_memory_used rpl_obstack_memory_used
+# define _obstack_allocated_p rpl_obstack_allocated_p
+#endif
extern void _obstack_newchunk (struct obstack *, _OBSTACK_SIZE_T);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *,
diff --git a/tp/Texinfo/XS/gnulib/lib/printf-args.c
b/tp/Texinfo/XS/gnulib/lib/printf-args.c
index b2b21aeec1..c20225039d 100644
--- a/tp/Texinfo/XS/gnulib/lib/printf-args.c
+++ b/tp/Texinfo/XS/gnulib/lib/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -198,7 +198,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
if (ap->a.a_string == NULL)
ap->a.a_string = "(NULL)";
break;
-#if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
ap->a.a_wide_string = va_arg (args, const wchar_t *);
/* A null pointer is an invalid argument for "%ls", but in practice
@@ -216,7 +215,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
ap->a.a_wide_string = wide_null_string;
}
break;
-#endif
case TYPE_POINTER:
ap->a.a_pointer = va_arg (args, void *);
break;
diff --git a/tp/Texinfo/XS/gnulib/lib/printf-args.h
b/tp/Texinfo/XS/gnulib/lib/printf-args.h
index 1101610282..24a86748b1 100644
--- a/tp/Texinfo/XS/gnulib/lib/printf-args.h
+++ b/tp/Texinfo/XS/gnulib/lib/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -28,14 +28,9 @@
# define PRINTF_FETCHARGS printf_fetchargs
#endif
-/* Get size_t. */
+/* Get size_t, wchar_t. */
#include <stddef.h>
-/* Get wchar_t. */
-#if HAVE_WCHAR_T
-# include <stddef.h>
-#endif
-
/* Get wint_t. */
#if HAVE_WINT_T
# include <wchar.h>
@@ -89,9 +84,7 @@ typedef enum
TYPE_WIDE_CHAR,
#endif
TYPE_STRING,
-#if HAVE_WCHAR_T
TYPE_WIDE_STRING,
-#endif
TYPE_POINTER,
TYPE_COUNT_SCHAR_POINTER,
TYPE_COUNT_SHORT_POINTER,
@@ -154,9 +147,7 @@ typedef struct
wint_t a_wide_char;
#endif
const char* a_string;
-#if HAVE_WCHAR_T
const wchar_t* a_wide_string;
-#endif
void* a_pointer;
signed char * a_count_schar_pointer;
short * a_count_short_pointer;
diff --git a/tp/Texinfo/XS/gnulib/lib/printf-parse.c
b/tp/Texinfo/XS/gnulib/lib/printf-parse.c
index d3f2c3cb5d..7628cb2335 100644
--- a/tp/Texinfo/XS/gnulib/lib/printf-parse.c
+++ b/tp/Texinfo/XS/gnulib/lib/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -555,9 +555,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d,
arguments *a)
unsigned_type = TYPE_ULONGINT;
pointer_type = TYPE_COUNT_LONGINT_POINTER;
}
- cp++;
+ cp += 3;
}
#endif
+ (void) pointer_type;
/* Read the conversion character. */
c = *cp++;
@@ -599,26 +600,22 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d,
arguments *a)
if (signed_type == TYPE_LONGINT
/* For backward compatibility only. */
|| signed_type == TYPE_LONGLONGINT)
-#if HAVE_WCHAR_T
type = TYPE_WIDE_STRING;
-#else
- goto error;
-#endif
else
type = TYPE_STRING;
break;
-#if HAVE_WCHAR_T
case 'S':
type = TYPE_WIDE_STRING;
c = 's';
break;
-#endif
case 'p':
type = TYPE_POINTER;
break;
+#if NEED_PRINTF_WITH_N_DIRECTIVE
case 'n':
type = pointer_type;
break;
+#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
case 'U':
diff --git a/tp/Texinfo/XS/gnulib/lib/printf-parse.h
b/tp/Texinfo/XS/gnulib/lib/printf-parse.h
index 45febac1f0..949b8754cc 100644
--- a/tp/Texinfo/XS/gnulib/lib/printf-parse.h
+++ b/tp/Texinfo/XS/gnulib/lib/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/rawmemchr.c
b/tp/Texinfo/XS/gnulib/lib/rawmemchr.c
index 45c6cd3527..013e7f8cce 100644
--- a/tp/Texinfo/XS/gnulib/lib/rawmemchr.c
+++ b/tp/Texinfo/XS/gnulib/lib/rawmemchr.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
/* Specification. */
#include <string.h>
-/* A function definition is only needed if HAVE_RAWMEMCHR is not defined. */
+/* A function definition is needed only if HAVE_RAWMEMCHR is not defined. */
#if !HAVE_RAWMEMCHR
# include <limits.h>
@@ -30,19 +30,30 @@
void *
rawmemchr (const void *s, int c_in)
{
- /* Change this typedef to experiment with performance. */
+# ifdef __CHERI_PURE_CAPABILITY__
+ /* Most architectures let you read an aligned word,
+ even if the unsigned char array at S ends in the middle of the word.
+ However CHERI does not, so call memchr
+ with the underlying object's remaining length.
+ This cannot return NULL if S points to a C_IN-terminated array.
+ Use builtins rather than including <cheri.h> which is less stable. */
+ return memchr (s, c_in, (__builtin_cheri_length_get (s)
+ - __builtin_cheri_offset_get (s)));
+# else
+
+ /* You can change this typedef to experiment with performance. */
typedef uintptr_t longword;
- /* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
- This verifies that the type does not have padding bits. */
- static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+ /* Verify that the longword type lacks padding bits. */
+ static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (uintptr_t));
const unsigned char *char_ptr;
unsigned char c = c_in;
/* Handle the first few bytes by reading one byte at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
+ Do this until CHAR_PTR is aligned on a natural longword boundary,
+ as using alignof (longword) might be slower. */
for (char_ptr = (const unsigned char *) s;
- (uintptr_t) char_ptr % alignof (longword) != 0;
+ (uintptr_t) char_ptr % sizeof (longword) != 0;
++char_ptr)
if (*char_ptr == c)
return (void *) char_ptr;
@@ -118,6 +129,7 @@ rawmemchr (const void *s, int c_in)
while (*char_ptr != c)
char_ptr++;
return (void *) char_ptr;
+# endif
}
#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/rawmemchr.valgrind
b/tp/Texinfo/XS/gnulib/lib/rawmemchr.valgrind
index f3e4cb0f65..bb201f7309 100644
--- a/tp/Texinfo/XS/gnulib/lib/rawmemchr.valgrind
+++ b/tp/Texinfo/XS/gnulib/lib/rawmemchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
-# Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# Copyright (C) 2008-2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/size_max.h
b/tp/Texinfo/XS/gnulib/lib/size_max.h
index 2cfd31a59b..bd2eb43e8d 100644
--- a/tp/Texinfo/XS/gnulib/lib/size_max.h
+++ b/tp/Texinfo/XS/gnulib/lib/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2024 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/stdckdint.in.h
b/tp/Texinfo/XS/gnulib/lib/stdckdint.in.h
index 71bab5f0c9..91848806d8 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdckdint.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stdckdint.in.h
@@ -1,6 +1,6 @@
/* stdckdint.h -- checked integer arithmetic
- Copyright 2022-2023 Free Software Foundation, Inc.
+ Copyright 2022-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/tp/Texinfo/XS/gnulib/lib/stddef.in.h
b/tp/Texinfo/XS/gnulib/lib/stddef.in.h
index 190fd575d8..e39268c60c 100644
--- a/tp/Texinfo/XS/gnulib/lib/stddef.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,13 +27,21 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_wchar_t || defined __need_size_t \
- || defined __need_ptrdiff_t || defined __need_NULL \
- || defined __need_wint_t
+#if (defined __need_wchar_t || defined __need_size_t \
+ || defined __need_ptrdiff_t || defined __need_NULL \
+ || defined __need_wint_t) \
+ /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \
+ in Fedora 40 with gcc 14.0.1. \
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \
+ && !@STDDEF_NOT_IDEMPOTENT@
/* Special invocation convention inside gcc header files. In
- particular, gcc provides a version of <stddef.h> that blindly
- redefines NULL even when __need_wint_t was defined, even though
- wint_t is not normally provided by <stddef.h>. Hence, we must
+ particular, <stddef.h> in some ancient versions of GCC blindly
+ redefined NULL when __need_wint_t was defined, even though wint_t
+ is not normally provided by <stddef.h>.
+ (FIXME: It's not clear what GCC versions those were - perhaps so
+ ancient that we can stop worrying about this?)
+ Although glibc 2.26 (2017) and later do not use __need_wint_t,
+ for portability to macOS, Cygwin, Haiku, and older Glibc + GCC,
remember if special invocation has ever been used to obtain wint_t,
in which case we need to clean up NULL yet again. */
@@ -52,6 +60,13 @@
# endif
#else
+/* For @STDDEF_NOT_IDEMPOTENT@. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
+
/* Normal invocation convention. */
# ifndef _@GUARD_PREFIX@_STDDEF_H
@@ -74,6 +89,12 @@ typedef long max_align_t;
# endif
# endif
+# if !defined _GCC_NULLPTR_T && !@NULLPTR_T_NEEDS_STDDEF@
+ /* Suppress unwanted nullptr_t typedef. See
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869>. */
+# define _GCC_NULLPTR_T
+# endif
+
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
@@ -110,7 +131,7 @@ typedef long max_align_t;
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -128,11 +149,6 @@ typedef long max_align_t;
# endif
#endif
-/* Some platforms lack wchar_t. */
-#if !@HAVE_WCHAR_T@
-# define wchar_t int
-#endif
-
/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is
a hack in case the configure-time test was done with g++ even though
we are currently compiling with gcc.
@@ -178,7 +194,7 @@ typedef union
# ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0
-# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
diff --git a/tp/Texinfo/XS/gnulib/lib/stdint.in.h
b/tp/Texinfo/XS/gnulib/lib/stdint.in.h
index 5ddc644b8e..cd3fbdd965 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdint.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2023 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2024 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
@@ -80,7 +80,7 @@
#define _@GUARD_PREFIX@_STDINT_H
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
- LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */
+ LONG_MIN, LONG_MAX, ULONG_MAX, CHAR_BIT, _GL_INTEGER_WIDTH. */
#include <limits.h>
/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
@@ -189,6 +189,10 @@ typedef __int64 gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# else
+/* Verify that 'long long' has exactly 64 bits. */
+typedef _gl_verify_int64_bits[
+ _STDINT_MAX (1, sizeof (long long) * CHAR_BIT, 0ll) >> 31 >> 31 == 1
+ ? 1 : -1];
# undef int64_t
typedef long long int gl_int64_t;
# define int64_t gl_int64_t
@@ -210,6 +214,11 @@ typedef unsigned __int64 gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# else
+/* Verify that 'unsigned long long' has exactly 64 bits. */
+typedef _gl_verify_uint64_bits[
+ _STDINT_MAX (0, sizeof (unsigned long long) * CHAR_BIT, 0ull)
+ >> 31 >> 31 >> 1 == 1
+ ? 1 : -1];
# undef uint64_t
typedef unsigned long long int gl_uint64_t;
# define uint64_t gl_uint64_t
@@ -306,6 +315,8 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
uintptr_t to avoid conflicting declarations of system functions like
_findclose in <io.h>. */
# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
+ || (defined __INTPTR_WIDTH__ \
+ && __INTPTR_WIDTH__ != (defined _WIN64 ? LLONG_WIDTH : LONG_WIDTH))
\
|| defined __MINGW32__)
# undef intptr_t
# undef uintptr_t
diff --git a/tp/Texinfo/XS/gnulib/lib/stdio-read.c
b/tp/Texinfo/XS/gnulib/lib/stdio-read.c
index 6e2984c5ec..253b8aa43f 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdio-read.c
+++ b/tp/Texinfo/XS/gnulib/lib/stdio-read.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream read function.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/stdio-write.c
b/tp/Texinfo/XS/gnulib/lib/stdio-write.c
index 9cf36cca4c..ca6aa00cee 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdio-write.c
+++ b/tp/Texinfo/XS/gnulib/lib/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2008-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/stdio.in.h
b/tp/Texinfo/XS/gnulib/lib/stdio.in.h
index 118874d877..36fd6a72ce 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdio.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -38,8 +38,14 @@
/* Suppress macOS deprecation warnings for sprintf and vsprintf. */
#if (defined __APPLE__ && defined __MACH__) && !defined _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-# define _GL_DEFINED__POSIX_C_SOURCE
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# include <AvailabilityMacros.h>
+# endif
+# if (defined MAC_OS_X_VERSION_MIN_REQUIRED \
+ && 130000 <= MAC_OS_X_VERSION_MIN_REQUIRED)
+# define _POSIX_C_SOURCE 200809L
+# define _GL_DEFINED__POSIX_C_SOURCE
+# endif
#endif
#define _GL_ALREADY_INCLUDING_STDIO_H
@@ -58,8 +64,8 @@
#define _@GUARD_PREFIX@_STDIO_H
/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT,
- _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+ _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -71,7 +77,8 @@
/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
and eglibc 2.11.2.
- May also define off_t to a 64-bit type on native Windows. */
+ May also define off_t to a 64-bit type on native Windows.
+ Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
#include <sys/types.h>
/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>.
*/
@@ -113,7 +120,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -148,7 +155,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -171,7 +178,7 @@
standardized by ISO C99 and POSIX.
_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */
/* __gnu_printf__ is supported in GCC >= 4.4. */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#if (__GNUC__ + (__GNUC_MINOR__ >= 4) > 4) && !defined __clang__
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
#else
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
@@ -273,18 +280,37 @@
#endif
+#if @GNULIB_DZPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure codes are ENOMEM
+ and the possible failure codes from write(), excluding EINTR. */
+_GL_FUNCDECL_SYS (dzprintf, off64_t,
+ (int fd, const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (dzprintf, off64_t,
+ (int fd, const char *restrict format, ...));
+#endif
+
#if @GNULIB_DPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns a negative value. */
# if @REPLACE_DPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dprintf rpl_dprintf
# endif
-_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
# else
# if !@HAVE_DPRINTF@
-_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2)));
# endif
@@ -307,7 +333,7 @@ _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fclose rpl_fclose
# endif
-_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
@@ -354,9 +380,10 @@ _GL_CXXALIASWARN (fcloseall);
# define fdopen rpl_fdopen
# endif
_GL_FUNCDECL_RPL (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -365,36 +392,38 @@ _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char
*mode));
# endif
_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
- _GL_ATTRIBUTE_NOTHROW
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
# endif
_GL_CXXALIASWARN (fdopen);
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined
fdopen
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
- _GL_ATTRIBUTE_NOTHROW
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (fdopen, FILE *,
- (int fd, const char *mode)
+ (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -453,7 +482,7 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX
compliant - "
# undef fgetc
# define fgetc rpl_fgetc
# endif
-_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
@@ -470,8 +499,8 @@ _GL_CXXALIASWARN (fgetc);
# define fgets rpl_fgets
# endif
_GL_FUNCDECL_RPL (fgets, char *,
- (char *restrict s, int n, FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 3)));
+ (char *restrict s, int n, FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fgets, char *,
(char *restrict s, int n, FILE *restrict stream));
# else
@@ -507,17 +536,18 @@ _GL_CXXALIASWARN (fileno);
# define fopen rpl_fopen
# endif
_GL_FUNCDECL_RPL (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
+ (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ (const char *restrict filename, const char *restrict mode),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (fopen, FILE *,
(const char *restrict filename, const char *restrict mode));
@@ -526,10 +556,10 @@ _GL_CXXALIAS_SYS (fopen, FILE *,
_GL_CXXALIASWARN (fopen);
# endif
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined
fopen
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *,
- (const char *restrict filename, const char *restrict mode)
+ (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
# endif
# if defined GNULIB_POSIXCHECK
@@ -540,7 +570,26 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms
is not POSIX complian
# endif
#endif
+#if @GNULIB_FZPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns -1 with the stream's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (fzprintf, off64_t,
+ (FILE *restrict fp, const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (fzprintf, off64_t,
+ (FILE *restrict fp, const char *restrict format, ...));
+#endif
+
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns a negative value with the stream's error indicator set. */
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
|| (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -549,12 +598,12 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows
platforms is not POSIX complian
# define GNULIB_overrides_fprintf 1
# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (fprintf, int,
- (FILE *restrict fp, const char *restrict format, ...)
+ (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (fprintf, int,
- (FILE *restrict fp, const char *restrict format, ...)
+ (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -589,15 +638,17 @@ _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX
compliant - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fpurge rpl_fpurge
# endif
-_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
# else
# if !@HAVE_DECL_FPURGE@
-_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fpurge);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fpurge
# if HAVE_RAW_DECL_FPURGE
@@ -612,7 +663,7 @@ _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
# undef fputc
# define fputc rpl_fputc
# endif
-_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
@@ -629,7 +680,7 @@ _GL_CXXALIASWARN (fputc);
# define fputs rpl_fputs
# endif
_GL_FUNCDECL_RPL (fputs, int,
- (const char *restrict string, FILE *restrict stream)
+ (const char *restrict string, FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fputs, int,
(const char *restrict string, FILE *restrict stream));
@@ -650,8 +701,8 @@ _GL_CXXALIASWARN (fputs);
# endif
_GL_FUNCDECL_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n,
FILE *restrict stream));
@@ -673,8 +724,8 @@ _GL_CXXALIASWARN (fread);
# endif
_GL_FUNCDECL_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode,
FILE *restrict stream));
@@ -701,9 +752,9 @@ _GL_WARN_ON_USE (freopen,
# define fscanf rpl_fscanf
# endif
_GL_FUNCDECL_RPL (fscanf, int,
- (FILE *restrict stream, const char *restrict format, ...)
+ (FILE *restrict stream, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fscanf, int,
(FILE *restrict stream, const char *restrict format, ...));
# else
@@ -757,7 +808,7 @@ _GL_CXXALIASWARN (fscanf);
# undef fseek
# define fseek rpl_fseek
# endif
-_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
# else
@@ -780,12 +831,12 @@ _GL_CXXALIASWARN (fseek);
# undef fseeko
# define fseeko rpl_fseeko
# endif
-_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else
# if ! @HAVE_DECL_FSEEKO@
-_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
@@ -823,7 +874,8 @@ _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger
than 4 GB "
# undef ftell
# define ftell rpl_ftell
# endif
-_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
# else
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
@@ -843,11 +895,13 @@ _GL_CXXALIASWARN (ftell);
# undef ftello
# define ftello rpl_ftello
# endif
-_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else
# if ! @HAVE_DECL_FTELLO@
-_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
# endif
@@ -880,7 +934,7 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger
than 4 GB "
# endif
_GL_FUNCDECL_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n,
- FILE *restrict stream)
+ FILE *restrict stream),
_GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n,
@@ -895,20 +949,20 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes under certain
versions of gcc and clang, and is not needed for C++. */
-# if (0 < __USE_FORTIFY_LEVEL \
+# if (0 < __USE_FORTIFY_LEVEL \
&& __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
- && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && (3 < __GNUC__ + (4 <= __GNUC_MINOR__) || defined __clang__) \
&& !defined __cplusplus)
# undef fwrite
# undef fwrite_unlocked
-extern size_t __REDIRECT (rpl_fwrite,
- (const void *__restrict, size_t, size_t,
- FILE *__restrict),
- fwrite);
-extern size_t __REDIRECT (rpl_fwrite_unlocked,
- (const void *__restrict, size_t, size_t,
- FILE *__restrict),
- fwrite_unlocked);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
# define fwrite rpl_fwrite
# define fwrite_unlocked rpl_fwrite_unlocked
# endif
@@ -924,7 +978,7 @@ _GL_CXXALIASWARN (fwrite);
# undef getc
# define getc rpl_fgetc
# endif
-_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
@@ -965,8 +1019,8 @@ _GL_CXXALIASWARN (getchar);
_GL_FUNCDECL_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
@@ -976,8 +1030,8 @@ _GL_CXXALIAS_RPL (getdelim, ssize_t,
_GL_FUNCDECL_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
int delimiter,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 4)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
@@ -1009,8 +1063,8 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
# endif
_GL_FUNCDECL_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream));
@@ -1018,8 +1072,8 @@ _GL_CXXALIAS_RPL (getline, ssize_t,
# if !@HAVE_DECL_GETLINE@
_GL_FUNCDECL_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
- FILE *restrict stream)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ FILE *restrict stream),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
@@ -1068,19 +1122,45 @@ _GL_CXXALIASWARN (getw);
# endif
#endif
+#if @GNULIB_OBSTACK_ZPRINTF@
+struct obstack;
+/* Grows an obstack with formatted output. Returns the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use.
+ Upon memory allocation error, calls obstack_alloc_failed_handler.
+ Upon other error, returns -1 with errno set.
+
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is through
+ obstack_alloc_failed_handler. */
+_GL_FUNCDECL_SYS (obstack_zprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (obstack_zprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, ...));
+_GL_FUNCDECL_SYS (obstack_vzprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (obstack_vzprintf, ptrdiff_t,
+ (struct obstack *obs, const char *format, va_list args));
+#endif
+
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
struct obstack;
-/* Grow an obstack with formatted output. Return the number of
+/* Grows an obstack with formatted output. Returns the number of
bytes added to OBS. No trailing nul byte is added, and the
- object should be closed with obstack_finish before use. Upon
- memory allocation error, call obstack_alloc_failed_handler. Upon
- other error, return -1. */
+ object should be closed with obstack_finish before use.
+ Upon memory allocation error, calls obstack_alloc_failed_handler.
+ Upon other error, returns -1. */
# if @REPLACE_OBSTACK_PRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define obstack_printf rpl_obstack_printf
# endif
_GL_FUNCDECL_RPL (obstack_printf, int,
- (struct obstack *obs, const char *format, ...)
+ (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int,
@@ -1088,7 +1168,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int,
- (struct obstack *obs, const char *format, ...)
+ (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1101,7 +1181,7 @@ _GL_CXXALIASWARN (obstack_printf);
# define obstack_vprintf rpl_obstack_vprintf
# endif
_GL_FUNCDECL_RPL (obstack_vprintf, int,
- (struct obstack *obs, const char *format, va_list args)
+ (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int,
@@ -1109,7 +1189,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int,
- (struct obstack *obs, const char *format, va_list args)
+ (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1121,7 +1201,7 @@ _GL_CXXALIASWARN (obstack_vprintf);
#if @GNULIB_PCLOSE@
# if !@HAVE_PCLOSE@
-_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
_GL_CXXALIASWARN (pclose);
@@ -1163,25 +1243,26 @@ _GL_WARN_ON_USE (perror, "perror is not always POSIX
compliant - "
# define popen rpl_popen
# endif
_GL_FUNCDECL_RPL (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
# else
-# if !@HAVE_POPEN@ || __GNUC__ >= 11
+# if !@HAVE_POPEN@ || (__GNUC__ >= 11 && !defined __clang__)
_GL_FUNCDECL_SYS (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
# endif
_GL_CXXALIASWARN (popen);
#else
-# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
+# if @GNULIB_PCLOSE@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined popen
/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
_GL_FUNCDECL_SYS (popen, FILE *,
- (const char *cmd, const char *mode)
+ (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -1194,7 +1275,24 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some
platforms - "
# endif
#endif
+#if @GNULIB_ZPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns -1 with stdout's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
+#endif
+
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns a negative value with stdout's error indicator set. */
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if defined __GNUC__ || defined __clang__
@@ -1206,14 +1304,14 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some
platforms - "
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1)));
# else
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1)));
# endif
@@ -1223,7 +1321,7 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char
*format, ...));
# define printf rpl_printf
# endif
_GL_FUNCDECL_RPL (printf, int,
- (const char *restrict format, ...)
+ (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
@@ -1252,7 +1350,7 @@ _GL_WARN_ON_USE (printf, "printf is not always POSIX
compliant - "
# undef putc
# define putc rpl_fputc
# endif
-_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
@@ -1284,7 +1382,7 @@ _GL_CXXALIASWARN (putchar);
# undef puts
# define puts rpl_puts
# endif
-_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (puts, int, (const char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (puts, int, (const char *string));
# else
_GL_CXXALIAS_SYS (puts, int, (const char *string));
@@ -1324,7 +1422,7 @@ _GL_CXXALIASWARN (putw);
# undef remove
# define remove rpl_remove
# endif
-_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (remove, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (remove, int, (const char *name));
# else
_GL_CXXALIAS_SYS (remove, int, (const char *name));
@@ -1346,7 +1444,7 @@ _GL_WARN_ON_USE (remove, "remove cannot handle
directories on some platforms - "
# define rename rpl_rename
# endif
_GL_FUNCDECL_RPL (rename, int,
- (const char *old_filename, const char *new_filename)
+ (const char *old_filename, const char *new_filename),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (rename, int,
(const char *old_filename, const char *new_filename));
@@ -1371,14 +1469,14 @@ _GL_WARN_ON_USE (rename, "rename is buggy on some
platforms - "
# define renameat rpl_renameat
# endif
_GL_FUNCDECL_RPL (renameat, int,
- (int fd1, char const *file1, int fd2, char const *file2)
+ (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2));
# else
# if !@HAVE_RENAMEAT@
_GL_FUNCDECL_SYS (renameat, int,
- (int fd1, char const *file1, int fd2, char const *file2)
+ (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4)));
# endif
_GL_CXXALIAS_SYS (renameat, int,
@@ -1404,18 +1502,18 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
_GL_FUNCDECL_RPL_1 (__scanf__, int,
(const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
- _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
# else
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef scanf
# define scanf rpl_scanf
# endif
-_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
+_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
# endif
# else
@@ -1426,7 +1524,31 @@ _GL_CXXALIASWARN (scanf);
# endif
#endif
+#if @GNULIB_SNZPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+#endif
+
#if @GNULIB_SNPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns a negative value. */
# if @REPLACE_SNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define snprintf rpl_snprintf
@@ -1434,7 +1556,7 @@ _GL_CXXALIASWARN (scanf);
# define GNULIB_overrides_snprintf 1
_GL_FUNCDECL_RPL (snprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, ...)
+ const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int,
@@ -1444,7 +1566,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
# if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, ...)
+ const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3)));
# endif
@@ -1463,6 +1585,23 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# endif
#endif
+#if @GNULIB_SZPRINTF@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, ...));
+#endif
+
/* Some people would argue that all sprintf uses should be warned about
(for example, OpenBSD issues a link warning for it),
since it can cause security holes due to buffer overruns.
@@ -1473,13 +1612,16 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
GNULIB_POSIXCHECK is defined. */
#if @GNULIB_SPRINTF_POSIX@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns a negative value. */
# if @REPLACE_SPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define sprintf rpl_sprintf
# endif
# define GNULIB_overrides_sprintf 1
_GL_FUNCDECL_RPL (sprintf, int,
- (char *restrict str, const char *restrict format, ...)
+ (char *restrict str, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int,
@@ -1520,16 +1662,18 @@ _GL_CXXALIASWARN (tempnam);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define tmpfile rpl_tmpfile
# endif
-_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
-_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
- _GL_ATTRIBUTE_MALLOC);
+ _GL_ATTRIBUTE_MALLOC
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
# endif
@@ -1537,9 +1681,10 @@ _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
_GL_CXXALIASWARN (tmpfile);
# endif
#else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
+# if @GNULIB_FCLOSE@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined tmpfile
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
-_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC);
# endif
@@ -1552,6 +1697,31 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on
mingw - "
# endif
#endif
+#if @GNULIB_VASZPRINTF@
+/* Prints formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, it stores the address of the string in
+ *RESULT and returns the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, it returns -1
+ with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
+ (char **result, const char *format, ...),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
+ (char **result, const char *format, ...));
+_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
+ (char **result, const char *format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
+ (char **result, const char *format, va_list args));
+#endif
+
#if @GNULIB_VASPRINTF@
/* Write formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, store the address of the string in
@@ -1563,17 +1733,19 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on
mingw - "
# endif
# define GNULIB_overrides_asprintf
_GL_FUNCDECL_RPL (asprintf, int,
- (char **result, const char *format, ...)
+ (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int,
- (char **result, const char *format, ...)
+ (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (asprintf, int,
(char **result, const char *format, ...));
@@ -1585,17 +1757,19 @@ _GL_CXXALIASWARN (asprintf);
# endif
# define GNULIB_overrides_vasprintf 1
_GL_FUNCDECL_RPL (vasprintf, int,
- (char **result, const char *format, va_list args)
+ (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int,
- (char **result, const char *format, va_list args)
+ (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2))
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (vasprintf, int,
(char **result, const char *format, va_list args));
@@ -1603,13 +1777,32 @@ _GL_CXXALIAS_SYS (vasprintf, int,
_GL_CXXALIASWARN (vasprintf);
#endif
+#if @GNULIB_VDZPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure codes are ENOMEM
+ and the possible failure codes from write(), excluding EINTR. */
+_GL_FUNCDECL_SYS (vdzprintf, off64_t,
+ (int fd, const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (vdzprintf, off64_t,
+ (int fd, const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VDPRINTF@
+/* Prints formatted output to file descriptor FD.
+ Returns the number of bytes written to the file descriptor. Upon
+ failure, returns a negative value. */
# if @REPLACE_VDPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vdprintf rpl_vdprintf
# endif
_GL_FUNCDECL_RPL (vdprintf, int,
- (int fd, const char *restrict format, va_list args)
+ (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int,
@@ -1617,7 +1810,7 @@ _GL_CXXALIAS_RPL (vdprintf, int,
# else
# if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int,
- (int fd, const char *restrict format, va_list args)
+ (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2)));
# endif
@@ -1637,7 +1830,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
#endif
+#if @GNULIB_VFZPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns -1 with the stream's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (vfzprintf, off64_t,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (vfzprintf, off64_t,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+/* Prints formatted output to stream FP.
+ Returns the number of bytes written to the stream. Upon failure,
+ returns a negative value with the stream's error indicator set. */
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
|| (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1647,13 +1861,13 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# if @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1690,9 +1904,9 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX
compliant - "
# endif
_GL_FUNCDECL_RPL (vfscanf, int,
(FILE *restrict stream,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
- _GL_ARG_NONNULL ((1, 2)));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vfscanf, int,
(FILE *restrict stream,
const char *restrict format, va_list args));
@@ -1706,7 +1920,26 @@ _GL_CXXALIASWARN (vfscanf);
# endif
#endif
+#if @GNULIB_VZPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns -1 with stdout's error indicator set.
+ Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure causes are ENOMEM
+ and the possible failure causes from fwrite(). */
+_GL_FUNCDECL_SYS (vzprintf, off64_t,
+ (const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (vzprintf, off64_t,
+ (const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+/* Prints formatted output to standard output.
+ Returns the number of bytes written to standard output. Upon failure,
+ returns a negative value with stdout's error indicator set. */
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
|| (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ &&
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1714,11 +1947,11 @@ _GL_CXXALIASWARN (vfscanf);
# endif
# define GNULIB_overrides_vprintf 1
# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
-_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
_GL_ARG_NONNULL ((1)));
# else
-_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1)));
# endif
@@ -1750,9 +1983,9 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX
compliant - "
# undef vscanf
# define vscanf rpl_vscanf
# endif
-_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
+_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
- _GL_ARG_NONNULL ((1)));
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
# else
_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
@@ -1762,7 +1995,31 @@ _GL_CXXALIASWARN (vscanf);
# endif
#endif
+#if @GNULIB_VSNZPRINTF@
+/* Prints formatted output to string STR. Similar to sprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VSNPRINTF@
+/* Prints formatted output to string STR. Similar to vsprintf, but the
+ additional parameter SIZE limits how much is written into STR.
+ STR may be NULL, in which case nothing will be written.
+ Returns the string length of the formatted string (which may be larger
+ than SIZE). Upon failure, returns a negative value. */
# if @REPLACE_VSNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsnprintf rpl_vsnprintf
@@ -1770,7 +2027,7 @@ _GL_CXXALIASWARN (vscanf);
# define GNULIB_overrides_vsnprintf 1
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int,
@@ -1780,7 +2037,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
# if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int,
(char *restrict str, size_t size,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3)));
# endif
@@ -1799,7 +2056,27 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif
#endif
+#if @GNULIB_VSZPRINTF@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns -1 with errno set.
+ Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+ Therefore, if the format string is valid and does not use %ls/%lc
+ directives nor widths, the only possible failure code is ENOMEM. */
+_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, va_list args),
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+#endif
+
#if @GNULIB_VSPRINTF_POSIX@
+/* Prints formatted output to string STR.
+ Returns the string length of the formatted string. Upon failure,
+ returns a negative value. */
# if @REPLACE_VSPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsprintf rpl_vsprintf
@@ -1807,7 +2084,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# define GNULIB_overrides_vsprintf 1
_GL_FUNCDECL_RPL (vsprintf, int,
(char *restrict str,
- const char *restrict format, va_list args)
+ const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int,
diff --git a/tp/Texinfo/XS/gnulib/lib/stdlib.in.h
b/tp/Texinfo/XS/gnulib/lib/stdlib.in.h
index b9838c7d5e..1ec96c8b24 100644
--- a/tp/Texinfo/XS/gnulib/lib/stdlib.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,12 +20,25 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined
__need_malloc_and_calloc
/* Special invocation conventions inside some gnulib header files,
- and inside some glibc header files, respectively. */
+ and inside some glibc header files, respectively.
+ Do not recognize this special invocation convention when GCC's
+ c++/11/stdlib.h is being included or has been included. This is needed
+ to support the use of clang+llvm binaries on Ubuntu 22.04 with
+ CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
+ -I/usr/include/x86_64-linux-gnu/c++/11
+ -L/usr/lib/gcc/x86_64-linux-gnu/11
+ -Wl,-rpath,$clangdir/lib"
+ because in this case /usr/include/c++/11/stdlib.h (which does not support
+ the convention) is seen before the gnulib-generated stdlib.h. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+/* Make sure that the macros that indicate the special invocation convention
+ get undefined. This is needed at least on CentOS 7. */
+#undef __need_malloc_and_calloc
+
#else
/* Normal invocation convention. */
@@ -38,8 +51,8 @@
#define _@GUARD_PREFIX@_STDLIB_H
/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
- _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+ _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -104,11 +117,22 @@ struct random_data
# include <unistd.h>
#endif
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ &&
@REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) ||
(@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined
GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
+ below, this may cause compilation errors later in the libstdc++ header files
+ (that are part of GCC), such as:
+ error: 'rpl_strtol' is not a member of 'std'
+ To avoid this, include the relevant header files here, before these symbols
+ get defined as macros. But do so only on Solaris 11 (where it is needed),
+ not on mingw (where it would cause other compilation errors). */
+# include <string>
+#endif
+
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -137,7 +161,7 @@ struct random_data
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -216,6 +240,26 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
#endif
+#if @GNULIB_ABORT_DEBUG@
+/* Terminates the current process with signal SIGABRT.
+ Note: While the original abort() function is safe to call in signal
handlers,
+ the overridden abort() function is not. */
+# if @REPLACE_ABORT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef abort
+# define abort rpl_abort
+# endif
+_GL_FUNCDECL_RPL (abort, _Noreturn void, (void));
+_GL_CXXALIAS_RPL (abort, void, (void));
+# else
+_GL_CXXALIAS_SYS (abort, void, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (abort);
+# endif
+#endif
+
+
#if @GNULIB_FREE_POSIX@
# if @REPLACE_FREE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -223,7 +267,7 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# define free rpl_free
# endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
-_GL_FUNCDECL_RPL (free, void, (void *ptr) _GL_ATTRIBUTE_NOTHROW);
+_GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_RPL (free, void, (void *ptr));
# endif
@@ -250,22 +294,25 @@ _GL_WARN_ON_USE (free, "free is not future POSIX
compliant everywhere - "
# define aligned_alloc rpl_aligned_alloc
# endif
_GL_FUNCDECL_RPL (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
# else
# if @HAVE_ALIGNED_ALLOC@
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
@@ -275,16 +322,17 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t
alignment, size_t size));
_GL_CXXALIASWARN (aligned_alloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t alignment, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (aligned_alloc, void *,
- (size_t alignment, size_t size)
+ (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -301,9 +349,10 @@ _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not
portable - "
/* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */
# if !@HAVE_ATOLL@
-_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
- _GL_ATTRIBUTE_PURE
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (atoll, long long,
+ (const char *string),
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll);
@@ -323,21 +372,24 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
# define calloc rpl_calloc
# endif
_GL_FUNCDECL_RPL (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
@@ -346,16 +398,17 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t
size));
_GL_CXXALIASWARN (calloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (calloc, void *,
- (size_t nmemb, size_t size)
+ (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -373,23 +426,26 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant
everywhere - "
# define canonicalize_file_name rpl_canonicalize_file_name
# endif
_GL_FUNCDECL_RPL (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
# else
-# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+# if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
@@ -400,18 +456,19 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const
char *name));
# endif
_GL_CXXALIASWARN (canonicalize_file_name);
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined
canonicalize_file_name
/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
- _GL_ATTRIBUTE_NOTHROW
+ (const char *name),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
- (const char *name)
+ (const char *name),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -503,12 +560,12 @@ _GL_CXXALIASWARN (gcvt);
# undef getloadavg
# define getloadavg rpl_getloadavg
# endif
-_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
# else
# if !@HAVE_DECL_GETLOADAVG@
-_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
@@ -533,7 +590,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# define getprogname rpl_getprogname
# endif
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
_GL_FUNCDECL_RPL (getprogname, const char *, (void));
# endif
@@ -541,7 +598,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else
# if !@HAVE_GETPROGNAME@
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
-_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
_GL_FUNCDECL_SYS (getprogname, const char *, (void));
# endif
@@ -577,15 +634,15 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable
- "
# define getsubopt rpl_getsubopt
# endif
_GL_FUNCDECL_RPL (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
# else
# if !@HAVE_GETSUBOPT@
_GL_FUNCDECL_SYS (getsubopt, int,
- (char **optionp, char *const *tokens, char **valuep)
- _GL_ARG_NONNULL ((1, 2, 3)));
+ (char **optionp, char *const *tokens, char **valuep),
+ _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
@@ -630,21 +687,24 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
# define malloc rpl_malloc
# endif
_GL_FUNCDECL_RPL (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
@@ -653,16 +713,17 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
_GL_CXXALIASWARN (malloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (size_t size),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (malloc, void *,
- (size_t size)
+ (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -698,7 +759,7 @@ int gl_MB_CUR_MAX (void)
# endif
_GL_FUNCDECL_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
- size_t len)
+ size_t len),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src,
@@ -756,7 +817,9 @@ _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */
# if !@HAVE_MKDTEMP@
-_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL
((1)));
+_GL_FUNCDECL_SYS (mkdtemp, char *,
+ (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp);
@@ -786,13 +849,13 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
# undef mkostemp
# define mkostemp rpl_mkostemp
# endif
-_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMP@
-_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
# endif
@@ -827,15 +890,15 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
# define mkostemps rpl_mkostemps
# endif
_GL_FUNCDECL_RPL (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
# else
# if !@HAVE_MKOSTEMPS@
_GL_FUNCDECL_SYS (mkostemps, int,
- (char * /*template*/, int /*suffixlen*/, int /*flags*/)
- _GL_ARG_NONNULL ((1)));
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
@@ -865,11 +928,13 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkstemp rpl_mkstemp
# endif
-_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
# else
# if ! @HAVE_MKSTEMP@
-_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif
@@ -894,8 +959,8 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
# if !@HAVE_MKSTEMPS@
-_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps);
@@ -931,8 +996,8 @@ _GL_CXXALIASWARN (mktemp);
# define posix_memalign rpl_posix_memalign
# endif
_GL_FUNCDECL_RPL (posix_memalign, int,
- (void **memptr, size_t alignment, size_t size)
- _GL_ARG_NONNULL ((1)));
+ (void **memptr, size_t alignment, size_t size),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_memalign, int,
(void **memptr, size_t alignment, size_t size));
# else
@@ -960,11 +1025,11 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not
portable - "
# undef posix_openpt
# define posix_openpt rpl_posix_openpt
# endif
-_GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
+_GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
# else
# if !@HAVE_POSIX_OPENPT@
-_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
# endif
@@ -987,11 +1052,11 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not
portable - "
# undef ptsname
# define ptsname rpl_ptsname
# endif
-_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
# else
# if !@HAVE_PTSNAME@
-_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
# endif
@@ -1039,7 +1104,7 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
# undef putenv
# define putenv rpl_putenv
# endif
-_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (putenv, int, (char *string));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1047,6 +1112,10 @@ _GL_CXXALIAS_RPL (putenv, int, (char *string));
# define putenv _putenv
# endif
_GL_CXXALIAS_MDA (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+ const char *string. */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
# else
_GL_CXXALIAS_SYS (putenv, int, (char *string));
# endif
@@ -1063,6 +1132,10 @@ _GL_CXXALIASWARN (putenv);
/* Need to cast, because on mingw, the parameter is either
'const char *string' or 'char *string'. */
_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+ const char *string. */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
# else
_GL_CXXALIAS_SYS (putenv, int, (char *string));
# endif
@@ -1090,7 +1163,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void
const *, void *);
# endif
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
@@ -1098,13 +1172,16 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t
nmemb, size_t size,
# if !@HAVE_QSORT_R@
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
- void *arg) _GL_ARG_NONNULL ((1, 4)));
+ void *arg),
+ _GL_ARG_NONNULL ((1, 4)));
# endif
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (qsort_r);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef qsort_r
# if HAVE_RAW_DECL_QSORT_R
@@ -1114,11 +1191,26 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
#endif
-#if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
-# ifndef RAND_MAX
-# define RAND_MAX 2147483647
+#if @GNULIB_RAND@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@)
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+#endif
+
+
+#if @GNULIB_RAND@
+# if @REPLACE_RAND@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rand
+# define rand rpl_rand
# endif
+_GL_FUNCDECL_RPL (rand, int, (void));
+_GL_CXXALIAS_RPL (rand, int, (void));
+# else
+_GL_CXXALIAS_SYS (rand, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (rand);
# endif
#endif
@@ -1184,14 +1276,14 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
# define initstate rpl_initstate
# endif
_GL_FUNCDECL_RPL (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# else
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *,
- (unsigned int seed, char *buf, size_t buf_size)
+ (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on FreeBSD, the first parameter is
@@ -1216,11 +1308,11 @@ _GL_WARN_ON_USE (initstate, "initstate is unportable - "
# undef setstate
# define setstate rpl_setstate
# endif
-_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
# else
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
-_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
is const char *arg_state. */
@@ -1244,12 +1336,12 @@ _GL_WARN_ON_USE (setstate, "setstate is unportable - "
# undef random_r
# define random_r rpl_random_r
# endif
-_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
# else
# if !@HAVE_RANDOM_R@
-_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
@@ -1270,14 +1362,14 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
# define srandom_r rpl_srandom_r
# endif
_GL_FUNCDECL_RPL (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (srandom_r, int,
(unsigned int seed, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (srandom_r, int,
- (unsigned int seed, struct random_data *rand_state)
+ (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (srandom_r, int,
@@ -1300,7 +1392,7 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
# endif
_GL_FUNCDECL_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
@@ -1309,7 +1401,7 @@ _GL_CXXALIAS_RPL (initstate_r, int,
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
- struct random_data *rand_state)
+ struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4)));
# endif
/* Need to cast, because on Haiku, the third parameter is
@@ -1334,14 +1426,14 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is
unportable - "
# define setstate_r rpl_setstate_r
# endif
_GL_FUNCDECL_RPL (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (setstate_r, int,
(char *arg_state, struct random_data *rand_state));
# else
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (setstate_r, int,
- (char *arg_state, struct random_data *rand_state)
+ (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2)));
# endif
/* Need to cast, because on Haiku, the first parameter is
@@ -1367,21 +1459,22 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable
- "
# undef realloc
# define realloc rpl_realloc
# endif
-_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_FUNCDECL_RPL (realloc, void *,
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
# endif
# endif
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
@@ -1390,16 +1483,17 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t
size));
_GL_CXXALIASWARN (realloc);
# endif
#else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+# if @GNULIB_FREE_POSIX@ \
+ && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_DEALLOC_FREE);
+ (void *ptr, size_t size),
+ _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (realloc, void *,
- (void *ptr, size_t size)
+ (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1419,13 +1513,15 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX
compliant everywhere - "
# define reallocarray rpl_reallocarray
# endif
_GL_FUNCDECL_RPL (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
# else
# if ! @HAVE_REALLOCARRAY@
_GL_FUNCDECL_SYS (reallocarray, void *,
- (void *ptr, size_t nmemb, size_t size));
+ (void *ptr, size_t nmemb, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
@@ -1447,15 +1543,15 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not
portable - "
# define realpath rpl_realpath
# endif
_GL_FUNCDECL_RPL (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realpath, char *,
(const char *restrict name, char *restrict resolved));
# else
# if !@HAVE_REALPATH@
_GL_FUNCDECL_SYS (realpath, char *,
- (const char *restrict name, char *restrict resolved)
- _GL_ARG_NONNULL ((1)));
+ (const char *restrict name, char *restrict resolved),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (realpath, char *,
(const char *restrict name, char *restrict resolved));
@@ -1473,7 +1569,8 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use
gnulib module "
/* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
# if !@HAVE_RPMATCH@
-_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch);
@@ -1489,7 +1586,8 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
/* Look up NAME in the environment, returning 0 in insecure situations. */
# if !@HAVE_SECURE_GETENV@
_GL_FUNCDECL_SYS (secure_getenv, char *,
- (char const *name) _GL_ARG_NONNULL ((1)));
+ (char const *name),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
_GL_CXXALIASWARN (secure_getenv);
@@ -1510,14 +1608,14 @@ _GL_WARN_ON_USE (secure_getenv, "secure_getenv is
unportable - "
# define setenv rpl_setenv
# endif
_GL_FUNCDECL_RPL (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
# if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
- (const char *name, const char *value, int replace)
+ (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (setenv, int,
@@ -1534,6 +1632,19 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
#endif
+#if @GNULIB_STACK_TRACE@
+/* Prints a stack trace of the current thread to standard error,
+ if possible. */
+# if @CAN_PRINT_STACK_TRACE@
+_GL_EXTERN_C void print_stack_trace (void);
+# else
+# if !GNULIB_defined_print_stack_trace
+# define print_stack_trace() /* nothing */
+# define GNULIB_defined_print_stack_trace 1
+# endif
+# endif
+#endif
+
#if @GNULIB_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOD@
@@ -1542,14 +1653,14 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif
# define GNULIB_defined_strtod_function 1
_GL_FUNCDECL_RPL (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtod, double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOD@
_GL_FUNCDECL_SYS (strtod, double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtod, double,
@@ -1566,6 +1677,38 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif
#endif
+#if @GNULIB_STRTOF@
+ /* Parse a float from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtof rpl_strtof
+# endif
+# define GNULIB_defined_strtof_function 1
+_GL_FUNCDECL_RPL (strtof, float,
+ (const char *restrict str, char **restrict endp),
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtof, float,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOF@
+_GL_FUNCDECL_SYS (strtof, float,
+ (const char *restrict str, char **restrict endp),
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtof, float,
+ (const char *restrict str, char **restrict endp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtof);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtof
+# if HAVE_RAW_DECL_STRTOF
+_GL_WARN_ON_USE (strtof, "strtof is unportable - "
+ "use gnulib module strtof for portability");
+# endif
+#endif
+
#if @GNULIB_STRTOLD@
/* Parse a 'long double' from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOLD@
@@ -1574,14 +1717,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif
# define GNULIB_defined_strtold_function 1
_GL_FUNCDECL_RPL (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtold, long double,
(const char *restrict str, char **restrict endp));
# else
# if !@HAVE_STRTOLD@
_GL_FUNCDECL_SYS (strtold, long double,
- (const char *restrict str, char **restrict endp)
+ (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtold, long double,
@@ -1612,7 +1755,7 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - "
# define GNULIB_defined_strtol_function 1
_GL_FUNCDECL_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtol, long,
(const char *restrict string, char **restrict endptr,
@@ -1621,7 +1764,7 @@ _GL_CXXALIAS_RPL (strtol, long,
# if !@HAVE_STRTOL@
_GL_FUNCDECL_SYS (strtol, long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtol, long,
@@ -1655,7 +1798,7 @@ _GL_WARN_ON_USE (strtol, "strtol is unportable - "
# define GNULIB_defined_strtoll_function 1
_GL_FUNCDECL_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr,
@@ -1664,7 +1807,7 @@ _GL_CXXALIAS_RPL (strtoll, long long,
# if !@HAVE_STRTOLL@
_GL_FUNCDECL_SYS (strtoll, long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoll, long long,
@@ -1695,7 +1838,7 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
# define GNULIB_defined_strtoul_function 1
_GL_FUNCDECL_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
@@ -1704,7 +1847,7 @@ _GL_CXXALIAS_RPL (strtoul, unsigned long,
# if !@HAVE_STRTOUL@
_GL_FUNCDECL_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoul, unsigned long,
@@ -1738,7 +1881,7 @@ _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
# define GNULIB_defined_strtoull_function 1
_GL_FUNCDECL_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
@@ -1747,7 +1890,7 @@ _GL_CXXALIAS_RPL (strtoull, unsigned long long,
# if !@HAVE_STRTOULL@
_GL_FUNCDECL_SYS (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr,
- int base)
+ int base),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
@@ -1786,11 +1929,11 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
-_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
# if !@HAVE_DECL_UNSETENV@
-_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
diff --git a/tp/Texinfo/XS/gnulib/lib/strchrnul.c
b/tp/Texinfo/XS/gnulib/lib/strchrnul.c
index 8724427b57..f7780519bd 100644
--- a/tp/Texinfo/XS/gnulib/lib/strchrnul.c
+++ b/tp/Texinfo/XS/gnulib/lib/strchrnul.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/strchrnul.valgrind
b/tp/Texinfo/XS/gnulib/lib/strchrnul.valgrind
index d998366eb1..0ae2e65e89 100644
--- a/tp/Texinfo/XS/gnulib/lib/strchrnul.valgrind
+++ b/tp/Texinfo/XS/gnulib/lib/strchrnul.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in strchrnul().
-# Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# Copyright (C) 2008-2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/streq.h b/tp/Texinfo/XS/gnulib/lib/streq.h
index 712948eba7..8593de6dff 100644
--- a/tp/Texinfo/XS/gnulib/lib/streq.h
+++ b/tp/Texinfo/XS/gnulib/lib/streq.h
@@ -1,5 +1,5 @@
/* Optimized string comparison.
- Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -21,6 +21,11 @@
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* STREQ_OPT allows to optimize string comparison with a small literal string.
STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
is semantically equivalent to
@@ -173,4 +178,9 @@ streq0 (const char *s1, const char *s2, char s20, char s21,
char s22, char s23,
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_STREQ_H */
diff --git a/tp/Texinfo/XS/gnulib/lib/striconveh.c
b/tp/Texinfo/XS/gnulib/lib/striconveh.c
index 0209dc6cf2..db83a1ddca 100644
--- a/tp/Texinfo/XS/gnulib/lib/striconveh.c
+++ b/tp/Texinfo/XS/gnulib/lib/striconveh.c
@@ -1,5 +1,5 @@
/* Character set conversion with error handling.
- Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This file is free software: you can redistribute it and/or modify
@@ -81,7 +81,8 @@ iconveh_open (const char *to_codeset, const char
*from_codeset, iconveh_t *cdp)
if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)
# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
&& !defined __UCLIBC__) \
- || _LIBICONV_VERSION >= 0x0105
+ || _LIBICONV_VERSION >= 0x0105 \
+ || defined ICONV_SET_TRANSLITERATE
|| c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0
# endif
)
@@ -138,11 +139,12 @@ iconveh_close (const iconveh_t *cd)
/* iconv_carefully is like iconv, except that it stops as soon as it encounters
a conversion error, and it returns in *INCREMENTED a boolean telling whether
it has incremented the input pointers past the error location. */
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined
__APPLE__)) \
+ && !(defined __GLIBC__ && !defined __UCLIBC__)
/* Irix iconv() inserts a NUL byte if it cannot convert.
NetBSD iconv() inserts a question mark if it cannot convert.
- Only GNU libiconv and GNU libc are known to prefer to fail rather
- than doing a lossy conversion. */
+ Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc are
+ known to prefer to fail rather than doing a lossy conversion. */
static size_t
iconv_carefully (iconv_t cd,
const char **inbuf, size_t *inbytesleft,
@@ -246,11 +248,12 @@ iconv_carefully_1 (iconv_t cd,
*inbuf = inptr;
*inbytesleft = inptr_end - inptr;
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined
__APPLE__)) \
+ && !(defined __GLIBC__ && !defined __UCLIBC__)
/* Irix iconv() inserts a NUL byte if it cannot convert.
NetBSD iconv() inserts a question mark if it cannot convert.
- Only GNU libiconv and GNU libc are known to prefer to fail rather
- than doing a lossy conversion. */
+ Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc are
+ known to prefer to fail rather than doing a lossy conversion. */
if (res != (size_t)(-1) && res > 0)
{
/* iconv() has already incremented INPTR. We cannot go back to a
@@ -810,7 +813,7 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
if (handler == iconveh_escape_sequence)
{
- static char hex[16] = "0123456789ABCDEF";
+ static char const hex[16] = "0123456789ABCDEF";
scratchlen = 0;
scratchbuf[scratchlen++] = '\\';
if (uc < 0x10000)
@@ -947,13 +950,15 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
}
length = out2ptr - result;
}
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined
__APPLE__)) \
+ && !(defined __GLIBC__ && !defined __UCLIBC__)
/* IRIX iconv() inserts a NUL byte if it cannot
convert.
FreeBSD iconv(), NetBSD iconv(), and Solaris 11
iconv() insert a '?' if they cannot convert.
musl libc iconv() inserts a '*' if it cannot
convert.
- Only GNU libiconv and GNU libc are known to prefer
- to fail rather than doing a lossy conversion. */
+ Only GNU libiconv (excluding the bastard Apple
iconv)
+ and GNU libc are known to prefer to fail rather than
+ doing a lossy conversion. */
if (res != (size_t)(-1) && res > 0)
{
errno = EILSEQ;
diff --git a/tp/Texinfo/XS/gnulib/lib/striconveh.h
b/tp/Texinfo/XS/gnulib/lib/striconveh.h
index b109af4ea9..dee51eb170 100644
--- a/tp/Texinfo/XS/gnulib/lib/striconveh.h
+++ b/tp/Texinfo/XS/gnulib/lib/striconveh.h
@@ -1,5 +1,5 @@
/* Character set conversion with error handling.
- Copyright (C) 2001-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/striconveha.c
b/tp/Texinfo/XS/gnulib/lib/striconveha.c
index f388c9f095..08008d8bdc 100644
--- a/tp/Texinfo/XS/gnulib/lib/striconveha.c
+++ b/tp/Texinfo/XS/gnulib/lib/striconveha.c
@@ -1,5 +1,5 @@
/* Character set conversion with error handling and autodetection.
- Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible.
This file is free software: you can redistribute it and/or modify
@@ -88,10 +88,6 @@ uniconv_register_autodetect (const char *name,
size_t listlen;
size_t memneed;
size_t i;
- char *memory;
- struct autodetect_alias *new_alias;
- char *new_name;
- const char **new_try_in_order;
/* The TRY_IN_ORDER list must not be empty. */
if (try_in_order[0] == NULL)
@@ -108,25 +104,24 @@ uniconv_register_autodetect (const char *name,
memneed += sizeof (char *) + strlen (try_in_order[i]) + 1;
listlen = i;
- memory = (char *) malloc (memneed);
+ void *memory = malloc (memneed);
if (memory != NULL)
{
- new_alias = (struct autodetect_alias *) memory;
- memory += sizeof (struct autodetect_alias);
+ struct autodetect_alias *new_alias = memory;
+ memory = new_alias + 1;
- new_try_in_order = (const char **) memory;
- memory += (listlen + 1) * sizeof (char *);
+ char const **new_try_in_order = memory;
+ memory = new_try_in_order + listlen + 1;
- new_name = (char *) memory;
- memcpy (new_name, name, namelen);
- memory += namelen;
+ char *new_name = memcpy (memory, name, namelen);
+ memory = new_name + namelen;
for (i = 0; i < listlen; i++)
{
size_t len = strlen (try_in_order[i]) + 1;
- memcpy (memory, try_in_order[i], len);
- new_try_in_order[i] = (const char *) memory;
- memory += len;
+ char *copy = memcpy (memory, try_in_order[i], len);
+ new_try_in_order[i] = copy;
+ memory = copy + len;
}
new_try_in_order[i] = NULL;
@@ -224,11 +219,12 @@ mem_iconveha (const char *src, size_t srclen,
return 0;
}
- /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
- we want to use transliteration. */
+ /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5 or Citrus/FreeBSD/macOS
+ iconv, we want to use transliteration. */
#if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
&& !defined __UCLIBC__) \
- || _LIBICONV_VERSION >= 0x0105
+ || _LIBICONV_VERSION >= 0x0105 \
+ || defined ICONV_SET_TRANSLITERATE
if (transliterate)
{
int retval;
@@ -331,11 +327,12 @@ str_iconveha (const char *src,
return result;
}
- /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
- we want to use transliteration. */
+ /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5 or Citrus/FreeBSD/macOS
+ iconv, we want to use transliteration. */
#if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
&& !defined __UCLIBC__) \
- || _LIBICONV_VERSION >= 0x0105
+ || _LIBICONV_VERSION >= 0x0105 \
+ || defined ICONV_SET_TRANSLITERATE
if (transliterate)
{
char *result;
diff --git a/tp/Texinfo/XS/gnulib/lib/striconveha.h
b/tp/Texinfo/XS/gnulib/lib/striconveha.h
index a5c307ea2a..e93d0b4c45 100644
--- a/tp/Texinfo/XS/gnulib/lib/striconveha.h
+++ b/tp/Texinfo/XS/gnulib/lib/striconveha.h
@@ -1,5 +1,5 @@
/* Character set conversion with error handling and autodetection.
- Copyright (C) 2002, 2005, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2007-2024 Free Software Foundation, Inc.
Written by Bruno Haible.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/string.in.h
b/tp/Texinfo/XS/gnulib/lib/string.in.h
index 8b62ae8fc9..a588e7e2c2 100644
--- a/tp/Texinfo/XS/gnulib/lib/string.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2023 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -79,7 +79,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -115,7 +115,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -198,7 +198,7 @@ _GL_EXTERN_C void free (void *);
#if @GNULIB_EXPLICIT_BZERO@
# if ! @HAVE_EXPLICIT_BZERO@
_GL_FUNCDECL_SYS (explicit_bzero, void,
- (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
+ (void *__dest, size_t __n), _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
_GL_CXXALIASWARN (explicit_bzero);
@@ -274,7 +274,7 @@ _GL_CXXALIASWARN (memccpy);
# undef memchr
# define memchr rpl_memchr
# endif
-_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_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
- "
# endif
_GL_FUNCDECL_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
- void const *__needle, size_t __needle_len)
+ void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *,
@@ -323,7 +323,7 @@ _GL_CXXALIAS_RPL (memmem, void *,
# if ! @HAVE_DECL_MEMMEM@
_GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
- void const *__needle, size_t __needle_len)
+ void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3)));
# endif
@@ -351,7 +351,7 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often
quadratic - "
# endif
_GL_FUNCDECL_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
@@ -360,7 +360,7 @@ _GL_CXXALIAS_RPL (mempcpy, void *,
# if !@HAVE_MEMPCPY@
_GL_FUNCDECL_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (mempcpy, void *,
@@ -381,7 +381,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
/* Search backwards through a block for a byte (specified as an int). */
#if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@
-_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -414,11 +414,21 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
/* Overwrite a block of memory. The compiler will not optimize
effects away, even if the block is dead after the call. */
#if @GNULIB_MEMSET_EXPLICIT@
-# if ! @HAVE_MEMSET_EXPLICIT@
+# if @REPLACE_MEMSET_EXPLICIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memset_explicit
+# define memset_explicit rpl_memset_explicit
+# endif
+_GL_FUNCDECL_RPL (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t
__n));
+# else
+# if !@HAVE_MEMSET_EXPLICIT@
_GL_FUNCDECL_SYS (memset_explicit, void *,
- (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
-# endif
+ (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
+# endif
_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t
__n));
+# endif
_GL_CXXALIASWARN (memset_explicit);
#elif defined GNULIB_POSIXCHECK
# undef memset_explicit
@@ -433,7 +443,7 @@ _GL_WARN_ON_USE (memset_explicit, "memset_explicit is
unportable - "
occur within N bytes. */
#if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@
-_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -471,14 +481,14 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
# define stpcpy rpl_stpcpy
# endif
_GL_FUNCDECL_RPL (stpcpy, char *,
- (char *restrict __dst, char const *restrict __src)
+ (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpcpy, char *,
(char *restrict __dst, char const *restrict __src));
# else
# if !@HAVE_STPCPY@
_GL_FUNCDECL_SYS (stpcpy, char *,
- (char *restrict __dst, char const *restrict __src)
+ (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (stpcpy, char *,
@@ -505,7 +515,7 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
@@ -514,7 +524,7 @@ _GL_CXXALIAS_RPL (stpncpy, char *,
# if ! @HAVE_STPNCPY@
_GL_FUNCDECL_SYS (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
- size_t __n)
+ size_t __n),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (stpncpy, char *,
@@ -550,14 +560,14 @@ _GL_WARN_ON_USE_CXX (strchr,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strchrnul rpl_strchrnul
# endif
-_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strchrnul, char *,
(const char *str, int ch));
# else
# if ! @HAVE_STRCHRNUL@
-_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -596,7 +606,7 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
# define strdup rpl_strdup
# endif
_GL_FUNCDECL_RPL (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
@@ -611,16 +621,17 @@ _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
/* strdup exists as a function and as a macro. Get rid of the macro. */
# undef strdup
# endif
-# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
+# if (!@HAVE_DECL_STRDUP@ || (__GNUC__ >= 11 && !defined __clang__)) \
+ && !defined strdup
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -629,17 +640,17 @@ _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
# endif
_GL_CXXALIASWARN (strdup);
#else
-# if __GNUC__ >= 11 && !defined strdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strdup
/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strdup, char *,
- (char const *__s)
+ (char const *__s),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -678,7 +689,7 @@ _GL_CXXALIASWARN (strdup);
# define strncat rpl_strncat
# endif
_GL_FUNCDECL_RPL (strncat, char *,
- (char *restrict dest, const char *restrict src, size_t n)
+ (char *restrict dest, const char *restrict src, size_t n),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strncat, char *,
(char *restrict dest, const char *restrict src, size_t n));
@@ -705,21 +716,22 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
# define strndup rpl_strndup
# endif
_GL_FUNCDECL_RPL (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
# else
-# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
+# if !@HAVE_DECL_STRNDUP@ \
+ || ((__GNUC__ >= 11 && !defined __clang__) && !defined strndup)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -728,17 +740,17 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s,
size_t __n));
# endif
_GL_CXXALIASWARN (strndup);
#else
-# if __GNUC__ >= 11 && !defined strndup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strndup
/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
- _GL_ATTRIBUTE_NOTHROW
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (strndup, char *,
- (char const *__s, size_t __n)
+ (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
@@ -761,13 +773,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
# undef strnlen
# define strnlen rpl_strnlen
# endif
-_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
# else
# if ! @HAVE_DECL_STRNLEN@
-_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
@@ -797,7 +809,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on
character strings "
/* Find the first occurrence in S of any character in ACCEPT. */
#if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@
-_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -882,7 +894,7 @@ _GL_WARN_ON_USE_CXX (strrchr,
#if @GNULIB_STRSEP@
# if ! @HAVE_STRSEP@
_GL_FUNCDECL_SYS (strsep, char *,
- (char **restrict __stringp, char const *restrict __delim)
+ (char **restrict __stringp, char const *restrict __delim),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (strsep, char *,
@@ -907,7 +919,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strstr rpl_strstr
# endif
-_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
@@ -953,7 +965,7 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many
systems, and cannot "
# define strcasestr rpl_strcasestr
# endif
_GL_FUNCDECL_RPL (strcasestr, char *,
- (const char *haystack, const char *needle)
+ (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *,
@@ -961,7 +973,7 @@ _GL_CXXALIAS_RPL (strcasestr, char *,
# else
# if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *,
- (const char *haystack, const char *needle)
+ (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
@@ -1028,7 +1040,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work
correctly on character "
# endif
_GL_FUNCDECL_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim,
- char **restrict save_ptr)
+ char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim,
@@ -1040,7 +1052,7 @@ _GL_CXXALIAS_RPL (strtok_r, char *,
# if ! @HAVE_DECL_STRTOK_R@
_GL_FUNCDECL_SYS (strtok_r, char *,
(char *restrict s, char const *restrict delim,
- char **restrict save_ptr)
+ char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (strtok_r, char *,
@@ -1075,12 +1087,12 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbslen rpl_mbslen
# endif
-_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
# else
-_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
@@ -1107,12 +1119,12 @@ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t
len)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
# endif
-_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
# else
-_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
@@ -1129,12 +1141,12 @@ _GL_CXXALIASWARN (mbschr);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsrchr rpl_mbsrchr /* avoid collision with system function */
# endif
-_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
# else
-_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
@@ -1224,12 +1236,12 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const
char *accept)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
# endif
-_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
# else
-_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
@@ -1319,12 +1331,12 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - "
# undef strerror_r
# define strerror_r rpl_strerror_r
# endif
-_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
# else
# if !@HAVE_DECL_STRERROR_R@
-_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
@@ -1419,12 +1431,22 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
#endif
#if @GNULIB_STRVERSCMP@
-# if !@HAVE_STRVERSCMP@
-_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+# if @REPLACE_STRVERSCMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strverscmp rpl_strverscmp
+# endif
+_GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *),
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
-# endif
+_GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *));
+# else
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *),
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+# endif
_GL_CXXALIASWARN (strverscmp);
#elif defined GNULIB_POSIXCHECK
# undef strverscmp
diff --git a/tp/Texinfo/XS/gnulib/lib/strndup.c
b/tp/Texinfo/XS/gnulib/lib/strndup.c
index 5c1f32ff61..abfa017267 100644
--- a/tp/Texinfo/XS/gnulib/lib/strndup.c
+++ b/tp/Texinfo/XS/gnulib/lib/strndup.c
@@ -1,6 +1,6 @@
/* A replacement function, for systems that lack strndup.
- Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2023 Free Software
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2024 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/strnlen.c
b/tp/Texinfo/XS/gnulib/lib/strnlen.c
index 09c010eac4..5231e4c595 100644
--- a/tp/Texinfo/XS/gnulib/lib/strnlen.c
+++ b/tp/Texinfo/XS/gnulib/lib/strnlen.c
@@ -1,6 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
- Written by Simon Josefsson.
+ Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -19,12 +18,17 @@
#include <string.h>
-/* Find the length of STRING, but scan at most MAXLEN characters.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
+/* Find the length of S, but scan at most MAXLEN bytes.
+ S must be a string if it starts with fewer than MAXLEN initialized bytes.
+ If no '\0' terminator is found in that many bytes, return MAXLEN. */
size_t
-strnlen (const char *string, size_t maxlen)
+strnlen (const char *s, size_t maxlen)
{
- const char *end = memchr (string, '\0', maxlen);
- return end ? (size_t) (end - string) : maxlen;
+ /* Do not use memchr, because on some platforms memchr has
+ undefined behavior if MAXLEN exceeds the number of bytes in S. */
+ size_t i;
+ for (i = 0; i < maxlen && s[i]; i++)
+ continue;
+ return i;
}
diff --git a/tp/Texinfo/XS/gnulib/lib/sys_types.in.h
b/tp/Texinfo/XS/gnulib/lib/sys_types.in.h
index ea77e140be..4eb2e92696 100644
--- a/tp/Texinfo/XS/gnulib/lib/sys_types.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/sys_types.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
- Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -60,6 +60,15 @@
# define _GL_WINDOWS_64_BIT_OFF_T 1
#endif
+/* Define the off64_t type. */
+#if !@HAVE_OFF64_T@
+# if !GNULIB_defined_off64_t
+/* Define off64_t to int64_t always. */
+typedef long long off64_t;
+# define GNULIB_defined_off64_t 1
+# endif
+#endif
+
/* Override dev_t and ino_t if distinguishable inodes support is requested
on native Windows. */
#if @WINDOWS_STAT_INODES@
diff --git a/tp/Texinfo/XS/gnulib/lib/uniconv.in.h
b/tp/Texinfo/XS/gnulib/lib/uniconv.in.h
index d3efab2048..9af01bd82d 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniconv.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniconv.in.h
@@ -1,5 +1,5 @@
/* Conversions between Unicode and legacy encodings.
- Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/uniconv/u-strconv-from-enc.h
b/tp/Texinfo/XS/gnulib/lib/uniconv/u-strconv-from-enc.h
index 6f45284e0e..9f3e099d14 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniconv/u-strconv-from-enc.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniconv/u-strconv-from-enc.h
@@ -1,5 +1,5 @@
/* Conversion to UTF-8/UTF-16/UTF-32 from legacy encodings.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/uniconv/u8-conv-from-enc.c
b/tp/Texinfo/XS/gnulib/lib/uniconv/u8-conv-from-enc.c
index 407d1c51d7..424a949e6f 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniconv/u8-conv-from-enc.c
+++ b/tp/Texinfo/XS/gnulib/lib/uniconv/u8-conv-from-enc.c
@@ -1,5 +1,5 @@
/* Conversion to UTF-8 from legacy encodings.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/uniconv/u8-strconv-from-enc.c
b/tp/Texinfo/XS/gnulib/lib/uniconv/u8-strconv-from-enc.c
index e8dff2c576..22811c7718 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniconv/u8-strconv-from-enc.c
+++ b/tp/Texinfo/XS/gnulib/lib/uniconv/u8-strconv-from-enc.c
@@ -1,5 +1,5 @@
/* Conversion to UTF-8 from legacy encodings.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/unictype/bitmap.h
b/tp/Texinfo/XS/gnulib/lib/unictype/bitmap.h
index 9da85c1126..dba2365516 100644
--- a/tp/Texinfo/XS/gnulib/lib/unictype/bitmap.h
+++ b/tp/Texinfo/XS/gnulib/lib/unictype/bitmap.h
@@ -1,5 +1,5 @@
/* Three-level bitmap lookup.
- Copyright (C) 2000-2002, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002, 2005-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2000-2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistd.c
b/tp/Texinfo/XS/gnulib/lib/unistd.c
index be7a825503..f3b3f7bd2f 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistd.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistd.c
@@ -1,6 +1,6 @@
/* Inline functions for <unistd.h>.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,5 +18,5 @@
#include <config.h>
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
-#include "unistd.h"
+#include <unistd.h>
typedef int dummy;
diff --git a/tp/Texinfo/XS/gnulib/lib/unistd.in.h
b/tp/Texinfo/XS/gnulib/lib/unistd.in.h
index 2ae040a76b..3222f5a568 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistd.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -69,8 +69,8 @@
#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
#define _@GUARD_PREFIX@_UNISTD_H
-/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
- HAVE_RAW_DECL_*. */
+/* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -159,8 +159,9 @@
#endif
/* MSVC defines off_t in <sys/types.h>.
- May also define off_t to a 64-bit type on native Windows. */
-/* Get off_t, ssize_t, mode_t. */
+ May also define off_t to a 64-bit type on native Windows.
+ Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
+/* Get off_t, off64_t, ssize_t, mode_t. */
#include <sys/types.h>
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -286,7 +287,7 @@ _GL_INLINE_HEADER_BEGIN
# undef access
# define access rpl_access
# endif
-_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
+_GL_FUNCDECL_RPL (access, int, (const char *file, int mode),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
# elif defined _WIN32 && !defined __CYGWIN__
@@ -339,7 +340,7 @@ _GL_CXXALIASWARN (chdir);
#elif defined GNULIB_POSIXCHECK
# undef chdir
# if HAVE_RAW_DECL_CHDIR
-_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+_GL_WARN_ON_USE (chdir, "chdir is not always in <unistd.h> - "
"use gnulib module chdir for portability");
# endif
#elif @GNULIB_MDA_CHDIR@
@@ -370,13 +371,13 @@ _GL_CXXALIASWARN (chdir);
# undef chown
# define chown rpl_chown
# endif
-_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
# else
# if !@HAVE_CHOWN@
-_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
# endif
@@ -411,8 +412,10 @@ _GL_CXXALIAS_SYS (close, int, (int fd));
# endif
_GL_CXXALIASWARN (close);
#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
-# undef close
-# define close close_used_without_requesting_gnulib_module_close
+# if !GNULIB_CLOSE
+# undef close
+# define close close_used_without_requesting_gnulib_module_close
+# endif
#elif defined GNULIB_POSIXCHECK
# undef close
/* Assume close is always declared. */
@@ -473,7 +476,7 @@ _GL_WARN_ON_USE (copy_file_range,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup rpl_dup
# endif
-_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_FUNCDECL_RPL (dup, int, (int oldfd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (dup, int, (int oldfd));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -636,7 +639,7 @@ rpl_environ (void)
/* Like access(), except that it uses the effective user id and group id of
the current process. */
# if !@HAVE_EUIDACCESS@
-_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
@@ -661,7 +664,7 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
# undef execl
# define execl rpl_execl
# endif
-_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
# else
@@ -696,7 +699,7 @@ _GL_CXXALIASWARN (execl);
# undef execle
# define execle rpl_execle
# endif
-_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
# else
@@ -732,7 +735,7 @@ _GL_CXXALIASWARN (execle);
# undef execlp
# define execlp rpl_execlp
# endif
-_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
# else
@@ -769,7 +772,7 @@ _GL_CXXALIASWARN (execlp);
# undef execv
# define execv rpl_execv
# endif
-_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
# else
@@ -806,7 +809,7 @@ _GL_CXXALIASWARN (execv);
# define execve rpl_execve
# endif
_GL_FUNCDECL_RPL (execve, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execve, int,
(const char *program, char * const *argv, char * const
*env));
@@ -846,7 +849,7 @@ _GL_CXXALIASWARN (execve);
# undef execvp
# define execvp rpl_execvp
# endif
-_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
# else
@@ -883,14 +886,14 @@ _GL_CXXALIASWARN (execvp);
# define execvpe rpl_execvpe
# endif
_GL_FUNCDECL_RPL (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvpe, int,
(const char *program, char * const *argv, char * const
*env));
# else
# if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (execvpe, int,
@@ -921,7 +924,7 @@ _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
# elif @HAVE_EXECVPE@
# if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int,
- (const char *program, char * const *argv, char * const *env)
+ (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (execvpe, int,
@@ -940,15 +943,15 @@ _GL_CXXALIASWARN (execvpe);
# define faccessat rpl_faccessat
# endif
_GL_FUNCDECL_RPL (faccessat, int,
- (int fd, char const *name, int mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *name, int mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (faccessat, int,
(int fd, char const *name, int mode, int flag));
# else
# if !@HAVE_FACCESSAT@
_GL_FUNCDECL_SYS (faccessat, int,
- (int fd, char const *file, int mode, int flag)
- _GL_ARG_NONNULL ((2)));
+ (int fd, char const *file, int mode, int flag),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (faccessat, int,
(int fd, char const *file, int mode, int flag));
@@ -971,23 +974,28 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
Return 0 if successful, otherwise -1 and errno set.
See the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.
*/
-# if ! @HAVE_FCHDIR@
-_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
-
+# if @REPLACE_FCHDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchdir
+# define fchdir rpl_fchdir
+# endif
+_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/));
+# else
+# if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
+# endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+# endif
+_GL_CXXALIASWARN (fchdir);
+# if @REPLACE_FCHDIR@ || !@HAVE_FCHDIR@
/* Gnulib internal hooks needed to maintain the fchdir metadata. */
_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
_GL_ARG_NONNULL ((2));
_GL_EXTERN_C void _gl_unregister_fd (int fd);
_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
_GL_EXTERN_C const char *_gl_directory_name (int fd);
-
-# else
-# if !@HAVE_DECL_FCHDIR@
-_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
-# endif
# endif
-_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
-_GL_CXXALIASWARN (fchdir);
#elif defined GNULIB_POSIXCHECK
# undef fchdir
# if HAVE_RAW_DECL_FCHDIR
@@ -1004,15 +1012,15 @@ _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
# define fchownat rpl_fchownat
# endif
_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
- uid_t owner, gid_t group, int flag)
- _GL_ARG_NONNULL ((2)));
+ uid_t owner, gid_t group, int flag),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag));
# else
# if !@HAVE_FCHOWNAT@
_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
- uid_t owner, gid_t group, int flag)
- _GL_ARG_NONNULL ((2)));
+ uid_t owner, gid_t group, int flag),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag));
@@ -1086,13 +1094,17 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
# undef ftruncate
# define ftruncate rpl_ftruncate
# endif
-_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
-_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+_GL_FUNCDECL_RPL (ftruncate, int,
+ (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (ftruncate, int,
+ (int fd, off_t length));
# else
# if !@HAVE_FTRUNCATE@
-_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
+_GL_FUNCDECL_SYS (ftruncate, int,
+ (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_SYS (ftruncate, int,
+ (int fd, off_t length));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ftruncate);
@@ -1113,15 +1125,16 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
or SIZE was too small.
See the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
- Additionally, the gnulib module 'getcwd' guarantees the following GNU
- extension: If BUF is NULL, an array is allocated with 'malloc'; the array
- is SIZE bytes long, unless SIZE == 0, in which case it is as big as
- necessary. */
+ Additionally, the gnulib module 'getcwd' or 'getcwd-lgpl' guarantees the
+ following GNU extension: If BUF is NULL, an array is allocated with
+ 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case
+ it is as big as necessary. */
# if @REPLACE_GETCWD@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getcwd rpl_getcwd
# endif
-_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size),
+ _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1176,15 +1189,19 @@ _GL_CXXALIASWARN (getcwd);
# undef getdomainname
# define getdomainname rpl_getdomainname
# endif
-_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+_GL_FUNCDECL_RPL (getdomainname, int,
+ (char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getdomainname, int,
+ (char *name, size_t len));
# else
# if !@HAVE_DECL_GETDOMAINNAME@
-_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (getdomainname, int,
+ (char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
+_GL_CXXALIAS_SYS (getdomainname, int,
+ (char *name, size_t len));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdomainname);
@@ -1233,13 +1250,17 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is
unportable - "
# undef getentropy
# define getentropy rpl_getentropy
# endif
-_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length));
-_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length));
+_GL_FUNCDECL_RPL (getentropy, int,
+ (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getentropy, int,
+ (void *buffer, size_t length));
# else
# if !@HAVE_GETENTROPY@
-_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_FUNCDECL_SYS (getentropy, int,
+ (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIAS_SYS (getentropy, int,
+ (void *buffer, size_t length));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getentropy);
@@ -1264,13 +1285,17 @@ _GL_WARN_ON_USE (getentropy, "getentropy is unportable
- "
# undef getgroups
# define getgroups rpl_getgroups
# endif
-_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
-_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_FUNCDECL_RPL (getgroups, int,
+ (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (getgroups, int,
+ (int n, gid_t *groups));
# else
# if !@HAVE_GETGROUPS@
-_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+_GL_FUNCDECL_SYS (getgroups, int,
+ (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_SYS (getgroups, int,
+ (int n, gid_t *groups));
# endif
_GL_CXXALIASWARN (getgroups);
#elif defined GNULIB_POSIXCHECK
@@ -1295,12 +1320,12 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
# undef gethostname
# define gethostname rpl_gethostname
# endif
-_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
# else
# if !@HAVE_GETHOSTNAME@
-_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
@@ -1310,8 +1335,10 @@ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name,
size_t len));
# endif
_GL_CXXALIASWARN (gethostname);
#elif @UNISTD_H_HAVE_WINSOCK2_H@
-# undef gethostname
-# define gethostname
gethostname_used_without_requesting_gnulib_module_gethostname
+# if !GNULIB_GETHOSTNAME
+# undef gethostname
+# define gethostname
gethostname_used_without_requesting_gnulib_module_gethostname
+# endif
#elif defined GNULIB_POSIXCHECK
# undef gethostname
# if HAVE_RAW_DECL_GETHOSTNAME
@@ -1365,12 +1392,12 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getlogin_r rpl_getlogin_r
# endif
-_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
# else
# if !@HAVE_DECL_GETLOGIN_R@
-_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Solaris 10 systems, the second argument is
@@ -1487,12 +1514,12 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is
unportable - "
# undef getpass
# define getpass rpl_getpass
# endif
-_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
# else
# if !@HAVE_GETPASS@
-_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
@@ -1525,12 +1552,21 @@ _GL_CXXALIASWARN (getpid);
#if @GNULIB_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
/* Return the next valid login shell on the system, or NULL when the end of
the list has been reached. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getusershell
+# define getusershell rpl_getusershell
+# endif
+_GL_FUNCDECL_RPL (getusershell, char *, (void));
+_GL_CXXALIAS_RPL (getusershell, char *, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (getusershell, char *, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (getusershell, char *, (void));
+# endif
_GL_CXXALIASWARN (getusershell);
#elif defined GNULIB_POSIXCHECK
# undef getusershell
@@ -1542,10 +1578,19 @@ _GL_WARN_ON_USE (getusershell, "getusershell is
unportable - "
#if @GNULIB_GETUSERSHELL@
/* Rewind to pointer that is advanced at each getusershell() call. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setusershell
+# define setusershell rpl_setusershell
+# endif
+_GL_FUNCDECL_RPL (setusershell, void, (void));
+_GL_CXXALIAS_RPL (setusershell, void, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (setusershell, void, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (setusershell, void, (void));
+# endif
_GL_CXXALIASWARN (setusershell);
#elif defined GNULIB_POSIXCHECK
# undef setusershell
@@ -1558,10 +1603,19 @@ _GL_WARN_ON_USE (setusershell, "setusershell is
unportable - "
#if @GNULIB_GETUSERSHELL@
/* Free the pointer that is advanced at each getusershell() call and
associated resources. */
-# if !@HAVE_DECL_GETUSERSHELL@
+# if @REPLACE_GETUSERSHELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef endusershell
+# define endusershell rpl_endusershell
+# endif
+_GL_FUNCDECL_RPL (endusershell, void, (void));
+_GL_CXXALIAS_RPL (endusershell, void, (void));
+# else
+# if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (endusershell, void, (void));
-# endif
+# endif
_GL_CXXALIAS_SYS (endusershell, void, (void));
+# endif
_GL_CXXALIASWARN (endusershell);
#elif defined GNULIB_POSIXCHECK
# undef endusershell
@@ -1641,13 +1695,13 @@ _GL_CXXALIASWARN (isatty);
# undef lchown
# define lchown rpl_lchown
# endif
-_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
# else
# if !@HAVE_LCHOWN@
-_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
# endif
@@ -1670,13 +1724,13 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to
pre-POSIX.1-2001 systems - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define link rpl_link
# endif
-_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
# else
# if !@HAVE_LINK@
-_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
# endif
@@ -1701,8 +1755,8 @@ _GL_WARN_ON_USE (link, "link is unportable - "
# endif
_GL_FUNCDECL_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
- int flag)
- _GL_ARG_NONNULL ((2, 4)));
+ int flag),
+ _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
int flag));
@@ -1710,8 +1764,8 @@ _GL_CXXALIAS_RPL (linkat, int,
# if !@HAVE_LINKAT@
_GL_FUNCDECL_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
- int flag)
- _GL_ARG_NONNULL ((2, 4)));
+ int flag),
+ _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
@@ -1778,7 +1832,8 @@ _GL_CXXALIASWARN (lseek);
Store the read-end as fd[0] and the write-end as fd[1].
Return 0 upon success, or -1 with errno set upon failure. */
# if !@HAVE_PIPE@
-_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
_GL_CXXALIASWARN (pipe);
@@ -1805,10 +1860,12 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
# undef pipe2
# define pipe2 rpl_pipe2
# endif
-_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
# else
-_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
# endif
# if __GLIBC__ >= 2
@@ -1835,15 +1892,15 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
# define pread rpl_pread
# endif
_GL_FUNCDECL_RPL (pread, ssize_t,
- (int fd, void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset));
# else
# if !@HAVE_PREAD@
_GL_FUNCDECL_SYS (pread, ssize_t,
- (int fd, void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset));
@@ -1872,15 +1929,15 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
# define pwrite rpl_pwrite
# endif
_GL_FUNCDECL_RPL (pwrite, ssize_t,
- (int fd, const void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, const void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset));
# else
# if !@HAVE_PWRITE@
_GL_FUNCDECL_SYS (pwrite, ssize_t,
- (int fd, const void *buf, size_t bufsize, off_t offset)
- _GL_ARG_NONNULL ((2)));
+ (int fd, const void *buf, size_t bufsize, off_t offset),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset));
@@ -1906,8 +1963,9 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
# undef read
# define read rpl_read
# endif
-_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
- _GL_ARG_NONNULL ((2)));
+
+_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count),
+ _GL_ARG_NONNULL ((2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1928,11 +1986,7 @@ _GL_CXXALIASWARN (read);
# undef read
# define read _read
# endif
-# ifdef __MINGW32__
-_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
-# else
-_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
-# endif
+_GL_CXXALIAS_MDA_CAST (read, ssize_t, (int fd, void *buf, unsigned int count));
# else
_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
# endif
@@ -1952,8 +2006,8 @@ _GL_CXXALIASWARN (read);
# endif
_GL_FUNCDECL_RPL (readlink, ssize_t,
(const char *restrict file,
- char *restrict buf, size_t bufsize)
- _GL_ARG_NONNULL ((1, 2)));
+ char *restrict buf, size_t bufsize),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlink, ssize_t,
(const char *restrict file,
char *restrict buf, size_t bufsize));
@@ -1961,8 +2015,8 @@ _GL_CXXALIAS_RPL (readlink, ssize_t,
# if !@HAVE_READLINK@
_GL_FUNCDECL_SYS (readlink, ssize_t,
(const char *restrict file,
- char *restrict buf, size_t bufsize)
- _GL_ARG_NONNULL ((1, 2)));
+ char *restrict buf, size_t bufsize),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (readlink, ssize_t,
(const char *restrict file,
@@ -1985,8 +2039,8 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
# endif
_GL_FUNCDECL_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file,
- char *restrict buf, size_t len)
- _GL_ARG_NONNULL ((2, 3)));
+ char *restrict buf, size_t len),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file,
char *restrict buf, size_t len));
@@ -1994,8 +2048,8 @@ _GL_CXXALIAS_RPL (readlinkat, ssize_t,
# if !@HAVE_READLINKAT@
_GL_FUNCDECL_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file,
- char *restrict buf, size_t len)
- _GL_ARG_NONNULL ((2, 3)));
+ char *restrict buf, size_t len),
+ _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file,
@@ -2019,7 +2073,7 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable
- "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define rmdir rpl_rmdir
# endif
-_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2068,18 +2122,22 @@ _GL_CXXALIASWARN (rmdir);
# undef sethostname
# define sethostname rpl_sethostname
# endif
-_GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len));
+_GL_FUNCDECL_RPL (sethostname, int,
+ (const char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (sethostname, int,
+ (const char *name, size_t len));
# else
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
-_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (sethostname, int,
+ (const char *name, size_t len),
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif
/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
and FreeBSD 6.4 the second parameter is int. On Solaris 11
2011-10, the first parameter is not const. */
-_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIAS_SYS_CAST (sethostname, int,
+ (const char *name, size_t len));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sethostname);
@@ -2152,15 +2210,19 @@ _GL_CXXALIASWARN (swab);
# undef symlink
# define symlink rpl_symlink
# endif
-_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
- _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+_GL_FUNCDECL_RPL (symlink, int,
+ (char const *contents, char const *file),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (symlink, int,
+ (char const *contents, char const *file));
# else
# if !@HAVE_SYMLINK@
-_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
- _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_SYS (symlink, int,
+ (char const *contents, char const *file),
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif
-_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
+_GL_CXXALIAS_SYS (symlink, int,
+ (char const *contents, char const *file));
# endif
_GL_CXXALIASWARN (symlink);
#elif defined GNULIB_POSIXCHECK
@@ -2179,15 +2241,15 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - "
# define symlinkat rpl_symlinkat
# endif
_GL_FUNCDECL_RPL (symlinkat, int,
- (char const *contents, int fd, char const *file)
- _GL_ARG_NONNULL ((1, 3)));
+ (char const *contents, int fd, char const *file),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (symlinkat, int,
(char const *contents, int fd, char const *file));
# else
# if !@HAVE_SYMLINKAT@
_GL_FUNCDECL_SYS (symlinkat, int,
- (char const *contents, int fd, char const *file)
- _GL_ARG_NONNULL ((1, 3)));
+ (char const *contents, int fd, char const *file),
+ _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (symlinkat, int,
(char const *contents, int fd, char const *file));
@@ -2214,13 +2276,13 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable
- "
# undef truncate
# define truncate rpl_truncate
# endif
-_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
# else
# if !@HAVE_DECL_TRUNCATE@
-_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
- _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length),
+ _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
# endif
@@ -2245,13 +2307,15 @@ _GL_WARN_ON_USE (truncate, "truncate is unportable - "
# define ttyname_r rpl_ttyname_r
# endif
_GL_FUNCDECL_RPL (ttyname_r, int,
- (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+ (int fd, char *buf, size_t buflen),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen));
# else
# if !@HAVE_DECL_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int,
- (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+ (int fd, char *buf, size_t buflen),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif
_GL_CXXALIAS_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen));
@@ -2274,7 +2338,7 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
# undef unlink
# define unlink rpl_unlink
# endif
-_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (unlink, int, (char const *file), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unlink, int, (char const *file));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2315,12 +2379,12 @@ _GL_CXXALIASWARN (unlink);
# undef unlinkat
# define unlinkat rpl_unlinkat
# endif
-_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
# else
# if !@HAVE_UNLINKAT@
-_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
@@ -2374,17 +2438,21 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
# undef write
# define write rpl_write
# endif
-_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_FUNCDECL_RPL (write, ssize_t,
+ (int fd, const void *buf, size_t count),
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
+_GL_CXXALIAS_RPL (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef write
# define write _write
# endif
-_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_MDA (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# else
-_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_SYS (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# endif
_GL_CXXALIASWARN (write);
#elif @GNULIB_MDA_WRITE@
@@ -2396,13 +2464,11 @@ _GL_CXXALIASWARN (write);
# undef write
# define write _write
# endif
-# ifdef __MINGW32__
-_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
-# else
-_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int
count));
-# endif
+_GL_CXXALIAS_MDA_CAST (write, ssize_t,
+ (int fd, const void *buf, unsigned int count));
# else
-_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_SYS (write, ssize_t,
+ (int fd, const void *buf, size_t count));
# endif
_GL_CXXALIASWARN (write);
#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr.in.h
b/tp/Texinfo/XS/gnulib/lib/unistr.in.h
index a4cc69912f..424678fc6f 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/unistr.in.h
@@ -1,5 +1,5 @@
/* Elementary Unicode string functions.
- Copyright (C) 2001-2002, 2005-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-check.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-check.c
index 53217006ea..556f992763 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-check.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-check.c
@@ -1,5 +1,5 @@
/* Check UTF-8 string.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mblen.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mblen.c
index d989afc437..79878f24cd 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mblen.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mblen.c
@@ -1,5 +1,5 @@
/* Look at first character in UTF-8 string.
- Copyright (C) 1999-2000, 2002, 2006-2007, 2009-2023 Free Software
+ Copyright (C) 1999-2000, 2002, 2006-2007, 2009-2024 Free Software
Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbsnlen.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbsnlen.c
index 947bcdcc02..5c9bd43d3b 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbsnlen.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbsnlen.c
@@ -1,5 +1,5 @@
/* Count characters in UTF-8 string.
- Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software.
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-aux.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-aux.c
index 15568c3bc8..22ed807b0e 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-aux.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-aux.c
@@ -1,5 +1,5 @@
/* Conversion UTF-8 to UCS-4.
- Copyright (C) 2001-2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe-aux.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe-aux.c
index 9e2e34b007..c763bd4441 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe-aux.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe-aux.c
@@ -1,5 +1,5 @@
/* Conversion UTF-8 to UCS-4.
- Copyright (C) 2001-2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe.c
index 71d0db839c..bfd649412a 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc-unsafe.c
@@ -1,5 +1,5 @@
/* Look at first character in UTF-8 string.
- Copyright (C) 1999-2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc.c
index 920ad6f558..6a863a6a36 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtouc.c
@@ -1,5 +1,5 @@
/* Look at first character in UTF-8 string.
- Copyright (C) 1999-2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtoucr.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtoucr.c
index 296062d233..564e47e91d 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtoucr.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-mbtoucr.c
@@ -1,5 +1,5 @@
/* Look at first character in UTF-8 string, returning an error code.
- Copyright (C) 1999-2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-prev.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-prev.c
index ad8a347c19..d733f758a7 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-prev.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-prev.c
@@ -1,5 +1,5 @@
/* Iterate over previous character in UTF-8 string.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-strlen.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-strlen.c
index 40b35a3fe7..7f489e336d 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-strlen.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-strlen.c
@@ -1,5 +1,5 @@
/* Determine length of UTF-8 string.
- Copyright (C) 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb-aux.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb-aux.c
index 6deeeb72e2..ffe567d92f 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb-aux.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb-aux.c
@@ -1,5 +1,5 @@
/* Conversion UCS-4 to UTF-8.
- Copyright (C) 2002, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb.c
b/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb.c
index 58de19bb1a..0f903fdbd6 100644
--- a/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb.c
+++ b/tp/Texinfo/XS/gnulib/lib/unistr/u8-uctomb.c
@@ -1,5 +1,5 @@
/* Store a character in UTF-8 string.
- Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/unitypes.in.h
b/tp/Texinfo/XS/gnulib/lib/unitypes.in.h
index d3a4c67a19..16010d3796 100644
--- a/tp/Texinfo/XS/gnulib/lib/unitypes.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/unitypes.in.h
@@ -1,5 +1,5 @@
/* Elementary types and macros for the GNU UniString library.
- Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,6 +20,11 @@
/* Get uint8_t, uint16_t, uint32_t. */
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Type representing a Unicode character. */
typedef uint32_t ucs4_t;
@@ -58,4 +63,9 @@ typedef uint32_t ucs4_t;
# endif
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _UNITYPES_H */
diff --git a/tp/Texinfo/XS/gnulib/lib/uniwidth.in.h
b/tp/Texinfo/XS/gnulib/lib/uniwidth.in.h
index 66829e459d..58bfe9c1ea 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniwidth.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniwidth.in.h
@@ -1,5 +1,5 @@
/* Display width functions.
- Copyright (C) 2001-2002, 2005, 2007, 2009-2023 Free Software Foundation,
+ Copyright (C) 2001-2002, 2005, 2007, 2009-2024 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/uniwidth/cjk.h
b/tp/Texinfo/XS/gnulib/lib/uniwidth/cjk.h
index 98f7e92669..5fab365f97 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniwidth/cjk.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniwidth/cjk.h
@@ -1,5 +1,5 @@
/* Test for CJK encoding.
- Copyright (C) 2001-2002, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2005-2007, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/uniwidth/width.c
b/tp/Texinfo/XS/gnulib/lib/uniwidth/width.c
index c9d4d1dfe6..4942aa1e78 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniwidth/width.c
+++ b/tp/Texinfo/XS/gnulib/lib/uniwidth/width.c
@@ -1,5 +1,5 @@
/* Determine display width of Unicode character.
- Copyright (C) 2001-2002, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software: you can redistribute it and/or modify
diff --git a/tp/Texinfo/XS/gnulib/lib/uniwidth/width0.h
b/tp/Texinfo/XS/gnulib/lib/uniwidth/width0.h
index 0c1713ac52..6cc35536ad 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniwidth/width0.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniwidth/width0.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Table of non-spacing or control characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -46,19 +46,19 @@ static const unsigned char nonspacing_table_data[48*64] = {
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */
0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */
/* 0x0600-0x07ff */
- 0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
+ 0x00, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */
- 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
- 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
+ 0x00, 0x00, 0xc0, 0x9f, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x20, /* 0x07c0-0x07ff */
/* 0x0800-0x09ff */
0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */
0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */
- 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
- 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
+ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
+ 0x00, 0xfc, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */
0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */
@@ -273,8 +273,8 @@ static const unsigned char nonspacing_table_data[48*64] = {
/* 0x11000-0x111ff */
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x80, /* 0x11040-0x1107f */
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */
- 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x06, /* 0x11080-0x110bf */
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */
diff --git a/tp/Texinfo/XS/gnulib/lib/uniwidth/width2.h
b/tp/Texinfo/XS/gnulib/lib/uniwidth/width2.h
index 19c8c02a51..47979b5d7e 100644
--- a/tp/Texinfo/XS/gnulib/lib/uniwidth/width2.h
+++ b/tp/Texinfo/XS/gnulib/lib/uniwidth/width2.h
@@ -1,8 +1,8 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Width 2 property of Unicode characters. */
-/* Generated automatically by gen-uni-tables.c for Unicode 15.0.0. */
+/* Generated automatically by gen-uni-tables.c for Unicode 15.1.0. */
-/* Copyright (C) 2000-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/vasnprintf.c
b/tp/Texinfo/XS/gnulib/lib/vasnprintf.c
index 2d9aa977ec..6ae95ca5dd 100644
--- a/tp/Texinfo/XS/gnulib/lib/vasnprintf.c
+++ b/tp/Texinfo/XS/gnulib/lib/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -64,7 +64,7 @@
/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that main's
use of CHECK macros expands to code that is too complicated for gcc
-fanalyzer. Suppress the resulting bogus warnings. */
-#if 10 <= __GNUC__
+#if _GL_GNUC_PREREQ (10, 0)
# pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
#endif
@@ -80,13 +80,14 @@
#endif
#include <locale.h> /* localeconv() */
+#include <stdint.h> /* PTRDIFF_MAX */
#include <stdio.h> /* snprintf(), sprintf() */
#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
#include <string.h> /* memcpy(), strlen() */
#include <wchar.h> /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb(),
mbszero() */
#include <errno.h> /* errno */
-#include <limits.h> /* CHAR_BIT, INT_WIDTH, LONG_WIDTH */
-#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#include <limits.h> /* CHAR_BIT, INT_MAX, INT_WIDTH, LONG_WIDTH */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP, LDBL_MANT_DIG */
#if HAVE_NL_LANGINFO
# include <langinfo.h>
#endif
@@ -231,7 +232,7 @@
#undef remainder
#define remainder rem
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) &&
!WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
(PTRDIFF_MAX > INT_MAX)) && !WIDE_CHAR_VERSION
# if (HAVE_STRNLEN && !defined _AIX)
# define local_strnlen strnlen
# else
@@ -247,7 +248,7 @@ local_strnlen (const char *string, size_t maxlen)
# endif
#endif
-#if (((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) ||
((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) &&
HAVE_WCHAR_T
+#if ((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || (PTRDIFF_MAX > INT_MAX) || !DCHAR_IS_TCHAR ||
NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF ||
(PTRDIFF_MAX > INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)
# if HAVE_WCSLEN
# define local_wcslen wcslen
# else
@@ -270,7 +271,7 @@ local_wcslen (const wchar_t *s)
# endif
#endif
-#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T &&
WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION
# if HAVE_WCSNLEN && HAVE_DECL_WCSNLEN
# define local_wcsnlen wcsnlen
# else
@@ -289,12 +290,12 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
# endif
#endif
-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) &&
!WIDE_CHAR_VERSION
+#if ((!USE_SNPRINTF || (PTRDIFF_MAX > INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) &&
!WIDE_CHAR_VERSION
# if ENABLE_WCHAR_FALLBACK
static size_t
wctomb_fallback (char *s, wchar_t wc)
{
- static char hex[16] = "0123456789ABCDEF";
+ static char const hex[16] = "0123456789ABCDEF";
s[0] = '\\';
if (sizeof (wchar_t) > 2 && wc > 0xffff)
@@ -406,8 +407,45 @@ is_infinite_or_zerol (long double x)
#endif
+#if NEED_PRINTF_LONG_DOUBLE
+
+/* Like frexpl, except that it supports even "unsupported" numbers. */
+# if (LDBL_MANT_DIG == 64 && (defined __ia64 || (defined __x86_64__ || defined
__amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined
_M_IX86 || defined _X86_))) && (defined __APPLE__ && defined __MACH__)
+/* Don't assume that frexpl can handle pseudo-denormals; it does not on
+ macOS 12/x86_64. Therefore test for a pseudo-denormal explicitly. */
+
+static
+long double safe_frexpl (long double x, int *exp)
+{
+ union
+ {
+ long double value;
+ struct { unsigned int mant_word[2]; unsigned short sign_exp_word; } r;
+ }
+ u;
+ u.value = x;
+ if (u.r.sign_exp_word == 0 && (u.r.mant_word[1] & 0x80000000u) != 0)
+ {
+ /* Pseudo-Denormal. */
+ *exp = LDBL_MIN_EXP;
+ u.r.sign_exp_word = 1 - LDBL_MIN_EXP;
+ return u.value;
+ }
+ else
+ return frexpl (x, exp);
+}
+
+# else
+# define safe_frexpl frexpl
+# endif
+
+#endif
+
#if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE
+/* An indicator for a failed memory allocation. */
+# define NOMEM_PTR ((void *) (-1))
+
/* Converting 'long double' to decimal without rare rounding bugs requires
real bignums. We use the naming conventions of GNU gmp, but vastly simpler
(and slower) algorithms. */
@@ -428,8 +466,8 @@ typedef struct
} mpn_t;
/* Compute the product of two bignums >= 0.
- Return the allocated memory in case of success, NULL in case of memory
- allocation failure. */
+ Return the allocated memory (possibly NULL) in case of success, NOMEM_PTR
+ in case of memory allocation failure. */
static void *
multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
{
@@ -457,7 +495,7 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
{
/* src1 or src2 is zero. */
dest->nlimbs = 0;
- dest->limbs = (mp_limb_t *) malloc (1);
+ dest->limbs = NULL;
}
else
{
@@ -469,7 +507,7 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
dlen = len1 + len2;
dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
if (dp == NULL)
- return NULL;
+ return NOMEM_PTR;
for (k = len2; k > 0; )
dp[--k] = 0;
for (i = 0; i < len1; i++)
@@ -500,8 +538,8 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
the remainder.
Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
q is incremented.
- Return the allocated memory in case of success, NULL in case of memory
- allocation failure. */
+ Return the allocated memory (possibly NULL) in case of success, NOMEM_PTR
+ in case of memory allocation failure. */
static void *
divide (mpn_t a, mpn_t b, mpn_t *q)
{
@@ -572,7 +610,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
final rounding of q.) */
roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
if (roomptr == NULL)
- return NULL;
+ return NOMEM_PTR;
/* Normalise a. */
while (a_len > 0 && a_ptr[a_len - 1] == 0)
@@ -708,7 +746,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
if (tmp_roomptr == NULL)
{
free (roomptr);
- return NULL;
+ return NOMEM_PTR;
}
{
const mp_limb_t *sourceptr = b_ptr;
@@ -930,7 +968,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
/* Avoid pointless GCC warning "argument 1 value '18446744073709551615' exceeds
maximum object size 9223372036854775807", triggered by the use of xsum as
argument of malloc. */
-# if __GNUC__ >= 7
+# if _GL_GNUC_PREREQ (7, 0)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Walloc-size-larger-than="
# endif
@@ -991,7 +1029,7 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
return c_ptr;
}
-# if __GNUC__ >= 7
+# if _GL_GNUC_PREREQ (7, 0)
# pragma GCC diagnostic pop
# endif
@@ -1015,7 +1053,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
if (m.limbs == NULL)
return NULL;
/* Split into exponential part and mantissa. */
- y = frexpl (x, &exp);
+ y = safe_frexpl (x, &exp);
if (!(y >= 0.0L && y < 1.0L))
abort ();
/* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
@@ -1306,7 +1344,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void
*memory, int n)
mpn_t denominator;
void *tmp_memory;
tmp_memory = multiply (m, pow5, &numerator);
- if (tmp_memory == NULL)
+ if (tmp_memory == NOMEM_PTR)
{
free (pow5_ptr);
free (memory);
@@ -1379,7 +1417,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void
*memory, int n)
/* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
- if (z_memory == NULL)
+ if (z_memory == NOMEM_PTR)
return NULL;
digits = convert_to_decimal (z, extra_zeroes);
free (z_memory);
@@ -1442,7 +1480,7 @@ floorlog10l (long double x)
double l;
/* Split into exponential part and mantissa. */
- y = frexpl (x, &exp);
+ y = safe_frexpl (x, &exp);
if (!(y >= 0.0L && y < 1.0L))
abort ();
if (y == 0.0L)
@@ -2111,10 +2149,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
break;
case 's':
-# if HAVE_WCHAR_T
if (type == TYPE_WIDE_STRING)
{
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
/* ISO C says about %ls in fwprintf:
"If the precision is not specified or is greater than the size
of the array, the array shall contain a null wide character."
@@ -2125,7 +2162,7 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
tmp_length = local_wcsnlen (arg, precision);
else
tmp_length = local_wcslen (arg);
-# else
+# else
/* ISO C says about %ls in fprintf:
"If a precision is specified, no more than that many bytes are
written (including shift sequences, if any), and the array
@@ -2136,10 +2173,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index,
FCHAR_T conversion,
So if there is a precision, we must not use wcslen. */
/* This case has already been handled separately in VASNPRINTF. */
abort ();
-# endif
+# endif
}
else
-# endif
{
# if WIDE_CHAR_VERSION
/* ISO C says about %s in fwprintf:
@@ -2335,6 +2371,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (dp->conversion == 'n')
{
+#if NEED_PRINTF_WITH_N_DIRECTIVE
switch (a.arg[dp->arg_index].type)
{
case TYPE_COUNT_SCHAR_POINTER:
@@ -2379,6 +2416,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
default:
abort ();
}
+#else
+ abort ();
+#endif
}
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
@@ -2419,6 +2459,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -2497,7 +2539,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u8_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2538,7 +2581,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2599,7 +2642,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u16_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2640,7 +2684,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2701,7 +2745,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + u32_strlen (arg);
- /* The number of characters doesn't matter. */
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
characters = 0;
}
@@ -2742,7 +2787,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length,
converted_len),
- { free (converted); goto
out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted,
converted_len);
free (converted);
}
@@ -2765,7 +2810,190 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if WIDE_CHAR_VERSION && (!DCHAR_IS_TCHAR || NEED_WPRINTF_DIRECTIVE_LC)
+#if !WIDE_CHAR_VERSION && (PTRDIFF_MAX > INT_MAX)
+ else if (dp->conversion == 's'
+ && a.arg[dp->arg_index].type != TYPE_WIDE_STRING)
+ {
+ /* %s in vasnprintf. See the specification of fprintf.
+ We handle it ourselves here, because the string may be
longer
+ than INT_MAX characters, whence snprintf or sprintf would
+ fail to process it. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++
- '0');
+ has_precision = 1;
+ }
+ }
+
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ size_t characters;
+# endif
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ static_assert (sizeof (TCHAR_T) == 1);
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+ if (has_precision)
+ {
+ /* Use only at most PRECISION bytes, from the left. */
+ bytes = local_strnlen (arg, precision);
+ }
+ else
+ {
+ /* Use the entire string, and count the number of
+ bytes. */
+ bytes = strlen (arg);
+ }
+
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ if (has_width)
+ characters = mbsnlen (arg, bytes);
+ else
+ {
+ /* The number of characters doesn't matter,
+ because !has_width and therefore width==0. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ arg, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = bytes;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ {
+# if DCHAR_IS_TCHAR
+ size_t total = bytes + (w < width ? width - w : 0);
+ ENSURE_ALLOCATION (xsum (length, total));
+# else
+ size_t total = tmpdst_len + (w < width ? width - w : 0);
+ ENSURE_ALLOCATION_ELSE (xsum (length, total),
+ { free (tmpdst); goto out_of_memory; });
+# endif
+
+ if (w < width && !(flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ memcpy (result + length, arg, bytes);
+ length += bytes;
+# else
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+ }
+#endif
+#if WIDE_CHAR_VERSION && ((PTRDIFF_MAX > INT_MAX) || !DCHAR_IS_TCHAR ||
NEED_WPRINTF_DIRECTIVE_LC)
else if ((dp->conversion == 's'
&& a.arg[dp->arg_index].type == TYPE_WIDE_STRING)
|| (dp->conversion == 'c'
@@ -2806,6 +3034,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
{
@@ -2908,7 +3138,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if (!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) &&
HAVE_WCHAR_T
+#if WIDE_CHAR_VERSION || !USE_SNPRINTF || (PTRDIFF_MAX > INT_MAX) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS ||
ENABLE_WCHAR_FALLBACK
else if (dp->conversion == 's'
# if WIDE_CHAR_VERSION
&& a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2961,6 +3191,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -3141,11 +3373,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
const wchar_t *arg_end;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
size_t characters;
+# endif
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
static_assert (sizeof (TCHAR_T) == 1);
- TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
# endif
@@ -3160,7 +3394,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbszero (&state);
# endif
arg_end = arg;
+ bytes = 0;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
characters = 0;
+# endif
while (precision > 0)
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
@@ -3176,7 +3413,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (precision < (unsigned int) count)
break;
arg_end++;
- characters += count;
+ bytes += count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters += mbsnlen (cbuf, count);
+# endif
precision -= count;
}
}
@@ -3193,7 +3433,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbszero (&state);
# endif
arg_end = arg;
+ bytes = 0;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
characters = 0;
+# endif
for (;;)
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
@@ -3207,7 +3450,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Cannot convert. */
goto fail_with_EILSEQ;
arg_end++;
- characters += count;
+ bytes += count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters += mbsnlen (cbuf, count);
+# endif
}
}
# if DCHAR_IS_TCHAR
@@ -3215,56 +3461,64 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string. */
arg_end = arg + local_wcslen (arg);
- /* The number of bytes doesn't matter. */
+ /* The number of bytes and characters doesn't matter,
+ because !has_width and therefore width==0. */
+ bytes = 0;
+# if ENABLE_UNISTDIO
characters = 0;
+# endif
}
# endif
# if !DCHAR_IS_TCHAR
- /* Convert the string into a piece of temporary memory. */
- tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
- if (tmpsrc == NULL)
- goto out_of_memory;
{
- TCHAR_T *tmpptr = tmpsrc;
- size_t remaining;
+ TCHAR_T *tmpsrc;
+
+ /* Convert the string into a piece of temporary memory. */
+ tmpsrc = (TCHAR_T *) malloc (bytes * sizeof (TCHAR_T));
+ if (tmpsrc == NULL)
+ goto out_of_memory;
+ {
+ TCHAR_T *tmpptr = tmpsrc;
+ size_t remaining;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- for (remaining = characters; remaining > 0; )
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ for (remaining = bytes; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
- if (*arg == 0)
- abort ();
- count = local_wcrtomb (cbuf, *arg, &state);
- if (count <= 0)
- /* Inconsistency. */
- abort ();
- memcpy (tmpptr, cbuf, count);
- tmpptr += count;
- arg++;
- remaining -= count;
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpptr, cbuf, count);
+ tmpptr += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ free (tmpsrc);
+ goto fail_with_errno;
}
- if (!(arg == arg_end))
- abort ();
+ free (tmpsrc);
}
-
- /* Convert from TCHAR_T[] to DCHAR_T[]. */
- tmpdst =
- DCHAR_CONV_FROM_ENCODING (locale_charset (),
- iconveh_question_mark,
- tmpsrc, characters,
- NULL,
- NULL, &tmpdst_len);
- if (tmpdst == NULL)
- {
- free (tmpsrc);
- goto fail_with_errno;
- }
- free (tmpsrc);
# endif
if (has_width)
@@ -3273,11 +3527,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted
value. */
- w = DCHAR_MBSNLEN (result + length, characters);
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
# else
/* The width is compared against the number of _bytes_
of the converted value, says POSIX. */
- w = characters;
+ w = bytes;
# endif
}
else
@@ -3287,7 +3545,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
@@ -3301,8 +3564,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
mbstate_t state;
mbszero (&state);
# endif
- ENSURE_ALLOCATION (xsum (length, characters));
- for (remaining = characters; remaining > 0; )
+ ENSURE_ALLOCATION (xsum (length, bytes));
+ for (remaining = bytes; remaining > 0; )
{
char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
@@ -3346,7 +3609,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory;
});
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
@@ -3402,17 +3665,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
/* %lc in vasnprintf. See the specification of fprintf. */
{
wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ size_t bytes;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
size_t characters;
+# endif
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
static_assert (sizeof (TCHAR_T) == 1);
- TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
DCHAR_T *tmpdst;
size_t tmpdst_len;
# endif
@@ -3423,58 +3690,65 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
{
/* Count the number of bytes. */
- characters = 0;
- if (arg != 0)
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count < 0)
- /* Cannot convert. */
- goto fail_with_EILSEQ;
- characters = count;
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ bytes = count;
+# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR
+ characters = mbsnlen (cbuf, count);
+# endif
}
# if DCHAR_IS_TCHAR
else
{
- /* The number of bytes doesn't matter. */
+ /* The number of bytes and characters doesn't matter,
+ because !has_width and therefore width==0. */
+ bytes = 0;
+# if ENABLE_UNISTDIO
characters = 0;
+# endif
}
# endif
# if !DCHAR_IS_TCHAR
- /* Convert the string into a piece of temporary memory. */
- if (characters > 0) /* implies arg != 0 */
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ {
+ TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
+
+ /* Convert the string into a piece of temporary memory. */
+ if (bytes > 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count <= 0)
- /* Inconsistency. */
- abort ();
- memcpy (tmpsrc, cbuf, count);
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpsrc, cbuf, count);
+ }
- /* Convert from TCHAR_T[] to DCHAR_T[]. */
- tmpdst =
- DCHAR_CONV_FROM_ENCODING (locale_charset (),
- iconveh_question_mark,
- tmpsrc, characters,
- NULL,
- NULL, &tmpdst_len);
- if (tmpdst == NULL)
- goto fail_with_errno;
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, bytes,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+ }
# endif
if (has_width)
@@ -3483,11 +3757,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted
value. */
- w = DCHAR_MBSNLEN (result + length, characters);
+# if DCHAR_IS_TCHAR
+ w = characters;
+# else
+ w = DCHAR_MBSNLEN (tmpdst, tmpdst_len);
+# endif
# else
/* The width is compared against the number of _bytes_
of the converted value, says POSIX. */
- w = characters;
+ w = bytes;
# endif
}
else
@@ -3497,7 +3775,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
@@ -3506,8 +3789,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (has_width)
{
/* We know the number of bytes in advance. */
- ENSURE_ALLOCATION (xsum (length, characters));
- if (characters > 0) /* implies arg != 0 */
+ ENSURE_ALLOCATION (xsum (length, bytes));
+ if (bytes > 0)
{
int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
@@ -3524,27 +3807,24 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
else
{
- if (arg != 0)
- {
- char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
- int count;
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
- mbstate_t state;
- mbszero (&state);
+ mbstate_t state;
+ mbszero (&state);
# endif
- count = local_wcrtomb (cbuf, arg, &state);
- if (count < 0)
- /* Cannot convert. */
- goto fail_with_EILSEQ;
- ENSURE_ALLOCATION (xsum (length, count));
- memcpy (result + length, cbuf, count);
- length += count;
- }
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory;
});
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
@@ -3596,6 +3876,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
/* %c in vasnwprintf. See the specification of fwprintf. */
@@ -3610,24 +3892,26 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Invalid or incomplete multibyte character. */
goto fail_with_EILSEQ;
- if (1 < width && !(flags & FLAG_LEFT))
- {
- size_t n = width - 1;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ {
+ size_t total = (1 < width ? width : 1);
+ ENSURE_ALLOCATION (xsum (length, total));
- ENSURE_ALLOCATION (xsum (length, 1));
- result[length++] = wc;
+ if (1 < width && !(flags & FLAG_LEFT))
+ {
+ size_t n = width - 1;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
- if (1 < width && (flags & FLAG_LEFT))
- {
- size_t n = width - 1;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ result[length++] = wc;
+
+ if (1 < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - 1;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
}
}
#endif
@@ -3684,6 +3968,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
has_width = 1;
}
@@ -3935,7 +4221,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -3998,6 +4285,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
has_precision = 0;
@@ -4425,7 +4714,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -4503,6 +4793,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
+ if (width > (size_t) INT_MAX)
+ goto overflow;
}
has_precision = 0;
@@ -5608,7 +5900,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
@@ -5622,24 +5915,24 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags;
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int has_width;
#endif
-#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
size_t width;
#endif
-#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
int has_precision;
size_t precision;
#endif
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int prec_ourselves;
#else
# define prec_ourselves 0
#endif
#if (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST
# define pad_ourselves 1
-#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int pad_ourselves;
#else
# define pad_ourselves 0
@@ -5654,10 +5947,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
TCHAR_T *tmp;
#endif
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 0;
#endif
-#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 ||
USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
width = 0;
if (dp->width_start != dp->width_end)
{
@@ -5685,13 +5978,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
-# if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+# define WIDTH_IS_CHECKED 1
+# if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 1;
# endif
}
#endif
-#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION &&
MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST
|| NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
has_precision = 0;
precision = 6;
if (dp->precision_start != dp->precision_end)
@@ -5724,9 +6020,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to handle the precision ourselves. */
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
switch (dp->conversion)
{
+# if NEED_PRINTF_UNBOUNDED_PRECISION
case 'd': case 'i': case 'u':
case 'b':
#if SUPPORT_GNU_PRINTF_DIRECTIVES \
@@ -5734,9 +6031,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
case 'B':
#endif
case 'o':
- case 'x': case 'X': case 'p':
prec_ourselves = has_precision && (precision > 0);
break;
+# endif
+ case 'x': case 'X': case 'p':
+ prec_ourselves =
+ has_precision
+ && (0
+# if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO
+ || (precision == 0)
+# endif
+# if NEED_PRINTF_UNBOUNDED_PRECISION
+ || (precision > 0)
+# endif
+ );
+ break;
default:
prec_ourselves = 0;
break;
@@ -5744,7 +6053,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to perform the padding ourselves. */
-#if !((WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST) &&
(!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION)
+#if !((WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST) &&
(!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
switch (dp->conversion)
{
# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
@@ -5821,6 +6130,43 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (dp->width_start != dp->width_end)
{
size_t n = dp->width_end - dp->width_start;
+#if !WIDTH_IS_CHECKED
+ size_t width;
+ /* Reject an out-of-range width.
+ The underlying SNPRINTF already does this on some
+ platforms (glibc, musl, macOS, FreeBSD, NetBSD,
+ OpenBSD, Cygwin, Solaris, MSVC). However, on others
+ (AIX, mingw), it doesn't; thus this vasnprintf
+ invocation would succeed and produce a wrong result.
+ So, this is redundant on some platforms, but it's a
+ quick check anyway. */
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-'
flag
+ followed by a positive field width." */
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ width = 0;
+ do
+ width = xsum (xtimes (width, 10), *digitp++ -
'0');
+ while (digitp != dp->width_end);
+ }
+ if (width > (size_t) INT_MAX)
+ goto overflow;
+#endif
/* The width specification is known to consist only
of standard ASCII characters. */
if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
@@ -5973,9 +6319,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#if HAVE_WINT_T
case TYPE_WIDE_CHAR:
#endif
- #if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
- #endif
*fbp++ = 'l';
break;
case TYPE_LONGDOUBLE:
@@ -6347,14 +6691,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
SNPRINTF_BUF (arg);
}
break;
-#if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
{
const wchar_t *arg =
a.arg[dp->arg_index].a.a_wide_string;
SNPRINTF_BUF (arg);
}
break;
-#endif
case TYPE_POINTER:
{
void *arg = a.arg[dp->arg_index].a.a_pointer;
@@ -6508,7 +6850,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
#endif
-#if NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
if (prec_ourselves)
{
/* Handle the precision. */
@@ -6568,6 +6910,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
count += insert;
}
+# if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO
+ else if (precision == 0
+ && move == 1
+ && prec_ptr[prefix_count] == '0')
+ {
+ /* Replace the "0" result with an empty string. */
+ count = prefix_count;
+ }
+# endif
}
#endif
@@ -6657,7 +7008,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
goto fail_with_errno;
# endif
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto
out_of_memory; });
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
count = tmpdst_len;
@@ -6722,7 +7073,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Here count <= allocated - length. */
/* Perform padding. */
-#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_UNBOUNDED_PRECISION
+#if (WIDE_CHAR_VERSION && MUSL_LIBC) || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO ||
NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO ||
NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
if (pad_ourselves && has_width)
{
size_t w;
@@ -6909,17 +7260,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
not have this limitation. */
return result;
-#if USE_SNPRINTF
overflow:
errno = EOVERFLOW;
goto fail_with_errno;
-#endif
out_of_memory:
errno = ENOMEM;
goto fail_with_errno;
-#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || WIDE_CHAR_VERSION ||
!HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS ||
ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || ((NEED_PRINTF_DIRECTIVE_LC ||
ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T && !WIDE_CHAR_VERSION) ||
(NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
+#if ENABLE_UNISTDIO || (WIDE_CHAR_VERSION || !USE_SNPRINTF || (PTRDIFF_MAX >
INT_MAX) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF ||
NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) ||
((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T &&
!WIDE_CHAR_VERSION) || (NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
fail_with_EILSEQ:
errno = EILSEQ;
goto fail_with_errno;
diff --git a/tp/Texinfo/XS/gnulib/lib/vasnprintf.h
b/tp/Texinfo/XS/gnulib/lib/vasnprintf.h
index 2d13407079..7ed9145c03 100644
--- a/tp/Texinfo/XS/gnulib/lib/vasnprintf.h
+++ b/tp/Texinfo/XS/gnulib/lib/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/vasprintf.c
b/tp/Texinfo/XS/gnulib/lib/vasprintf.c
index d2878cd91d..757d1c740a 100644
--- a/tp/Texinfo/XS/gnulib/lib/vasprintf.c
+++ b/tp/Texinfo/XS/gnulib/lib/vasprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,6 +25,7 @@
#include <errno.h>
#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include "vasnprintf.h"
@@ -37,12 +38,21 @@ vasprintf (char **resultp, const char *format, va_list args)
if (result == NULL)
return -1;
+#if PTRDIFF_MAX > INT_MAX
if (length > INT_MAX)
{
free (result);
- errno = EOVERFLOW;
+ errno = (length > PTRDIFF_MAX ? ENOMEM : EOVERFLOW);
return -1;
}
+#else
+ if (length > PTRDIFF_MAX)
+ {
+ free (result);
+ errno = ENOMEM;
+ return -1;
+ }
+#endif
*resultp = result;
/* Return the number of resulting bytes, excluding the trailing NUL. */
diff --git a/tp/Texinfo/XS/gnulib/lib/verify.h
b/tp/Texinfo/XS/gnulib/lib/verify.h
index 181dc6c292..49a73c0508 100644
--- a/tp/Texinfo/XS/gnulib/lib/verify.h
+++ b/tp/Texinfo/XS/gnulib/lib/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -34,11 +34,12 @@
#ifndef __cplusplus
# if (201112 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ \
- && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
+ && ((4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__) \
+ || 5 <= __clang_major__)))
# define _GL_HAVE__STATIC_ASSERT 1
# endif
# if (202311 <= __STDC_VERSION__ \
- || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+ || (!defined __STRICT_ANSI__ && 9 <= __GNUC__ && !defined __clang__))
# define _GL_HAVE__STATIC_ASSERT1 1
# endif
#endif
@@ -215,7 +216,7 @@ template <int w>
# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
-# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wnested-externs"
# endif
#endif
@@ -259,11 +260,22 @@ template <int w>
&& (!defined __cplusplus \
|| (__cpp_static_assert < 201411 \
&& __GNUG__ < 6 && __clang_major__ < 6 && _MSC_VER < 1910)))
-# if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
+# if (defined __cplusplus && defined __GNUG__ && __GNUG__ < 6 \
+ && __cplusplus == 201103L && !defined __clang__)
+/* g++ >= 4.7, < 6 with option -std=c++11 or -std=gnu++11 supports the
+ two-arguments static_assert but not the one-argument static_assert, and
+ it does not support _Static_assert.
+ We have to play preprocessor tricks to distinguish the two cases. */
+# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
+# define _GL_SA2 static_assert
+# define _GL_SA3 static_assert
+# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
+# define static_assert(...) _GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)
(__VA_ARGS__)
+# elif defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
the one-argument static_assert, and it does not support _Static_assert.
We have to play preprocessor tricks to distinguish the two cases.
- Since the MSVC preprocessor is not ISO C compliant (see above),.
+ Since the MSVC preprocessor is not ISO C compliant (see above),
the solution is specific to MSVC. */
# define _GL_EXPAND(x) x
# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
@@ -294,7 +306,7 @@ template <int w>
#ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0
-# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
diff --git a/tp/Texinfo/XS/gnulib/lib/warn-on-use.h
b/tp/Texinfo/XS/gnulib/lib/warn-on-use.h
index 30756034af..73c439714a 100644
--- a/tp/Texinfo/XS/gnulib/lib/warn-on-use.h
+++ b/tp/Texinfo/XS/gnulib/lib/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -32,6 +32,10 @@
_GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
linkage.
+ _GL_WARN_ON_USE should not be used more than once for a given function
+ in a given compilation unit (because this may generate a warning even
+ if the function is never called).
+
However, one of the reasons that a function is a portability trap is
if it has the wrong signature. Declaring FUNCTION with a different
signature in C is a compilation error, so this macro must use the
@@ -81,7 +85,7 @@
*/
#ifndef _GL_WARN_ON_USE
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined
__clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__
(message)))
@@ -94,7 +98,7 @@ _GL_WARN_EXTERN_C __typeof__ (function) function \
__attribute__ ((__diagnose_if__ (1, message, "warning")))
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
__attribute__ ((__diagnose_if__ (1, message, "warning")))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function
@@ -117,7 +121,7 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
_GL_WARN_ON_USE (function, msg)
# else
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined
__clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_gcc function parameters_and_attributes \
@@ -127,7 +131,7 @@ extern rettype_gcc function parameters_and_attributes \
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_clang function parameters_and_attributes \
__attribute__ ((__diagnose_if__ (1, msg, "warning")))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define
_GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg)
\
extern rettype_gcc function parameters_and_attributes
diff --git a/tp/Texinfo/XS/gnulib/lib/wchar.in.h
b/tp/Texinfo/XS/gnulib/lib/wchar.in.h
index f1bbff6b94..ac7cb00fc7 100644
--- a/tp/Texinfo/XS/gnulib/lib/wchar.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/wchar.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -95,7 +95,7 @@
that can be freed by passing them as the Ith argument to the
function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -141,7 +141,7 @@
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -269,11 +269,11 @@ _GL_EXTERN_C void free (void *);
# undef btowc
# define btowc rpl_btowc
# endif
-_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
# else
# if !@HAVE_BTOWC@
-_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
# endif
/* Need to cast, because on mingw, the return type is 'unsigned short'. */
_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
@@ -297,12 +297,12 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
# undef wctob
# define wctob rpl_wctob
# endif
-_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
# else
# if !defined wctob && !@HAVE_DECL_WCTOB@
/* wctob is provided by gnulib, or wctob exists but is not declared. */
-_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
# endif
@@ -623,7 +623,7 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
(wchar_t *restrict dest,
@@ -634,7 +634,7 @@ _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
@@ -664,7 +664,7 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t srclen, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
@@ -675,7 +675,7 @@ _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
(wchar_t *restrict dest,
const char **restrict srcp, size_t srclen, size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
@@ -736,7 +736,7 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
_GL_FUNCDECL_RPL (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
@@ -747,7 +747,7 @@ _GL_CXXALIAS_RPL (wcsrtombs, size_t,
_GL_FUNCDECL_SYS (wcsrtombs, size_t,
(char *restrict dest, const wchar_t **restrict srcp,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsrtombs, size_t,
@@ -778,7 +778,7 @@ _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
(char *restrict dest,
const wchar_t **restrict srcp, size_t srclen,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
(char *restrict dest,
@@ -791,7 +791,7 @@ _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
(char *restrict dest,
const wchar_t **restrict srcp, size_t srclen,
size_t len,
- mbstate_t *restrict ps)
+ mbstate_t *restrict ps),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
@@ -819,12 +819,12 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
# undef wcwidth
# define wcwidth rpl_wcwidth
# endif
-_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
# else
# if !@HAVE_DECL_WCWIDTH@
/* wcwidth exists but is not declared. */
-_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
# endif
@@ -843,7 +843,7 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
/* Search N wide characters of S for C. */
#if @GNULIB_WMEMCHR@
# if !@HAVE_WMEMCHR@
-_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -855,11 +855,12 @@ _GL_CXXALIAS_SYS_CAST2 (wmemchr,
wchar_t *, (const wchar_t *, wchar_t, size_t),
const wchar_t *, (const wchar_t *, wchar_t, size_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
(const wchar_t *s, wchar_t c, size_t n));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wmemchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -879,14 +880,14 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
# define wmemcmp rpl_wmemcmp
# endif
_GL_FUNCDECL_RPL (wmemcmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wmemcmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
# else
# if !@HAVE_WMEMCMP@
_GL_FUNCDECL_SYS (wmemcmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wmemcmp, int,
@@ -1004,7 +1005,7 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
/* Return the number of wide characters in S. */
#if @GNULIB_WCSLEN@
# if !@HAVE_WCSLEN@
-_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s), _GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
# if __GLIBC__ >= 2
@@ -1025,7 +1026,7 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
-_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
@@ -1175,12 +1176,12 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
# undef wcscmp
# define wcscmp rpl_wcscmp
# endif
-_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
# else
# if !@HAVE_WCSCMP@
-_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1205,14 +1206,14 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
# define wcsncmp rpl_wcsncmp
# endif
_GL_FUNCDECL_RPL (wcsncmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcsncmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
# else
# if !@HAVE_WCSNCMP@
_GL_FUNCDECL_SYS (wcsncmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsncmp, int,
@@ -1236,7 +1237,7 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
-_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1257,7 +1258,7 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
the global namespace. */
# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsncasecmp, int,
- (const wchar_t *s1, const wchar_t *s2, size_t n)
+ (const wchar_t *s1, const wchar_t *s2, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsncasecmp, int,
@@ -1325,15 +1326,16 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t
*s));
/* On Solaris 11.3, the header files declare the function in the std::
namespace, not in the global namespace. So, force a declaration in
the global namespace. */
-# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >=
11
+# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) \
+ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1341,16 +1343,16 @@ _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t
*s));
# endif
_GL_CXXALIASWARN (wcsdup);
#else
-# if __GNUC__ >= 11 && !defined wcsdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined wcsdup
/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# endif
@@ -1373,12 +1375,12 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t
*s));
# else
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
- _GL_ATTRIBUTE_NOTHROW
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+ (const wchar_t *s),
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
+ _GL_ATTRIBUTE_NOTHROW;
# else
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
- (const wchar_t *s)
+ (const wchar_t *s),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
# if @HAVE_DECL_WCSDUP@
@@ -1395,7 +1397,7 @@ _GL_CXXALIASWARN (wcsdup);
/* Find the first occurrence of WC in WCS. */
#if @GNULIB_WCSCHR@
# if !@HAVE_WCSCHR@
-_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1407,10 +1409,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcschr,
wchar_t *, (const wchar_t *, wchar_t),
const wchar_t *, (const wchar_t *, wchar_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcschr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1425,7 +1428,7 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
/* Find the last occurrence of WC in WCS. */
#if @GNULIB_WCSRCHR@
# if !@HAVE_WCSRCHR@
-_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1437,10 +1440,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
wchar_t *, (const wchar_t *, wchar_t),
const wchar_t *, (const wchar_t *, wchar_t));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcsrchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1456,7 +1460,7 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
of wide characters not in REJECT. */
#if @GNULIB_WCSCSPN@
# if !@HAVE_WCSCSPN@
-_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t
*reject));
@@ -1476,7 +1480,7 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
of wide characters in ACCEPT. */
#if @GNULIB_WCSSPN@
# if !@HAVE_WCSSPN@
-_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
@@ -1496,7 +1500,7 @@ _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
#if @GNULIB_WCSPBRK@
# if !@HAVE_WCSPBRK@
_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
- (const wchar_t *wcs, const wchar_t *accept)
+ (const wchar_t *wcs, const wchar_t *accept),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1508,12 +1512,13 @@ _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
wchar_t *, (const wchar_t *, const wchar_t *),
const wchar_t *, (const wchar_t *, const wchar_t *));
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
(wchar_t *wcs, const wchar_t *accept));
_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
(const wchar_t *wcs, const wchar_t *accept));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcspbrk);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1534,7 +1539,7 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
# endif
_GL_FUNCDECL_RPL (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
- const wchar_t *restrict needle)
+ const wchar_t *restrict needle),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
@@ -1543,7 +1548,7 @@ _GL_CXXALIAS_RPL (wcsstr, wchar_t *,
# if !@HAVE_WCSSTR@
_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
- const wchar_t *restrict needle)
+ const wchar_t *restrict needle),
_GL_ATTRIBUTE_PURE);
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -1558,14 +1563,15 @@ _GL_CXXALIAS_SYS_CAST2 (wcsstr,
(const wchar_t *restrict, const wchar_t *restrict));
# endif
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
+ && !defined __clang__
_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
(wchar_t *restrict haystack,
const wchar_t *restrict needle));
_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
(const wchar_t *restrict haystack,
const wchar_t *restrict needle));
-# elif __GLIBC__ >= 2
+# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
_GL_CXXALIASWARN (wcsstr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -1620,12 +1626,12 @@ _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
# undef wcswidth
# define wcswidth rpl_wcswidth
# endif
-_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n),
_GL_ATTRIBUTE_PURE);
_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
# else
# if !@HAVE_WCSWIDTH@
-_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n),
_GL_ATTRIBUTE_PURE);
# endif
_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
@@ -1653,7 +1659,7 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
_GL_FUNCDECL_RPL (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
const wchar_t *restrict __fmt,
- const struct tm *restrict __tp)
+ const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4)));
_GL_CXXALIAS_RPL (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
@@ -1664,7 +1670,7 @@ _GL_CXXALIAS_RPL (wcsftime, size_t,
_GL_FUNCDECL_SYS (wcsftime, size_t,
(wchar_t *restrict __buf, size_t __bufsize,
const wchar_t *restrict __fmt,
- const struct tm *restrict __tp)
+ const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4)));
# endif
_GL_CXXALIAS_SYS (wcsftime, size_t,
@@ -1684,6 +1690,24 @@ _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
#endif
+#if @GNULIB_WGETCWD@ && (defined _WIN32 && !defined __CYGWIN__)
+/* Gets the name of the current working directory.
+ (a) If BUF is non-NULL, it is assumed to have room for SIZE wide characters.
+ This function stores the working directory (NUL-terminated) in BUF and
+ returns BUF.
+ (b) If BUF is NULL, an array is allocated with 'malloc'. The array is SIZE
+ wide characters long, unless SIZE == 0, in which case it is as big as
+ necessary.
+ If the directory couldn't be determined or SIZE was too small, this function
+ returns NULL and sets errno. For a directory of length LEN, SIZE should be
+ >= LEN + 3 in case (a) or >= LEN + 1 in case (b).
+ Possible errno values include:
+ - ERANGE if SIZE is too small.
+ - ENOMEM if the memory could no be allocated. */
+_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size));
+#endif
+
+
#endif /* _@GUARD_PREFIX@_WCHAR_H */
#endif /* _@GUARD_PREFIX@_WCHAR_H */
#endif
diff --git a/tp/Texinfo/XS/gnulib/lib/wctype-h.c
b/tp/Texinfo/XS/gnulib/lib/wctype-h.c
index 7d3e14a6b5..7e4ff13a71 100644
--- a/tp/Texinfo/XS/gnulib/lib/wctype-h.c
+++ b/tp/Texinfo/XS/gnulib/lib/wctype-h.c
@@ -1,6 +1,6 @@
/* Inline functions for <wctype.h>.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,4 +20,4 @@
#include <config.h>
#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE
-#include "wctype.h"
+#include <wctype.h>
diff --git a/tp/Texinfo/XS/gnulib/lib/wctype.in.h
b/tp/Texinfo/XS/gnulib/lib/wctype.in.h
index 6f1e7ef149..efa77594d5 100644
--- a/tp/Texinfo/XS/gnulib/lib/wctype.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/wctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
- Copyright (C) 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -659,12 +659,12 @@ typedef void *rpl_wctype_t;
# undef wctype
# define wctype rpl_wctype
# endif
-_GL_FUNCDECL_RPL (wctype, wctype_t, (const char *name)
+_GL_FUNCDECL_RPL (wctype, wctype_t, (const char *name),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (wctype, wctype_t, (const char *name));
# else
# if !@HAVE_WCTYPE_T@
-_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name)
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
@@ -741,12 +741,12 @@ typedef void *rpl_wctrans_t;
# undef wctrans
# define wctrans rpl_wctrans
# endif
-_GL_FUNCDECL_RPL (wctrans, wctrans_t, (const char *name)
+_GL_FUNCDECL_RPL (wctrans, wctrans_t, (const char *name),
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (wctrans, wctrans_t, (const char *name));
# else
# if !@HAVE_WCTRANS_T@
-_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name)
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name),
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
diff --git a/tp/Texinfo/XS/gnulib/lib/wcwidth.c
b/tp/Texinfo/XS/gnulib/lib/wcwidth.c
index 1d03665496..328a89306c 100644
--- a/tp/Texinfo/XS/gnulib/lib/wcwidth.c
+++ b/tp/Texinfo/XS/gnulib/lib/wcwidth.c
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a character.
- Copyright (C) 2006-2007, 2010-2023 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2010-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/xalloc-oversized.h
b/tp/Texinfo/XS/gnulib/lib/xalloc-oversized.h
index 483bd11796..cfa527d38c 100644
--- a/tp/Texinfo/XS/gnulib/lib/xalloc-oversized.h
+++ b/tp/Texinfo/XS/gnulib/lib/xalloc-oversized.h
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -29,8 +29,7 @@
is SIZE_MAX - 1. */
#define __xalloc_oversized(n, s) \
((s) != 0 \
- && ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
- < (n)))
+ && (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
/* Return 1 if and only if an array of N objects, each of size S,
cannot exist reliably because its total size in bytes would exceed
@@ -48,7 +47,8 @@
#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && PTRDIFF_MAX < SIZE_MAX
+#elif 5 <= __GNUC__ && !defined __clang__ && !defined __ICC \
+ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
diff --git a/tp/Texinfo/XS/gnulib/lib/xsize.c b/tp/Texinfo/XS/gnulib/lib/xsize.c
index 279ae824f8..8774467536 100644
--- a/tp/Texinfo/XS/gnulib/lib/xsize.c
+++ b/tp/Texinfo/XS/gnulib/lib/xsize.c
@@ -1,6 +1,6 @@
/* Checked size_t computations.
- Copyright (C) 2012-2023 Free Software Foundation, Inc.
+ Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/tp/Texinfo/XS/gnulib/lib/xsize.h b/tp/Texinfo/XS/gnulib/lib/xsize.h
index 5b08d61f2f..5ae86006d9 100644
--- a/tp/Texinfo/XS/gnulib/lib/xsize.h
+++ b/tp/Texinfo/XS/gnulib/lib/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -26,7 +26,7 @@
/* Get size_t. */
#include <stddef.h>
-/* Get SIZE_MAX. */
+/* Get INT_MAX, SIZE_MAX. */
#include <limits.h>
#if HAVE_STDINT_H
# include <stdint.h>
@@ -40,6 +40,11 @@ _GL_INLINE_HEADER_BEGIN
# define XSIZE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* The size of memory objects is often computed through expressions of
type size_t. Example:
void* p = malloc (header_size + n * element_size).
@@ -56,7 +61,8 @@ _GL_INLINE_HEADER_BEGIN
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
*/
-/* Convert an arbitrary value >= 0 to type size_t. */
+/* Convert an arbitrary N >= 0 to type size_t.
+ N should not have side effects. */
#define xcast_size_t(N) \
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
@@ -64,8 +70,15 @@ _GL_INLINE_HEADER_BEGIN
XSIZE_INLINE size_t ATTRIBUTE_PURE
xsum (size_t size1, size_t size2)
{
- size_t sum = size1 + size2;
- return (sum >= size1 ? sum : SIZE_MAX);
+ if (INT_MAX < SIZE_MAX)
+ {
+ /* Optimize for the common case where size_t arithmetic wraps
+ around without undefined behavior. */
+ size_t sum = size1 + size2;
+ return size1 <= sum ? sum : SIZE_MAX;
+ }
+
+ return size1 <= SIZE_MAX - size2 ? size1 + size2 : SIZE_MAX;
}
/* Sum of three sizes, with overflow check. */
@@ -93,6 +106,8 @@ xmax (size_t size1, size_t size2)
/* Multiplication of a count with an element size, with overflow check.
The count must be >= 0 and the element size must be > 0.
+ Arguments should not have side effects.
+ The element size's type should be no wider than size_t.
This is a macro, not a function, so that it works correctly even
when N is of a wider type and N > SIZE_MAX. */
#define xtimes(N, ELSIZE) \
@@ -105,6 +120,11 @@ xmax (size_t size1, size_t size2)
#define size_in_bounds_p(SIZE) \
((SIZE) != SIZE_MAX)
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _XSIZE_H */
diff --git a/tp/Texinfo/XS/gnulib/m4/00gnulib.m4
b/tp/Texinfo/XS/gnulib/m4/00gnulib.m4
index 7fe03e0b9c..cd16771848 100644
--- a/tp/Texinfo/XS/gnulib/m4/00gnulib.m4
+++ b/tp/Texinfo/XS/gnulib/m4/00gnulib.m4
@@ -1,5 +1,6 @@
-# 00gnulib.m4 serial 8
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# 00gnulib.m4
+# serial 9
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -49,14 +50,14 @@ dnl AC_REQUIRE([gl_COMPILER_CLANG])
[if test $gl_cv_compiler_clang = yes; then
dnl Test whether the compiler supports the option
dnl '-Werror=implicit-function-declaration'.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile -Werror=implicit-function-declaration"
dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
dnl warning "AC_COMPILE_IFELSE was called before
AC_USE_SYSTEM_EXTENSIONS".
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
[gl_cv_compiler_check_decl_option=none])
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
else
gl_cv_compiler_check_decl_option=none
fi
@@ -71,11 +72,11 @@ dnl Redefine _AC_CHECK_DECL_BODY so that it references
ac_compile_for_check_decl
dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
m4_define([_AC_CHECK_DECL_BODY],
-[ ac_save_ac_compile="$ac_compile"
+[ ac_saved_ac_compile="$ac_compile"
if test -n "$ac_compile_for_check_decl"; then
ac_compile="$ac_compile_for_check_decl"
fi]
-m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile"
])
# gl_00GNULIB
diff --git a/tp/Texinfo/XS/gnulib/m4/absolute-header.m4
b/tp/Texinfo/XS/gnulib/m4/absolute-header.m4
index 0cab36454d..0abd6d9002 100644
--- a/tp/Texinfo/XS/gnulib/m4/absolute-header.m4
+++ b/tp/Texinfo/XS/gnulib/m4/absolute-header.m4
@@ -1,5 +1,6 @@
-# absolute-header.m4 serial 18
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# absolute-header.m4
+# serial 18
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/alloca.m4
b/tp/Texinfo/XS/gnulib/m4/alloca.m4
index c685fac918..dc78dc19a8 100644
--- a/tp/Texinfo/XS/gnulib/m4/alloca.m4
+++ b/tp/Texinfo/XS/gnulib/m4/alloca.m4
@@ -1,5 +1,6 @@
-# alloca.m4 serial 21
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# alloca.m4
+# serial 21
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/assert_h.m4
b/tp/Texinfo/XS/gnulib/m4/assert_h.m4
index d255855d31..b90d0f1939 100644
--- a/tp/Texinfo/XS/gnulib/m4/assert_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/assert_h.m4
@@ -1,5 +1,6 @@
-# assert-h.m4
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# assert_h.m4
+# serial 1
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,10 +10,10 @@ dnl From Paul Eggert.
AC_DEFUN([gl_ASSERT_H],
[
AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
- [gl_save_CFLAGS=$CFLAGS
+ [gl_saved_CFLAGS=$CFLAGS
for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
AS_CASE([$gl_working],
- [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"])
+ [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -32,7 +33,7 @@ AC_DEFUN([gl_ASSERT_H],
]])],
[gl_cv_static_assert=$gl_working],
[gl_cv_static_assert=no])
- CFLAGS=$gl_save_CFLAGS
+ CFLAGS=$gl_saved_CFLAGS
test "$gl_cv_static_assert" != no && break
done])
diff --git a/tp/Texinfo/XS/gnulib/m4/c-bool.m4
b/tp/Texinfo/XS/gnulib/m4/c-bool.m4
index f614371bb2..0fb0de3b59 100644
--- a/tp/Texinfo/XS/gnulib/m4/c-bool.m4
+++ b/tp/Texinfo/XS/gnulib/m4/c-bool.m4
@@ -1,10 +1,12 @@
-# Check for bool that conforms to C2023.
-
-dnl Copyright 2022-2023 Free Software Foundation, Inc.
+# c-bool.m4
+# serial 1
+dnl Copyright 2022-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Check for bool that conforms to C2023.
+
AC_DEFUN([gl_C_BOOL],
[
AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
diff --git a/tp/Texinfo/XS/gnulib/m4/codeset.m4
b/tp/Texinfo/XS/gnulib/m4/codeset.m4
index 5804f472e9..e69b7402fc 100644
--- a/tp/Texinfo/XS/gnulib/m4/codeset.m4
+++ b/tp/Texinfo/XS/gnulib/m4/codeset.m4
@@ -1,5 +1,6 @@
-# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software
+# codeset.m4
+# serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/eealloc.m4
b/tp/Texinfo/XS/gnulib/m4/eealloc.m4
index cb3e08fe53..8a15e70554 100644
--- a/tp/Texinfo/XS/gnulib/m4/eealloc.m4
+++ b/tp/Texinfo/XS/gnulib/m4/eealloc.m4
@@ -1,5 +1,6 @@
-# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc.
+# eealloc.m4
+# serial 3
+dnl Copyright (C) 2003, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/errno_h.m4
b/tp/Texinfo/XS/gnulib/m4/errno_h.m4
index 4c70d22528..920ea6cc65 100644
--- a/tp/Texinfo/XS/gnulib/m4/errno_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/errno_h.m4
@@ -1,5 +1,6 @@
-# errno_h.m4 serial 14
-dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# errno_h.m4
+# serial 18
+dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +10,11 @@ AC_PREREQ([2.61])
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
+
+ dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
+ dnl gets defined already before this macro gets invoked. This persuades
+ dnl AIX 7.3 errno.h to assign ENOTEMPTY a value different than EEXIST.
+
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
AC_EGREP_CPP([booboo],[
#include <errno.h>
@@ -62,6 +68,9 @@ booboo
#endif
#if !defined EILSEQ
booboo
+#endif
+#if !defined ESOCKTNOSUPPORT
+booboo
#endif
],
[gl_cv_header_errno_h_complete=no],
diff --git a/tp/Texinfo/XS/gnulib/m4/exponentd.m4
b/tp/Texinfo/XS/gnulib/m4/exponentd.m4
index 163114b89e..db597afccc 100644
--- a/tp/Texinfo/XS/gnulib/m4/exponentd.m4
+++ b/tp/Texinfo/XS/gnulib/m4/exponentd.m4
@@ -1,5 +1,6 @@
-# exponentd.m4 serial 4
-dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc.
+# exponentd.m4
+# serial 4
+dnl Copyright (C) 2007-2008, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/extensions-aix.m4
b/tp/Texinfo/XS/gnulib/m4/extensions-aix.m4
new file mode 100644
index 0000000000..990a7ac3ef
--- /dev/null
+++ b/tp/Texinfo/XS/gnulib/m4/extensions-aix.m4
@@ -0,0 +1,25 @@
+# extensions-aix.m4
+# serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# On AIX, most extensions are already enabled through the _ALL_SOURCE macro,
+# defined by gl_USE_SYSTEM_EXTENSIONS. gl_USE_AIX_EXTENSIONS additionally
+# activates more GNU and Linux-like behaviours, affecting
+# - the time_t type,
+# - errno values in <errno.h>: ENOTEMPTY
+# - functions in <stdlib.h>: malloc calloc realloc valloc
+#
<https://www.ibm.com/docs/en/aix/7.3?topic=m-malloc-free-realloc-calloc-mallopt-mallinfo-mallinfo-heap-alloca-valloc-posix-memalign-subroutine>
+# - functions in <string.h>: strerror_r (returns 'char *', like glibc)
+# - functions in <dirent.h>: scandir, alphasort, readdir_r
+# - functions in <netdb.h>: gethostbyname_r gethostbyaddr_r
+# - declarations in <unistd.h>: sbrk
+# and a couple of secondary <sys/*> header files.
+
+AC_DEFUN_ONCE([gl_USE_AIX_EXTENSIONS],
+[
+ AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
+ [Define so that AIX headers are more compatible with GNU/Linux.])
+])
diff --git a/tp/Texinfo/XS/gnulib/m4/extensions.m4
b/tp/Texinfo/XS/gnulib/m4/extensions.m4
index 5336b8daf7..1fb68956b3 100644
--- a/tp/Texinfo/XS/gnulib/m4/extensions.m4
+++ b/tp/Texinfo/XS/gnulib/m4/extensions.m4
@@ -1,10 +1,11 @@
-# serial 23 -*- Autoconf -*-
-# Enable extensions on systems that normally disable them.
+# extensions.m4
+# serial 25 -*- Autoconf -*-
+dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Enable extensions on systems that normally disable them.
dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
@@ -229,4 +230,15 @@ AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
[Define to enable the declarations of ISO C 11 types and functions.])
;;
esac
+
+ dnl On OpenSolaris derivatives, the include files contains a couple of
+ dnl declarations that are only activated with an explicit
+ dnl -D__STDC_WANT_LIB_EXT1__.
+ AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS],
+[/* Define to enable the declarations of ISO C 23 Annex K types and functions.
*/
+#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__)
+#undef/**/__STDC_WANT_LIB_EXT1__
+#define __STDC_WANT_LIB_EXT1__ 1
+#endif
+])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/extern-inline.m4
b/tp/Texinfo/XS/gnulib/m4/extern-inline.m4
index f9894d7fe5..547da82afa 100644
--- a/tp/Texinfo/XS/gnulib/m4/extern-inline.m4
+++ b/tp/Texinfo/XS/gnulib/m4/extern-inline.m4
@@ -1,10 +1,12 @@
-dnl 'extern inline' a la ISO C99.
-
-dnl Copyright 2012-2023 Free Software Foundation, Inc.
+# extern-inline.m4
+# serial 1
+dnl Copyright 2012-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl 'extern inline' a la ISO C99.
+
AC_DEFUN([gl_EXTERN_INLINE],
[
AC_CACHE_CHECK([whether ctype.h defines __header_inline],
diff --git a/tp/Texinfo/XS/gnulib/m4/float_h.m4
b/tp/Texinfo/XS/gnulib/m4/float_h.m4
index 95897cf17b..12c0eb6749 100644
--- a/tp/Texinfo/XS/gnulib/m4/float_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/float_h.m4
@@ -1,5 +1,6 @@
-# float_h.m4 serial 14
-dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# float_h.m4
+# serial 15
+dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -53,6 +54,31 @@ changequote([,])dnl
;;
esac
+ dnl Test for completeness w.r.t. ISO C 23.
+ REPLACE_FLOAT_SNAN=0
+ AC_CACHE_CHECK([whether float.h conforms to ISO C23],
+ [gl_cv_header_float_h_isoc23],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <float.h>
+ int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG };
+ float maxf = FLT_NORM_MAX;
+ double maxd = DBL_NORM_MAX;
+ long double maxl = LDBL_NORM_MAX;
+ ]],
+ [[float sf = FLT_SNAN;
+ double sd = DBL_SNAN;
+ long double sl = LDBL_SNAN;
+ return (sf != 0) + (sd != 0) + (sl != 0);
+ ]])],
+ [gl_cv_header_float_h_isoc23=yes],
+ [gl_cv_header_float_h_isoc23=no])
+ ])
+ if test $gl_cv_header_float_h_isoc23 != yes; then
+ GL_GENERATE_FLOAT_H=true
+ REPLACE_FLOAT_SNAN=1
+ fi
+
dnl Test against glibc-2.7 Linux/SPARC64 bug.
REPLACE_ITOLD=0
AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
diff --git a/tp/Texinfo/XS/gnulib/m4/free.m4 b/tp/Texinfo/XS/gnulib/m4/free.m4
index 0389dea3f4..a2b596d67f 100644
--- a/tp/Texinfo/XS/gnulib/m4/free.m4
+++ b/tp/Texinfo/XS/gnulib/m4/free.m4
@@ -1,8 +1,9 @@
-# free.m4 serial 6
-# Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# free.m4
+# serial 6
+dnl Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert and Bruno Haible.
diff --git a/tp/Texinfo/XS/gnulib/m4/getdelim.m4
b/tp/Texinfo/XS/gnulib/m4/getdelim.m4
index 60555b9718..6113903955 100644
--- a/tp/Texinfo/XS/gnulib/m4/getdelim.m4
+++ b/tp/Texinfo/XS/gnulib/m4/getdelim.m4
@@ -1,6 +1,7 @@
-# getdelim.m4 serial 19
+# getdelim.m4
+# serial 19
-dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/getline.m4
b/tp/Texinfo/XS/gnulib/m4/getline.m4
index 83e7e9315f..36513cd417 100644
--- a/tp/Texinfo/XS/gnulib/m4/getline.m4
+++ b/tp/Texinfo/XS/gnulib/m4/getline.m4
@@ -1,6 +1,7 @@
-# getline.m4 serial 33
+# getline.m4
+# serial 33
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl
dnl This file is free software; the Free Software Foundation
diff --git a/tp/Texinfo/XS/gnulib/m4/gnulib-cache.m4
b/tp/Texinfo/XS/gnulib/m4/gnulib-cache.m4
index c15359683c..5297bc2c45 100644
--- a/tp/Texinfo/XS/gnulib/m4/gnulib-cache.m4
+++ b/tp/Texinfo/XS/gnulib/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tp/Texinfo/XS/gnulib/m4/gnulib-common.m4
b/tp/Texinfo/XS/gnulib/m4/gnulib-common.m4
index c372316135..d985522893 100644
--- a/tp/Texinfo/XS/gnulib/m4/gnulib-common.m4
+++ b/tp/Texinfo/XS/gnulib/m4/gnulib-common.m4
@@ -1,5 +1,6 @@
-# gnulib-common.m4 serial 88
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# gnulib-common.m4
+# serial 103
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -20,10 +21,22 @@ AC_DEFUN([gl_COMMON_BODY], [
#define _GL_CONFIG_H_INCLUDED 1
])
AH_VERBATIM([_GL_GNUC_PREREQ],
-[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
-#if defined __GNUC__ && defined __GNUC_MINOR__
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR.
+ Except that
+ - clang groks GNU C 4.2, even on Windows, where it does not define
+ __GNUC__.
+ - The OpenMandriva-modified clang compiler pretends that it groks
+ GNU C version 13.1, but it doesn't: It does not support
+ __attribute__ ((__malloc__ (f, i))), nor does it support
+ __attribute__ ((__warning__ (message))) on a function redeclaration.
+ - Users can make clang lie as well, through the -fgnuc-version option.
*/
+#if defined __GNUC__ && defined __GNUC_MINOR__ && !defined __clang__
# define _GL_GNUC_PREREQ(major, minor) \
((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#elif defined __clang__
+ /* clang really only groks GNU C 4.2. */
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < 4 + ((minor) <= 2))
#else
# define _GL_GNUC_PREREQ(major, minor) 0
#endif
@@ -76,50 +89,79 @@ AC_DEFUN([gl_COMMON_BODY], [
#endif])
AH_VERBATIM([attribute],
[/* Attributes. */
-#if (defined __has_attribute \
- && (!defined __clang_minor__ \
- || (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
- : 5 <= __clang_major__)))
-# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
-#else
-# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
-# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
-# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
-# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
-# define _GL_ATTR_diagnose_if 0
-# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
-# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
-# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
-# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
-# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
-# ifdef _ICC
-# define _GL_ATTR_may_alias 0
+/* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if
+ <config.h> gets included once again after <sys/cdefs.h>, __has_attribute(x)
+ expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all
+ attributes. */
+#ifndef _GL_HAS_ATTRIBUTE
+# if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
+ : 5 <= __clang_major__)))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
# else
-# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_reproducible 0 /* not yet supported, as of GCC 14 */
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unsequenced 0 /* not yet supported, as of GCC 14 */
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
# endif
-# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
-# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
-# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
-# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
-# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
-# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
-# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
-# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
-# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
-/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
-#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
- && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
-# pragma GCC diagnostic ignored "-Wpedantic"
+/* Use __has_c_attribute if available. However, do not use with
+ pre-C23 GCC, which can issue false positives if -Wpedantic. */
+#if (defined __has_c_attribute \
+ && ! (_GL_GNUC_PREREQ (4, 6) \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710))
+# define _GL_HAVE___HAS_C_ATTRIBUTE 1
+#else
+# define _GL_HAVE___HAS_C_ATTRIBUTE 0
#endif
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in function declarations. There are two problems here.
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ 1) We want that the _GL_ATTRIBUTE_* can be cumulated on the same declaration
+ in any order.
+ =========================== foo.c = foo.cc ===========================
+ __attribute__ ((__deprecated__)) [[__nodiscard__]] int bar1 (int);
+ [[__nodiscard__]] __attribute__ ((__deprecated__)) int bar2 (int);
+ ======================================================================
+ This gives a syntax error
+ - in C mode with gcc
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796>, and
+ - in C++ mode with clang++ version < 16, and
+ - in C++ mode, inside extern "C" {}, still in newer clang++ versions
+ <https://github.com/llvm/llvm-project/issues/101990>.
+ */
/* Define if, in a function declaration, the attributes in bracket syntax
[[...]] must come before the attributes in __attribute__((...)) syntax.
If this is defined, it is best to avoid the bracket syntax, so that the
@@ -134,6 +176,176 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
# endif
#endif
+/*
+ 2) We want that the _GL_ATTRIBUTE_* can be placed in a declaration
+ - without 'extern', in C as well as in C++,
+ - with 'extern', in C,
+ - with 'extern "C"', in C++
+ in the same position. That is, we don't want to be forced to use a
+ macro which arranges for the attribute to come before 'extern' in
+ one case and after 'extern' in the other case, because such a macro
+ would make the source code of .h files pretty ugly.
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define ND [[__nodiscard__]]
+ #define WUR __attribute__((__warn_unused_result__))
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ // gcc clang g++ clang++
+
+ ND int foo (int);
+ int ND foo (int); // warn error warn error
+ int foo ND (int);
+ int foo (int) ND; // warn error warn error
+
+ WUR int foo (int);
+ int WUR foo (int);
+ int fo1 WUR (int); // error error error error
+ int foo (int) WUR;
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+ // gcc clang g++ clang++
+
+ ND extern CC int foo (int); // error error
+ extern CC ND int foo (int); // error error
+ extern CC int ND foo (int); // warn error warn error
+ extern CC int foo ND (int);
+ extern CC int foo (int) ND; // warn error warn error
+
+ WUR extern CC int foo (int); // warn
+ extern CC WUR int foo (int);
+ extern CC int WUR foo (int);
+ extern CC int foo WUR (int); // error error error error
+ extern CC int foo (int) WUR;
+
+ ND EXTERN_C_FUNC int foo (int); // error error
+ EXTERN_C_FUNC ND int foo (int);
+ EXTERN_C_FUNC int ND foo (int); // warn error warn error
+ EXTERN_C_FUNC int foo ND (int);
+ EXTERN_C_FUNC int foo (int) ND; // warn error warn error
+
+ WUR EXTERN_C_FUNC int foo (int); // warn
+ EXTERN_C_FUNC WUR int foo (int);
+ EXTERN_C_FUNC int WUR foo (int);
+ EXTERN_C_FUNC int fo2 WUR (int); // error error error error
+ EXTERN_C_FUNC int foo (int) WUR;
+ ======================================================================
+ So, if we insist on using the 'extern' keyword ('extern CC' idiom):
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there is one available position:
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is no available position:
+ it would need to come before 'extern' in C but after 'extern "C"'
+ in C++.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ Whereas, if we use the 'EXTERN_C_FUNC' idiom, which conditionally
+ omits the 'extern' keyword:
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there are two available positions:
+ - before the return type,
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is one available position:
+ - before the return type.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ The best choice is therefore to use the 'EXTERN_C_FUNC' idiom and
+ put the attributes before the return type. This works regardless
+ to what the _GL_ATTRIBUTE_* macros expand.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in static/inline function definitions.
+
+ There are similar constraints as for function declarations. However, here,
+ we cannot omit the storage-class specifier. Therefore, the following rule
+ applies:
+ * The macros
+ _GL_ATTRIBUTE_CONST
+ _GL_ATTRIBUTE_DEPRECATED
+ _GL_ATTRIBUTE_MAYBE_UNUSED
+ _GL_ATTRIBUTE_NODISCARD
+ _GL_ATTRIBUTE_PURE
+ _GL_ATTRIBUTE_REPRODUCIBLE
+ _GL_ATTRIBUTE_UNSEQUENCED
+ which may expand to bracket syntax [[...]], must come first, before the
+ storage-class specifier.
+ * Other _GL_ATTRIBUTE_* macros, that expand to __attribute__((...))
syntax,
+ are better placed between the storage-class specifier and the return
+ type.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in variable declarations.
+
+ At which position can they be placed?
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define BD [[__deprecated__]]
+ #define AD __attribute__ ((__deprecated__))
+
+ // gcc clang g++ clang++
+
+ BD extern CC int var; // error error
+ extern CC BD int var; // error error
+ extern CC int BD var; // warn error warn error
+ extern CC int var BD;
+
+ AD extern CC int var; // warn
+ extern CC AD int var;
+ extern CC int AD var;
+ extern CC int var AD;
+
+ BD extern CC int z[]; // error error
+ extern CC BD int z[]; // error error
+ extern CC int BD z[]; // warn error warn error
+ extern CC int z1 BD [];
+ extern CC int z[] BD; // warn error error
+
+ AD extern CC int z[]; // warn
+ extern CC AD int z[];
+ extern CC int AD z[];
+ extern CC int z2 AD []; // error error error error
+ extern CC int z[] AD;
+ ======================================================================
+
+ * For non-array variables, the only good position is after the variable
name,
+ that is, at the end of the declaration.
+ * For array variables, you will need to distinguish C and C++:
+ - In C, before the 'extern' keyword.
+ - In C++, between the 'extern "C"' and the variable's type.
+ */
]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
[
/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the
function
@@ -141,7 +353,7 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
by the Nth argument of the function is the size of the returned memory
block.
*/
-/* Applies to: function, pointer to function, function types. */
+/* Applies to: functions, pointer to functions, function types. */
#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
# if _GL_HAS_ATTRIBUTE (alloc_size)
# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
@@ -152,7 +364,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
function and report an error if it cannot do so. */
-/* Applies to: function. */
+/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
# if _GL_HAS_ATTRIBUTE (always_inline)
# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
@@ -164,7 +376,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
in stack traces when debugging. The compiler should omit the function from
stack traces. */
-/* Applies to: function. */
+/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_ARTIFICIAL
# if _GL_HAS_ATTRIBUTE (artificial)
# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
@@ -190,18 +402,23 @@ AC_DEFUN([gl_COMMON_BODY], [
# endif
#endif
-/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
- calls to the function with the same arguments.
- This attribute is safe for a function that neither depends on nor affects
- observable state, and always returns exactly once - e.g., does not loop
- forever, and does not call longjmp.
- (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
+/* _GL_ATTRIBUTE_CONST declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used.
+ This attribute is safe for a function that neither depends on
+ nor affects state, and always returns exactly once -
+ e.g., does not raise an exception, call longjmp, or loop forever.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE because the
+ function cannot observe state. It is stricter than
+ _GL_ATTRIBUTE_UNSEQUENCED because the function must return exactly
+ once and cannot depend on state addressed by its arguments.) */
/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_CONST
# if _GL_HAS_ATTRIBUTE (const)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
# else
-# define _GL_ATTRIBUTE_CONST
+# define _GL_ATTRIBUTE_CONST _GL_ATTRIBUTE_UNSEQUENCED
# endif
#endif
@@ -242,7 +459,7 @@ AC_DEFUN([gl_COMMON_BODY], [
in C++ also: namespace, class, template specialization. */
#ifndef _GL_ATTRIBUTE_DEPRECATED
# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
-# ifdef __has_c_attribute
+# if _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__deprecated__)
# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
# endif
@@ -291,7 +508,7 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Applies to: Empty statement (;), inside a 'switch' statement. */
/* Always expands to something. */
#ifndef _GL_ATTRIBUTE_FALLTHROUGH
-# ifdef __has_c_attribute
+# if _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__fallthrough__)
# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
# endif
@@ -380,7 +597,7 @@ AC_DEFUN([gl_COMMON_BODY], [
# if !defined __apple_build_version__ && __clang_major__ >= 10
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
-# elif defined __has_c_attribute
+# elif _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__maybe_unused__)
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
@@ -411,7 +628,7 @@ AC_DEFUN([gl_COMMON_BODY], [
# if __clang_major__ >= 1000
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif
-# elif defined __has_c_attribute
+# elif _GL_HAVE___HAS_C_ATTRIBUTE
# if __has_c_attribute (__nodiscard__)
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif
@@ -470,7 +687,7 @@ AC_DEFUN([gl_COMMON_BODY], [
other attributes. */
#ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus
-# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4
+# if _GL_GNUC_PREREQ (2, 8) || __clang_major__ >= 4
# if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else
@@ -495,25 +712,58 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Applies to: struct members, struct, union,
in C++ also: class. */
#ifndef _GL_ATTRIBUTE_PACKED
-# if _GL_HAS_ATTRIBUTE (packed)
+/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__))
despite
+ __has_attribute OK. */
+# if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C
# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
# else
# define _GL_ATTRIBUTE_PACKED
# endif
#endif
-/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
- calls to the function with the same arguments if observable state is not
- changed between calls.
- This attribute is safe for a function that does not affect
- observable state, and always returns exactly once.
- (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
+/* _GL_ATTRIBUTE_PURE declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used, and if observable state is the same.
+ This attribute is safe for a function that does not affect observable state
+ and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST because the function
+ can depend on observable state. It is stricter than
+ _GL_ATTRIBUTE_REPRODUCIBLE because the function must return exactly
+ once and cannot affect state addressed by its arguments.) */
/* Applies to: functions. */
#ifndef _GL_ATTRIBUTE_PURE
# if _GL_HAS_ATTRIBUTE (pure)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define _GL_ATTRIBUTE_PURE
+# define _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_REPRODUCIBLE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_REPRODUCIBLE declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same and is updated in time for
+ the rest of the program.
+ This attribute is safe for a function that is effectless and idempotent; see
+ ISO C 23 § 6.7.12.7 for a definition of these terms.
+ (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because
+ the function need not be stateless and idempotent. It is looser
+ than _GL_ATTRIBUTE_PURE because the function need not return
+ exactly once and can affect state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+/* This may be revisited when gcc and clang support [[reproducible]] or
possibly
+ __attribute__ ((__reproducible__)). */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if _GL_HAS_ATTRIBUTE (reproducible)
+# define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+# define _GL_ATTRIBUTE_REPRODUCIBLE
# endif
#endif
@@ -541,6 +791,33 @@ AC_DEFUN([gl_COMMON_BODY], [
# endif
#endif
+/* _GL_ATTRIBUTE_UNSEQUENCED declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same.
+ This attribute is safe for a function that is effectless, idempotent,
+ stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of
+ these terms.
+ (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because
+ the function must be stateless and independent. It is looser than
+ _GL_ATTRIBUTE_CONST because the function need not return exactly
+ once and can depend on state addressed by its arguments.)
+ See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
+ <https://stackoverflow.com/questions/76847905/>. */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_UNSEQUENCED
+/* This may be revisited when gcc and clang support [[unsequenced]] or possibly
+ __attribute__ ((__unsequenced__)). */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if _GL_HAS_ATTRIBUTE (unsequenced)
+# define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_UNSEQUENCED
+# define _GL_ATTRIBUTE_UNSEQUENCED
+# endif
+#endif
+
/* A helper macro. Don't use it directly. */
#ifndef _GL_ATTRIBUTE_UNUSED
# if _GL_HAS_ATTRIBUTE (unused)
@@ -1070,6 +1347,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
dnl -Wno-pedantic >= 4.8 >= 3.9
dnl -Wno-sign-compare >= 3 >= 3.9
dnl -Wno-sign-conversion >= 4.3 >= 3.9
+ dnl -Wno-tautological-out-of-range-compare - >= 3.9
dnl -Wno-type-limits >= 4.3 >= 3.9
dnl -Wno-undef >= 3 >= 3.9
dnl -Wno-unsuffixed-float-constants >= 4.5
@@ -1077,7 +1355,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
dnl -Wno-unused-parameter >= 3 >= 3.9
dnl
cat > conftest.c <<\EOF
- #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ >= 3 && !defined __clang__) || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
-Wno-cast-qual
-Wno-conversion
-Wno-float-equal
@@ -1086,20 +1364,23 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
-Wno-unused-function
-Wno-unused-parameter
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-float-conversion
#endif
- #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ >= 7 && !defined __clang__) || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
-Wimplicit-fallthrough
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-pedantic
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ +
(__clang_minor__ >= 9) > 3)
+ #if 3 < __clang_major__ + (9 <= __clang_minor__)
+ -Wno-tautological-constant-out-of-range-compare
+ #endif
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) ||
(__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-sign-conversion
-Wno-type-limits
#endif
- #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+ #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__)
-Wno-unsuffixed-float-constants
#endif
EOF
@@ -1158,12 +1439,12 @@ AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS],
if test $gl_cv_compiler_clang = yes; then
dnl Test whether the compiler supports the option
dnl '-Werror=unguarded-availability-new'.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile -Werror=unguarded-availability-new"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'],
[gl_cv_compiler_check_future_option=none])
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
else
gl_cv_compiler_check_future_option=none
fi
@@ -1211,14 +1492,14 @@ AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS],
darwin*)
if test "x$gl_cv_compiler_check_future_option" != "xnone"; then
dnl Use a compile test, not a link test.
- save_ac_compile="$ac_compile"
+ saved_ac_compile="$ac_compile"
ac_compile="$ac_compile $gl_cv_compiler_check_future_option"
- save_ac_compile_for_check_decl="$ac_compile_for_check_decl"
+ saved_ac_compile_for_check_decl="$ac_compile_for_check_decl"
ac_compile_for_check_decl="$ac_compile_for_check_decl
$gl_cv_compiler_check_future_option"
unset [ac_cv_have_decl_][$1]
AC_CHECK_DECL([$1], , , [$2])
- ac_compile="$save_ac_compile"
- ac_compile_for_check_decl="$save_ac_compile_for_check_decl"
+ ac_compile="$saved_ac_compile"
+ ac_compile_for_check_decl="$saved_ac_compile_for_check_decl"
[ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]"
if test $[ac_cv_func_][$1] = yes; then
[gl_cv_onwards_func_][$1]=yes
diff --git a/tp/Texinfo/XS/gnulib/m4/gnulib-comp.m4
b/tp/Texinfo/XS/gnulib/m4/gnulib-comp.m4
index 41c98e44d3..38b20ba046 100644
--- a/tp/Texinfo/XS/gnulib/m4/gnulib-comp.m4
+++ b/tp/Texinfo/XS/gnulib/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -55,6 +55,10 @@ AC_DEFUN([gl_EARLY],
# Code from module errno:
# Code from module exitfail:
# Code from module extensions:
+ # This is actually already done in the pre-early phase.
+ # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ # Code from module extensions-aix:
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
# Code from module extern-inline:
# Code from module float:
# Code from module free-posix:
@@ -102,6 +106,7 @@ AC_DEFUN([gl_EARLY],
# Code from module strndup:
# Code from module strnlen:
# Code from module sys_types:
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
# Code from module uniconv/base:
# Code from module uniconv/u8-conv-from-enc:
# Code from module uniconv/u8-strconv-from-enc:
@@ -160,8 +165,11 @@ AC_DEFUN([gl_INIT],
gl_FLOAT_H
gl_CONDITIONAL_HEADER([float.h])
AC_PROG_MKDIR_P
- gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_FLOAT],
+ [test $REPLACE_FLOAT_LDBL = 1 || test $REPLACE_FLOAT_SNAN =
1])
gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1])
+ dnl Prerequisites of lib/float.c.
+ AC_REQUIRE([gl_BIGENDIAN])
gl_FUNC_FREE
gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
AM_COND_IF([GL_COND_OBJ_FREE], [
@@ -221,7 +229,10 @@ AC_DEFUN([gl_INIT],
gl_STRING_MODULE_INDICATOR([memchr])
gl_MULTIARCH
gl_FUNC_OBSTACK
- gl_CONDITIONAL([GL_COND_OBJ_OBSTACK], [test "$gl_cv_func_obstack" != yes])
+ gl_CONDITIONAL_HEADER([obstack.h])
+ gl_CONDITIONAL([GL_COND_OBJ_OBSTACK],
+ [test $HAVE_OBSTACK = 0 || test $REPLACE_OBSTACK = 1])
+ AC_PROG_MKDIR_P
gl_FUNC_RAWMEMCHR
gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0])
AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [
@@ -348,7 +359,7 @@ AC_DEFUN([gl_INIT],
])
gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h])
AC_PROG_MKDIR_P
- gl_LIBUNISTRING_MODULE([1.1], [uniwidth/width])
+ gl_LIBUNISTRING_MODULE([1.2], [uniwidth/width])
AC_C_VARARRAYS
AC_REQUIRE([AC_C_RESTRICT])
gl_FUNC_VASNPRINTF
@@ -590,7 +601,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/memchr.c
lib/memchr.valgrind
lib/obstack.c
- lib/obstack.h
+ lib/obstack.in.h
lib/printf-args.c
lib/printf-args.h
lib/printf-parse.c
@@ -663,6 +674,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/eealloc.m4
m4/errno_h.m4
m4/exponentd.m4
+ m4/extensions-aix.m4
m4/extensions.m4
m4/extern-inline.m4
m4/float_h.m4
@@ -698,6 +710,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/multiarch.m4
m4/musl.m4
m4/obstack.m4
+ m4/off64_t.m4
m4/off_t.m4
m4/pid_t.m4
m4/printf.m4
@@ -722,7 +735,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/vasprintf.m4
m4/warn-on-use.m4
m4/wchar_h.m4
- m4/wchar_t.m4
m4/wctype_h.m4
m4/wcwidth.m4
m4/wint_t.m4
diff --git a/tp/Texinfo/XS/gnulib/m4/gnulib-tool.m4
b/tp/Texinfo/XS/gnulib/m4/gnulib-tool.m4
index a9dd569bdb..2f517f1bbc 100644
--- a/tp/Texinfo/XS/gnulib/m4/gnulib-tool.m4
+++ b/tp/Texinfo/XS/gnulib/m4/gnulib-tool.m4
@@ -1,5 +1,6 @@
-# gnulib-tool.m4 serial 4
-dnl Copyright (C) 2004-2005, 2009-2023 Free Software Foundation, Inc.
+# gnulib-tool.m4
+# serial 5
+dnl Copyright (C) 2004-2005, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -41,6 +42,9 @@ AC_DEFUN([gl_LIB], [])
dnl Usage: gl_LGPL or gl_LGPL([VERSION])
AC_DEFUN([gl_LGPL], [])
+dnl Usage: gl_GPL([VERSION])
+AC_DEFUN([gl_GPL], [])
+
dnl Usage: gl_MAKEFILE_NAME([FILENAME])
AC_DEFUN([gl_MAKEFILE_NAME], [])
diff --git a/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
b/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
index 134f228341..80a8366855 100644
--- a/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
+++ b/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
@@ -1,5 +1,6 @@
-# host-cpu-c-abi.m4 serial 15
-dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
+# host-cpu-c-abi.m4
+# serial 18
+dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -35,7 +36,7 @@ dnl * The same canonical name is used for different
endiannesses. You can
dnl determine the endianness through preprocessor symbols:
dnl - 'arm': test __ARMEL__.
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
-dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__.
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
@@ -461,217 +462,66 @@ EOF
dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
-dnl one, or to 'unknown' if unknown.
+dnl one.
dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
- [if test -n "$gl_cv_host_cpu_c_abi"; then
- case "$gl_cv_host_cpu_c_abi" in
- i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 |
mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
- gl_cv_host_cpu_c_abi_32bit=yes ;;
- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 |
powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
- gl_cv_host_cpu_c_abi_32bit=no ;;
- *)
- gl_cv_host_cpu_c_abi_32bit=unknown ;;
- esac
- else
- case "$host_cpu" in
-
- # CPUs that only support a 32-bit ABI.
- arc \
- | bfin \
- | cris* \
- | csky \
- | epiphany \
- | ft32 \
- | h8300 \
- | m68k \
- | microblaze | microblazeel \
- | nds32 | nds32le | nds32be \
- | nios2 | nios2eb | nios2el \
- | or1k* \
- | or32 \
- | sh | sh[1234] | sh[1234]e[lb] \
- | tic6x \
- | xtensa* )
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
+ [case "$host_cpu" in
- # CPUs that only support a 64-bit ABI.
-changequote(,)dnl
- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
- | mmix )
-changequote([,])dnl
- gl_cv_host_cpu_c_abi_32bit=no
- ;;
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+ # CPUs that only support a 64-bit ABI.
changequote(,)dnl
- i[34567]86 )
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
changequote([,])dnl
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
-
- x86_64 )
- # On x86_64 systems, the C compiler may be generating code in one of
- # these ABIs:
- # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
- # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
- # with native Windows (mingw, MSVC).
- # - 64-bit instruction set, 32-bit pointers, 32-bit 'long':
x86_64-x32.
- # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if (defined __x86_64__ || defined __amd64__ \
- || defined _M_X64 || defined _M_AMD64) \
- && !(defined __ILP32__ || defined _ILP32)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- arm* | aarch64 )
- # Assume arm with EABI.
- # On arm64 systems, the C compiler may be generating code in one of
- # these ABIs:
- # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
- # - aarch64 instruction set, 32-bit pointers, 32-bit 'long':
arm64-ilp32.
- # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or
armhf.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __aarch64__ && !(defined __ILP32__ || defined
_ILP32)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
- # On hppa, the C compiler may be generating 32-bit code or 64-bit
- # code. In the latter case, it defines _LP64 and __LP64__.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- ia64* )
- # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
- # 32-bit code. In the latter case, it defines _ILP32.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef _ILP32
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=yes],
- [gl_cv_host_cpu_c_abi_32bit=no])
- ;;
-
- mips* )
- # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
- # at 32.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- powerpc* )
- # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
- # No need to distinguish them here; the caller may distinguish
- # them based on the OS.
- # On powerpc64 systems, the C compiler may still be generating
- # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
- # be generating 64-bit code.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- rs6000 )
- gl_cv_host_cpu_c_abi_32bit=yes
- ;;
-
- riscv32 | riscv64 )
- # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
- # Size of 'long' and 'void *':
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- s390* )
- # On s390x, the C compiler may be generating 64-bit (= s390x) code
- # or 31-bit (= s390) code.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__ || defined __s390x__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_host_cpu_c_abi_32bit=no],
- [gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
- sparc | sparc64 )
- # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
- # C compiler still generates 32-bit code.
+ *)
+ if test -n "$gl_cv_host_cpu_c_abi"; then
+ dnl gl_HOST_CPU_C_ABI has already been run. Use its result.
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32
| mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 |
powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ fi
+ if test $gl_cv_host_cpu_c_abi_32bit = unknown; then
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __sparcv9 || defined __arch64__
- int ok;
- #else
- error fail
- #endif
+ [[int test_pointer_size[sizeof (void *) - 5];
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
- ;;
-
- *)
- gl_cv_host_cpu_c_abi_32bit=unknown
- ;;
- esac
- fi
+ fi
+ ;;
+ esac
])
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
diff --git a/tp/Texinfo/XS/gnulib/m4/iconv.m4 b/tp/Texinfo/XS/gnulib/m4/iconv.m4
index ff5d526113..b414bfca62 100644
--- a/tp/Texinfo/XS/gnulib/m4/iconv.m4
+++ b/tp/Texinfo/XS/gnulib/m4/iconv.m4
@@ -1,5 +1,6 @@
-# iconv.m4 serial 26
-dnl Copyright (C) 2000-2002, 2007-2014, 2016-2023 Free Software Foundation,
+# iconv.m4
+# serial 28
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -38,7 +39,7 @@ AC_DEFUN([AM_ICONV_LINK],
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
- am_save_CPPFLAGS="$CPPFLAGS"
+ gl_saved_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
@@ -55,7 +56,7 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close(cd);]])],
[am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
- am_save_LIBS="$LIBS"
+ gl_saved_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
@@ -68,14 +69,14 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close(cd);]])],
[am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes])
- LIBS="$am_save_LIBS"
+ LIBS="$gl_saved_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
- dnl Solaris 10.
- am_save_LIBS="$LIBS"
+ dnl Solaris 10, macOS 14.4.
+ gl_saved_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
@@ -113,6 +114,35 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close (cd_utf8_to_88591);
}
}
+ /* Test against macOS 14.4 bug: Failures are not distinguishable from
+ successful returns.
+ POSIX:2018 says: "The iconv() function shall ... return the number of
+ non-identical conversions performed."
+ But here, the conversion always does transliteration (the suffixes
+ "//TRANSLIT" and "//IGNORE" have no effect, nor does iconvctl()) and
+ does not report when it does a non-identical conversion. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\305\202"; /* LATIN SMALL LETTER L
WITH STROKE */
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ /* Here:
+ With glibc, GNU libiconv (including macOS up to 13): res ==
(size_t)-1, errno == EILSEQ.
+ With musl libc, NetBSD 10, Solaris 11: res == 1.
+ With macOS 14.4: res == 0, output is "l". */
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
/* Test against Solaris 10 bug: Failures are not distinguishable from
successful returns. */
{
@@ -129,7 +159,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- result |= 2;
+ result |= 4;
iconv_close (cd_ascii_to_88591);
}
}
@@ -148,7 +178,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
- result |= 4;
+ result |= 8;
iconv_close (cd_88591_to_utf8);
}
}
@@ -168,7 +198,7 @@ AC_DEFUN([AM_ICONV_LINK],
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
- result |= 8;
+ result |= 16;
iconv_close (cd_88591_to_utf8);
}
}
@@ -186,7 +216,7 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_t cd4 = iconv_open ("utf8", "eucJP");
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
- result |= 16;
+ result |= 32;
if (cd1 != (iconv_t)(-1))
iconv_close (cd1);
if (cd2 != (iconv_t)(-1))
@@ -205,7 +235,7 @@ AC_DEFUN([AM_ICONV_LINK],
esac])
test "$am_cv_func_iconv_works" = no || break
done
- LIBS="$am_save_LIBS"
+ LIBS="$gl_saved_LIBS"
])
case "$am_cv_func_iconv_works" in
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
@@ -224,7 +254,7 @@ AC_DEFUN([AM_ICONV_LINK],
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
- CPPFLAGS="$am_save_CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
diff --git a/tp/Texinfo/XS/gnulib/m4/iconv_h.m4
b/tp/Texinfo/XS/gnulib/m4/iconv_h.m4
index 40c985ee33..08ecb8c643 100644
--- a/tp/Texinfo/XS/gnulib/m4/iconv_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/iconv_h.m4
@@ -1,5 +1,6 @@
-# iconv_h.m4 serial 16
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# iconv_h.m4
+# serial 16
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/iconv_open.m4
b/tp/Texinfo/XS/gnulib/m4/iconv_open.m4
index 8a27709f93..61e62ece7b 100644
--- a/tp/Texinfo/XS/gnulib/m4/iconv_open.m4
+++ b/tp/Texinfo/XS/gnulib/m4/iconv_open.m4
@@ -1,5 +1,6 @@
-# iconv_open.m4 serial 16
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# iconv_open.m4
+# serial 17
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
dnl We know that GNU libiconv and GNU libc do.
AC_EGREP_CPP([gnu_iconv], [
#include <iconv.h>
- #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined
__UCLIBC__)
+ #if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b &&
defined __APPLE__)) \
+ || (defined __GLIBC__ && !defined __UCLIBC__)
gnu_iconv
#endif
], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
diff --git a/tp/Texinfo/XS/gnulib/m4/include_next.m4
b/tp/Texinfo/XS/gnulib/m4/include_next.m4
index 9f19215ef0..03e852518e 100644
--- a/tp/Texinfo/XS/gnulib/m4/include_next.m4
+++ b/tp/Texinfo/XS/gnulib/m4/include_next.m4
@@ -1,5 +1,6 @@
-# include_next.m4 serial 26
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# include_next.m4
+# serial 27
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -74,17 +75,17 @@ EOF
#endif
#define DEFINED_IN_CONFTESTD2
EOF
- gl_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+ gl_saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2"
dnl We intentionally avoid using AC_LANG_SOURCE here.
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=yes],
- [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2"
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=buggy],
[gl_cv_have_include_next=no])
])
- CPPFLAGS="$gl_save_CPPFLAGS"
+ CPPFLAGS="$gl_saved_CPPFLAGS"
rm -rf conftestd1a conftestd1b conftestd2
])
PRAGMA_SYSTEM_HEADER=
diff --git a/tp/Texinfo/XS/gnulib/m4/inline.m4
b/tp/Texinfo/XS/gnulib/m4/inline.m4
index dbbb811674..f962bde1cc 100644
--- a/tp/Texinfo/XS/gnulib/m4/inline.m4
+++ b/tp/Texinfo/XS/gnulib/m4/inline.m4
@@ -1,5 +1,6 @@
-# inline.m4 serial 4
-dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
+# inline.m4
+# serial 4
+dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/intmax_t.m4
b/tp/Texinfo/XS/gnulib/m4/intmax_t.m4
index ef32e1b9ca..72858ea86c 100644
--- a/tp/Texinfo/XS/gnulib/m4/intmax_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/intmax_t.m4
@@ -1,5 +1,6 @@
-# intmax_t.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# intmax_t.m4
+# serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/inttypes.m4
b/tp/Texinfo/XS/gnulib/m4/inttypes.m4
index e7efbe9416..c43cd16207 100644
--- a/tp/Texinfo/XS/gnulib/m4/inttypes.m4
+++ b/tp/Texinfo/XS/gnulib/m4/inttypes.m4
@@ -1,5 +1,6 @@
-# inttypes.m4 serial 37
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# inttypes.m4
+# serial 37
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/inttypes_h.m4
b/tp/Texinfo/XS/gnulib/m4/inttypes_h.m4
index 68c60e9dbb..3b9da5b0ac 100644
--- a/tp/Texinfo/XS/gnulib/m4/inttypes_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/inttypes_h.m4
@@ -1,5 +1,6 @@
-# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# inttypes_h.m4
+# serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
b/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
index 70ca4a2e1d..5da3eecfc6 100644
--- a/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
+++ b/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
@@ -1,5 +1,6 @@
-# lib-ld.m4 serial 12
-dnl Copyright (C) 1996-2003, 2009-2023 Free Software Foundation, Inc.
+# lib-ld.m4
+# serial 13
+dnl Copyright (C) 1996-2003, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -97,9 +98,9 @@ else
fi
if test -n "$ac_prog"; then
# Search for $ac_prog in $PATH.
- acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$acl_save_ifs"
+ IFS="$acl_saved_IFS"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext";
then
acl_cv_path_LD="$ac_dir/$ac_prog"
@@ -116,7 +117,7 @@ else
esac
fi
done
- IFS="$acl_save_ifs"
+ IFS="$acl_saved_IFS"
fi
case $host in
*-*-aix*)
diff --git a/tp/Texinfo/XS/gnulib/m4/lib-link.m4
b/tp/Texinfo/XS/gnulib/m4/lib-link.m4
index 5f8afae61a..fb764d3229 100644
--- a/tp/Texinfo/XS/gnulib/m4/lib-link.m4
+++ b/tp/Texinfo/XS/gnulib/m4/lib-link.m4
@@ -1,5 +1,6 @@
-# lib-link.m4 serial 33
-dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# lib-link.m4
+# serial 34
+dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -69,11 +70,11 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
dnl because if the user has installed lib[]Name and not disabled its use
dnl via --without-lib[]Name-prefix, he wants to use it.
- ac_save_CPPFLAGS="$CPPFLAGS"
+ acl_saved_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
- ac_save_LIBS="$LIBS"
+ acl_saved_LIBS="$LIBS"
dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
dnl because these -l options might require -L options that are present in
dnl LIBS. -l options benefit only from the -L options listed before it.
@@ -89,7 +90,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[AC_LANG_PROGRAM([[$3]], [[$4]])],
[ac_cv_lib[]Name=yes],
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
- LIBS="$ac_save_LIBS"
+ LIBS="$acl_saved_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
@@ -100,7 +101,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
HAVE_LIB[]NAME=no
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
dnl $INC[]NAME either.
- CPPFLAGS="$ac_save_CPPFLAGS"
+ CPPFLAGS="$acl_saved_CPPFLAGS"
LIB[]NAME=
LTLIB[]NAME=
LIB[]NAME[]_PREFIX=
@@ -537,12 +538,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Read the .la file. It defines the variables
dnl dlname, library_names, old_library, dependency_libs, current,
dnl age, revision, installed, dlopen, dlpreopen, libdir.
- save_libdir="$libdir"
+ saved_libdir="$libdir"
case "$found_la" in
*/* | *\\*) . "$found_la" ;;
*) . "./$found_la" ;;
esac
- libdir="$save_libdir"
+ libdir="$saved_libdir"
dnl We use only dependency_libs.
for dep in $dependency_libs; do
case "$dep" in
@@ -682,18 +683,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
done
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
dnl The -rpath options are cumulative.
for found_dir in $rpathdirs; do
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$found_dir"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
fi
@@ -790,18 +791,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
for dir in $rpathdirs; do
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
done
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
$1="$flag"
else
dnl The -rpath options are cumulative.
for dir in $rpathdirs; do
- acl_save_libdir="$libdir"
+ acl_saved_libdir="$libdir"
libdir="$dir"
eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
+ libdir="$acl_saved_libdir"
$1="${$1}${$1:+ }$flag"
done
fi
diff --git a/tp/Texinfo/XS/gnulib/m4/lib-prefix.m4
b/tp/Texinfo/XS/gnulib/m4/lib-prefix.m4
index aefe7f7124..6277f72d0c 100644
--- a/tp/Texinfo/XS/gnulib/m4/lib-prefix.m4
+++ b/tp/Texinfo/XS/gnulib/m4/lib-prefix.m4
@@ -1,5 +1,6 @@
-# lib-prefix.m4 serial 20
-dnl Copyright (C) 2001-2005, 2008-2023 Free Software Foundation, Inc.
+# lib-prefix.m4
+# serial 23
+dnl Copyright (C) 2001-2005, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -126,10 +127,10 @@ AC_DEFUN([AC_LIB_PREPARE_PREFIX],
else
acl_final_exec_prefix="$exec_prefix"
fi
- acl_save_prefix="$prefix"
+ acl_saved_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
- prefix="$acl_save_prefix"
+ prefix="$acl_saved_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
@@ -137,13 +138,13 @@ dnl variables prefix and exec_prefix bound to the values
they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
- acl_save_prefix="$prefix"
+ acl_saved_prefix="$prefix"
prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
+ acl_saved_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
+ exec_prefix="$acl_saved_exec_prefix"
+ prefix="$acl_saved_prefix"
])
dnl AC_LIB_PREPARE_MULTILIB creates
@@ -174,7 +175,7 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
[AC_EGREP_CPP([Extensible Linking Format],
- [#if defined __ELF__ || (defined __linux__ && defined __EDG__)
+ [#if defined __ELF__ || (defined __linux__ && (defined __EDG__ ||
defined __SUNPRO_C))
Extensible Linking Format
#endif
],
@@ -256,6 +257,15 @@ changequote([,])dnl
esac
fi
;;
+ netbsd*)
+ dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains
+ dnl 32-bit libraries.
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparc ;;
+ esac
+ fi
+ ;;
*)
dnl If $CC generates code for a 32-bit ABI, the libraries are
dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
@@ -280,7 +290,7 @@ changequote([,])dnl
fi
fi
if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
+ acl_saved_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
@@ -297,7 +307,7 @@ changequote([,])dnl
esac
fi
done
- IFS="$acl_save_IFS"
+ IFS="$acl_saved_IFS"
if test $HOST_CPU_C_ABI_32BIT = yes; then
# 32-bit ABI.
acl_libdirstem3=
diff --git a/tp/Texinfo/XS/gnulib/m4/libunistring-base.m4
b/tp/Texinfo/XS/gnulib/m4/libunistring-base.m4
index 6dd184a789..21e0e44212 100644
--- a/tp/Texinfo/XS/gnulib/m4/libunistring-base.m4
+++ b/tp/Texinfo/XS/gnulib/m4/libunistring-base.m4
@@ -1,5 +1,6 @@
-# libunistring-base.m4 serial 8
-dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# libunistring-base.m4
+# serial 9
+dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -152,6 +153,10 @@ dnl gl_LIBUNISTRING_VERSION_CMP([VERSION])
dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION
dnl is less than the VERSION argument.
AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
+[dnl VERSION = 999.9 means to evaluates to true always, i.e. to ignore
+dnl the installed libunistring regardless of its version.
+m4_if([$1], [999.9],
+[true],
[ { test "$HAVE_LIBUNISTRING" != yes \
|| {
dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least.
@@ -189,7 +194,7 @@ AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
}
])
}
- }])
+ }])])
dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the
dnl same as ORIG, otherwise to 0.
diff --git a/tp/Texinfo/XS/gnulib/m4/libunistring.m4
b/tp/Texinfo/XS/gnulib/m4/libunistring.m4
index 1570281176..85b638412a 100644
--- a/tp/Texinfo/XS/gnulib/m4/libunistring.m4
+++ b/tp/Texinfo/XS/gnulib/m4/libunistring.m4
@@ -1,5 +1,6 @@
-# libunistring.m4 serial 12
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# libunistring.m4
+# serial 13
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -73,7 +74,7 @@ AC_DEFUN([gl_LIBUNISTRING_CORE],
dnl We have to erase the cached result of the first AC_LIB_HAVE_LINKFLAGS
dnl invocation, otherwise the second one will not be run.
unset ac_cv_libunistring
- glus_save_LIBS="$LIBS"
+ glus_saved_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_LIB_HAVE_LINKFLAGS([unistring], [],
[#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
@@ -82,7 +83,7 @@ AC_DEFUN([gl_LIBUNISTRING_CORE],
LIBUNISTRING="$LIBUNISTRING $LIBICONV"
LTLIBUNISTRING="$LTLIBUNISTRING $LTLIBICONV"
fi
- LIBS="$glus_save_LIBS"
+ LIBS="$glus_saved_LIBS"
fi
else
AC_LIB_HAVE_LINKFLAGS([unistring], [],
diff --git a/tp/Texinfo/XS/gnulib/m4/limits-h.m4
b/tp/Texinfo/XS/gnulib/m4/limits-h.m4
index 6a5983ebc2..1b619e1eb2 100644
--- a/tp/Texinfo/XS/gnulib/m4/limits-h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/limits-h.m4
@@ -1,10 +1,12 @@
-dnl Check whether limits.h has needed features.
-
-dnl Copyright 2016-2023 Free Software Foundation, Inc.
+# limits-h.m4
+# serial 1
+dnl Copyright 2016-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Check whether limits.h has needed features.
+
dnl From Paul Eggert.
AC_DEFUN_ONCE([gl_LIMITS_H],
diff --git a/tp/Texinfo/XS/gnulib/m4/localcharset.m4
b/tp/Texinfo/XS/gnulib/m4/localcharset.m4
index 15b6b2a553..807a5eedac 100644
--- a/tp/Texinfo/XS/gnulib/m4/localcharset.m4
+++ b/tp/Texinfo/XS/gnulib/m4/localcharset.m4
@@ -1,5 +1,6 @@
-# localcharset.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc.
+# localcharset.m4
+# serial 8
+dnl Copyright (C) 2002, 2004, 2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/locale-fr.m4
b/tp/Texinfo/XS/gnulib/m4/locale-fr.m4
index ac1c7217da..f8d7c543e0 100644
--- a/tp/Texinfo/XS/gnulib/m4/locale-fr.m4
+++ b/tp/Texinfo/XS/gnulib/m4/locale-fr.m4
@@ -1,5 +1,6 @@
-# locale-fr.m4 serial 23
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-fr.m4
+# serial 23
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -116,7 +117,7 @@ int main () {
if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr=fr_FR.iso88591
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr=fr
else
@@ -250,7 +251,7 @@ int main () {
if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr_utf8=fr_FR.UTF-8
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_fr_utf8=fr.UTF-8
else
diff --git a/tp/Texinfo/XS/gnulib/m4/locale-ja.m4
b/tp/Texinfo/XS/gnulib/m4/locale-ja.m4
index 4350010cba..8423bcb972 100644
--- a/tp/Texinfo/XS/gnulib/m4/locale-ja.m4
+++ b/tp/Texinfo/XS/gnulib/m4/locale-ja.m4
@@ -1,5 +1,6 @@
-# locale-ja.m4 serial 18
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-ja.m4
+# serial 18
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -117,7 +118,7 @@ int main ()
if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_ja=ja_JP.EUC
else
- # Test for the Solaris 7 locale name.
+ # Test for the Solaris 10 locale name.
if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit)
2>/dev/null; then
gt_cv_locale_ja=ja
else
diff --git a/tp/Texinfo/XS/gnulib/m4/locale-zh.m4
b/tp/Texinfo/XS/gnulib/m4/locale-zh.m4
index 10a2b5875a..fb9f26ab9f 100644
--- a/tp/Texinfo/XS/gnulib/m4/locale-zh.m4
+++ b/tp/Texinfo/XS/gnulib/m4/locale-zh.m4
@@ -1,5 +1,6 @@
-# locale-zh.m4 serial 18
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-zh.m4
+# serial 19
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -21,6 +22,7 @@ AC_DEFUN_ONCE([gt_LOCALE_ZH_CN],
#endif
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
struct tm t;
char buf[16];
int main ()
@@ -79,6 +81,19 @@ int main ()
single wide character. This excludes the GB2312 and GBK encodings. */
if (mblen ("\203\062\332\066", 5) != 4)
return 1;
+ /* Check whether mbrtowc accept this character one byte at a time.
+ This excludes NetBSD 10.0. */
+ if (sizeof (wchar_t) > 2)
+ {
+ wchar_t wc;
+ mbstate_t state;
+ memset (&state, 0, sizeof (state));
+ if (!(mbrtowc (&wc, "\203", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\062", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\332", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\066", 1, &state) == 1))
+ return 1;
+ }
return 0;
#endif
}
diff --git a/tp/Texinfo/XS/gnulib/m4/malloca.m4
b/tp/Texinfo/XS/gnulib/m4/malloca.m4
index 1d777ebe6d..9e09d22cb9 100644
--- a/tp/Texinfo/XS/gnulib/m4/malloca.m4
+++ b/tp/Texinfo/XS/gnulib/m4/malloca.m4
@@ -1,5 +1,6 @@
-# malloca.m4 serial 2
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
+# malloca.m4
+# serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/math_h.m4
b/tp/Texinfo/XS/gnulib/m4/math_h.m4
index c214f8efa8..7e69629c3d 100644
--- a/tp/Texinfo/XS/gnulib/m4/math_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/math_h.m4
@@ -1,5 +1,6 @@
-# math_h.m4 serial 126
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# math_h.m4
+# serial 140
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -42,15 +43,21 @@ AC_DEFUN_ONCE([gl_MATH_H],
cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
expf expl exp2 exp2f exp2l expm1 expm1f expm1l
fabsf fabsl floorf floorl fma fmaf fmal
- fmod fmodf fmodl frexpf frexpl hypotf hypotl
+ fmod fmodf fmodl frexpf frexpl
+ getpayload getpayloadf getpayloadl
+ hypotf hypotl
ilogb ilogbf ilogbl
ldexpf ldexpl
log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
- logb logbf logbl
+ logb logbf logbl logp1 log1pf logp1l
modf modff modfl powf
remainder remainderf remainderl
- rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
- tanf tanl tanhf trunc truncf truncl])
+ rint rintf rintl round roundf roundl
+ setpayload setpayloadf setpayloadl
+ setpayloadsig setpayloadsigf setpayloadsigl
+ sinf sinl sinhf sqrtf sqrtl
+ tanf tanl tanhf totalorder totalorderf totalorderl totalordermag
+ totalordermagf totalordermagl trunc truncf truncl])
])
# gl_MATH_MODULE_INDICATOR([modulename])
@@ -113,6 +120,9 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
@@ -143,6 +153,9 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1L])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
@@ -156,6 +169,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
@@ -165,6 +184,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
@@ -210,6 +235,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_GETPAYLOAD=1; AC_SUBST([HAVE_GETPAYLOAD])
+ HAVE_GETPAYLOADF=1; AC_SUBST([HAVE_GETPAYLOADF])
+ HAVE_GETPAYLOADL=1; AC_SUBST([HAVE_GETPAYLOADL])
HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
@@ -228,6 +256,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_LOGP1=1; AC_SUBST([HAVE_LOGP1])
+ HAVE_LOGP1F=1; AC_SUBST([HAVE_LOGP1F])
+ HAVE_LOGP1L=1; AC_SUBST([HAVE_LOGP1L])
HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
HAVE_POWF=1; AC_SUBST([HAVE_POWF])
@@ -235,6 +266,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
HAVE_RINT=1; AC_SUBST([HAVE_RINT])
HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SETPAYLOAD=1; AC_SUBST([HAVE_SETPAYLOAD])
+ HAVE_SETPAYLOADF=1; AC_SUBST([HAVE_SETPAYLOADF])
+ HAVE_SETPAYLOADL=1; AC_SUBST([HAVE_SETPAYLOADL])
+ HAVE_SETPAYLOADSIG=1; AC_SUBST([HAVE_SETPAYLOADSIG])
+ HAVE_SETPAYLOADSIGF=1; AC_SUBST([HAVE_SETPAYLOADSIGF])
+ HAVE_SETPAYLOADSIGL=1; AC_SUBST([HAVE_SETPAYLOADSIGL])
HAVE_SINF=1; AC_SUBST([HAVE_SINF])
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
@@ -243,6 +280,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_TANF=1; AC_SUBST([HAVE_TANF])
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
+ HAVE_TOTALORDER=1; AC_SUBST([HAVE_TOTALORDER])
+ HAVE_TOTALORDERF=1; AC_SUBST([HAVE_TOTALORDERF])
+ HAVE_TOTALORDERL=1; AC_SUBST([HAVE_TOTALORDERL])
+ HAVE_TOTALORDERMAG=1; AC_SUBST([HAVE_TOTALORDERMAG])
+ HAVE_TOTALORDERMAGF=1; AC_SUBST([HAVE_TOTALORDERMAGF])
+ HAVE_TOTALORDERMAGL=1; AC_SUBST([HAVE_TOTALORDERMAGL])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
@@ -310,6 +353,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
+ REPLACE_GETPAYLOAD=0; AC_SUBST([REPLACE_GETPAYLOAD])
+ REPLACE_GETPAYLOADF=0; AC_SUBST([REPLACE_GETPAYLOADF])
+ REPLACE_GETPAYLOADL=0; AC_SUBST([REPLACE_GETPAYLOADL])
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
@@ -356,6 +402,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
+ REPLACE_TOTALORDER=0; AC_SUBST([REPLACE_TOTALORDER])
+ REPLACE_TOTALORDERF=0; AC_SUBST([REPLACE_TOTALORDERF])
+ REPLACE_TOTALORDERL=0; AC_SUBST([REPLACE_TOTALORDERL])
+ REPLACE_TOTALORDERMAG=0; AC_SUBST([REPLACE_TOTALORDERMAG])
+ REPLACE_TOTALORDERMAGF=0; AC_SUBST([REPLACE_TOTALORDERMAGF])
+ REPLACE_TOTALORDERMAGL=0; AC_SUBST([REPLACE_TOTALORDERMAGL])
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
@@ -366,7 +418,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
# The currently known platforms where this is the case are:
-# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+# Linux/HPPA, NetBSD/sparc32, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
[
AC_CACHE_CHECK([whether long double and double are the same],
diff --git a/tp/Texinfo/XS/gnulib/m4/mbrtowc.m4
b/tp/Texinfo/XS/gnulib/m4/mbrtowc.m4
index ea0789510f..4ea8184049 100644
--- a/tp/Texinfo/XS/gnulib/m4/mbrtowc.m4
+++ b/tp/Texinfo/XS/gnulib/m4/mbrtowc.m4
@@ -1,5 +1,6 @@
-# mbrtowc.m4 serial 44 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
+# mbrtowc.m4
+# serial 44
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/mbstate_t.m4
b/tp/Texinfo/XS/gnulib/m4/mbstate_t.m4
index dcd66b9613..66d65cd7c1 100644
--- a/tp/Texinfo/XS/gnulib/m4/mbstate_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/mbstate_t.m4
@@ -1,5 +1,6 @@
-# mbstate_t.m4 serial 14
-dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc.
+# mbstate_t.m4
+# serial 14
+dnl Copyright (C) 2000-2002, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/memchr.m4
b/tp/Texinfo/XS/gnulib/m4/memchr.m4
index 1523f19e09..31ff2dacff 100644
--- a/tp/Texinfo/XS/gnulib/m4/memchr.m4
+++ b/tp/Texinfo/XS/gnulib/m4/memchr.m4
@@ -1,5 +1,6 @@
-# memchr.m4 serial 19
-dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc.
+# memchr.m4
+# serial 20
+dnl Copyright (C) 2002-2004, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -48,7 +49,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
if (fd >= 0)
# endif
{
- int pagesize = getpagesize ();
+ long int pagesize = sysconf (_SC_PAGESIZE);
char *two_pages =
(char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
flags, fd, 0);
diff --git a/tp/Texinfo/XS/gnulib/m4/mmap-anon.m4
b/tp/Texinfo/XS/gnulib/m4/mmap-anon.m4
index d07d26e49e..61ca0120da 100644
--- a/tp/Texinfo/XS/gnulib/m4/mmap-anon.m4
+++ b/tp/Texinfo/XS/gnulib/m4/mmap-anon.m4
@@ -1,5 +1,6 @@
-# mmap-anon.m4 serial 12
-dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+# mmap-anon.m4
+# serial 12
+dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/multiarch.m4
b/tp/Texinfo/XS/gnulib/m4/multiarch.m4
index 3ba5b0f76c..3af29d39a0 100644
--- a/tp/Texinfo/XS/gnulib/m4/multiarch.m4
+++ b/tp/Texinfo/XS/gnulib/m4/multiarch.m4
@@ -1,5 +1,6 @@
-# multiarch.m4 serial 9
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# multiarch.m4
+# serial 9
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/musl.m4 b/tp/Texinfo/XS/gnulib/m4/musl.m4
index e28a3fed67..0d4de8926a 100644
--- a/tp/Texinfo/XS/gnulib/m4/musl.m4
+++ b/tp/Texinfo/XS/gnulib/m4/musl.m4
@@ -1,5 +1,6 @@
-# musl.m4 serial 4
-dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+# musl.m4
+# serial 4
+dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/obstack.m4
b/tp/Texinfo/XS/gnulib/m4/obstack.m4
index ef70a52093..bfab293f7a 100644
--- a/tp/Texinfo/XS/gnulib/m4/obstack.m4
+++ b/tp/Texinfo/XS/gnulib/m4/obstack.m4
@@ -1,33 +1,71 @@
-# See if we need to provide obstacks.
-
-dnl Copyright 1996-2023 Free Software Foundation, Inc.
+# obstack.m4
+# serial 1
+dnl Copyright 1996-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# See if we need to provide obstacks.
+
dnl Autoconf's AC_FUNC_OBSTACK is marked obsolete since version 2.70.
dnl We provide our own macro here.
AC_DEFUN([gl_FUNC_OBSTACK],
[
- AC_CACHE_CHECK([for obstacks that work with any size object],
- [gl_cv_func_obstack],
- [AC_LINK_IFELSE(
+ AC_CHECK_HEADERS_ONCE([obstack.h])
+ if test $ac_cv_header_obstack_h = yes; then
+ HAVE_OBSTACK=1
+ AC_CACHE_CHECK([for obstacks that work with any size object],
+ [gl_cv_func_obstack],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include "obstack.h"
+ void *obstack_chunk_alloc (size_t n) { return 0; }
+ void obstack_chunk_free (void *p) { }
+ /* Check that an internal function returns size_t, not int. */
+ size_t _obstack_memory_used (struct obstack *);
+ ]],
+ [[struct obstack mem;
+ obstack_init (&mem);
+ obstack_free (&mem, 0);
+ ]])],
+ [gl_cv_func_obstack=yes],
+ [gl_cv_func_obstack=no])
+ ])
+ if test $gl_cv_func_obstack = yes; then
+ REPLACE_OBSTACK=0
+ else
+ REPLACE_OBSTACK=1
+ fi
+ else
+ HAVE_OBSTACK=0
+ REPLACE_OBSTACK=0
+ fi
+ if test $HAVE_OBSTACK = 0 || test $REPLACE_OBSTACK = 1; then
+ GL_GENERATE_OBSTACK_H=true
+ else
+ GL_GENERATE_OBSTACK_H=false
+ fi
+ AC_SUBST([REPLACE_OBSTACK])
+
+ dnl Test whether a 'ptrdiff_t' has at least as many bits as a pointer.
+ AC_CACHE_CHECK([whether ptrdiff_t is at least as large as a pointer],
+ [gl_cv_ptrdiff_t_wide_enough],
+ [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[#include "obstack.h"
- void *obstack_chunk_alloc (size_t n) { return 0; }
- void obstack_chunk_free (void *p) { }
- /* Check that an internal function returns size_t, not int. */
- size_t _obstack_memory_used (struct obstack *);
+ [[#include <stddef.h>
+ typedef int check[2 * (sizeof (ptrdiff_t) >= sizeof (void *)) - 1];
]],
- [[struct obstack mem;
- obstack_init (&mem);
- obstack_free (&mem, 0);
- ]])],
- [gl_cv_func_obstack=yes],
- [gl_cv_func_obstack=no])])
- if test "$gl_cv_func_obstack" = yes; then
- AC_DEFINE([HAVE_OBSTACK], 1,
- [Define to 1 if the system has obstacks that work with any size object.])
+ [[]])],
+ [gl_cv_ptrdiff_t_wide_enough=yes],
+ [gl_cv_ptrdiff_t_wide_enough=no])
+ ])
+ if test $gl_cv_ptrdiff_t_wide_enough = yes; then
+ SMALL_PTRDIFF_T=0
+ else
+ SMALL_PTRDIFF_T=1
fi
+ dnl SMALL_PTRDIFF_T is expected to be 1 only on old / exotic platforms
+ dnl such as Windows 3.1 and AS/400.
+ AC_SUBST([SMALL_PTRDIFF_T])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/off64_t.m4
b/tp/Texinfo/XS/gnulib/m4/off64_t.m4
new file mode 100644
index 0000000000..34fa21eb16
--- /dev/null
+++ b/tp/Texinfo/XS/gnulib/m4/off64_t.m4
@@ -0,0 +1,31 @@
+# off64_t.m4
+# serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether <sys/types.h> defines the 'off64_t' type.
+dnl Set HAVE_OFF64_T.
+
+AC_DEFUN([gl_TYPE_OFF64_T],
+[
+ dnl Persuade glibc <sys/types.h>, <stdio.h>, <fcntl.h>, <unistd.h>, <aio.h>
+ dnl to define off64_t.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CACHE_CHECK([for off64_t], [gl_cv_off64_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[int x = sizeof (off64_t *) + sizeof (off64_t);
+ return !x;]])],
+ [gl_cv_off64_t=yes], [gl_cv_off64_t=no])])
+
+ if test $gl_cv_off64_t != no; then
+ HAVE_OFF64_T=1
+ else
+ HAVE_OFF64_T=0
+ fi
+ AC_SUBST([HAVE_OFF64_T])
+])
diff --git a/tp/Texinfo/XS/gnulib/m4/off_t.m4 b/tp/Texinfo/XS/gnulib/m4/off_t.m4
index 880f347250..db6035dbeb 100644
--- a/tp/Texinfo/XS/gnulib/m4/off_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/off_t.m4
@@ -1,5 +1,6 @@
-# off_t.m4 serial 1
-dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
+# off_t.m4
+# serial 1
+dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/pid_t.m4 b/tp/Texinfo/XS/gnulib/m4/pid_t.m4
index 0fd7d0a181..8bedcc6bcd 100644
--- a/tp/Texinfo/XS/gnulib/m4/pid_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/pid_t.m4
@@ -1,5 +1,6 @@
-# pid_t.m4 serial 4
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# pid_t.m4
+# serial 4
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/printf.m4
b/tp/Texinfo/XS/gnulib/m4/printf.m4
index 3be48277a6..a6daa1a62c 100644
--- a/tp/Texinfo/XS/gnulib/m4/printf.m4
+++ b/tp/Texinfo/XS/gnulib/m4/printf.m4
@@ -1,5 +1,6 @@
-# printf.m4 serial 85
-dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+# printf.m4
+# serial 95
+dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -86,7 +87,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_sizes_c99="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_sizes_c99="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -230,7 +230,6 @@ int main ()
# Guess yes on Android.
linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_long_double="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_long_double="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -358,7 +357,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_infinite="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_infinite="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_infinite="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -574,7 +572,6 @@ changequote(,)dnl
linux*-android*)
gl_cv_func_printf_infinite_long_double="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*)
gl_cv_func_printf_infinite_long_double="guessing no" ;;
windows*-msvc*)
gl_cv_func_printf_infinite_long_double="guessing yes" ;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -619,6 +616,7 @@ static double zero = 0.0;
int main ()
{
int result = 0;
+ /* This fails on FreeBSD 5.2.1, Solaris 11.4. */
if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.922p+1 33") != 0
&& strcmp (buf, "0x3.244p+0 33") != 0
@@ -630,27 +628,29 @@ int main ()
&& strcmp (buf, "-0X3.244P+0 33") != 0
&& strcmp (buf, "-0X6.488P-1 33") != 0
&& strcmp (buf, "-0XC.91P-2 33") != 0))
- result |= 2;
- /* This catches a FreeBSD 13.0 bug: it doesn't round. */
+ result |= 1;
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4, NetBSD 10.0 bug:
+ it doesn't round. */
if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.83p+0 33") != 0
&& strcmp (buf, "0x3.05p-1 33") != 0
&& strcmp (buf, "0x6.0ap-2 33") != 0
&& strcmp (buf, "0xc.14p-3 33") != 0))
- result |= 4;
- /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
+ result |= 2;
+ /* This catches a macOS 14 (Darwin 23), FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+ Solaris 11.4 bug: it doesn't round. */
if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x2p+0 33") != 0
&& strcmp (buf, "0x3p-1 33") != 0
&& strcmp (buf, "0x6p-2 33") != 0
&& strcmp (buf, "0xcp-3 33") != 0))
result |= 4;
- /* This catches a FreeBSD 6.1 bug. See
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4 bug. See
<https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
- /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9), FreeBSD 6.4 bug. */
if (sprintf (buf, "%.1a", 1.999) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
@@ -658,7 +658,8 @@ int main ()
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
/* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
- glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>
+ and a FreeBSD 6.4, NetBSD 10.0 bug. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
@@ -865,7 +866,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_printf_directive_f="guessing no" ;;
windows*-msvc*) gl_cv_func_printf_directive_f="guessing yes"
;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -895,10 +895,16 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#ifdef _MSC_VER
+#include <crtdbg.h>
#include <inttypes.h>
/* See page about "Parameter Validation" on msdn.microsoft.com.
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
@@ -912,6 +918,12 @@ invalid_parameter_handler (const wchar_t *expression,
exit (1);
}
#endif
+static void
+abort_handler (int sig)
+{
+ (void) sig;
+ _exit (1);
+}
static char fmtstring[10];
static char buf[100];
int main ()
@@ -919,7 +931,11 @@ int main ()
int count = -1;
#ifdef _MSC_VER
_set_invalid_parameter_handler (invalid_parameter_handler);
+ /* Also avoid an Abort/Retry/Ignore dialog in debug builds.
+
<https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode>
*/
+ _CrtSetReportMode (_CRT_ASSERT, 0);
#endif
+ signal (SIGABRT, abort_handler);
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
support %n in format strings in read-only memory but not in writable
memory. */
@@ -1037,7 +1053,8 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports the %lc format
dnl directive and in particular, when the argument is a null wide character,
-dnl whether the functions don't produce a NUL byte.
+dnl whether the functions produce a NUL byte, as specified in ISO C 23
+dnl after the issue GB-141 was fixed.
dnl Result is gl_cv_func_printf_directive_lc.
AC_DEFUN([gl_PRINTF_DIRECTIVE_LC],
@@ -1056,13 +1073,11 @@ int main ()
{
int result = 0;
char buf[100];
- /* This test fails on glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
- macOS 12.5, AIX 7.2, Solaris 11.4.
- glibc 2.35 bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=30257>
*/
+ /* This test fails on musl libc 1.2.4. */
{
buf[0] = '\0';
if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0
- || strcmp (buf, "az") != 0)
+ || memcmp (buf, "a\0z", 4) != 0)
result |= 1;
}
return result;
@@ -1072,10 +1087,10 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on musl libc.
- *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing yes";;
- # Guess no otherwise.
- *) gl_cv_func_printf_directive_lc="guessing no";;
+ # Guess no on musl libc.
+ *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_printf_directive_lc="guessing yes";;
esac
changequote([,])dnl
])
@@ -1265,6 +1280,50 @@ changequote([,])dnl
])
])
+dnl Test whether the *printf family of functions supports the # flag with a
+dnl zero precision and a zero value in the 'x' and 'X' directives correctly.
+dnl ISO C and POSIX specify that for the 'd', 'i', 'b', 'o', 'u', 'x', 'X'
+dnl directives: "The result of converting a zero value with a precision of
+dnl zero is no characters." But on Mac OS X 10.5, for the 'x', 'X' directives,
+dnl when a # flag is present, the output is "0" instead of "".
+dnl Result is gl_cv_func_printf_flag_alt_precision_zero.
+
+AC_DEFUN([gl_PRINTF_FLAG_ALT_PRECISION_ZERO],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the alternative flag with a zero
precision],
+ [gl_cv_func_printf_flag_alt_precision_zero],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+static char buf[10];
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%#.0x %d", 0, 33, 44) > 0 + 3)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_printf_flag_alt_precision_zero=yes],
+ [gl_cv_func_printf_flag_alt_precision_zero=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no only on macOS 10..12 systems.
+ darwin[0-9] | darwin[0-9].* | \
+ darwin1[0-9] | darwin1[0-9].* | \
+ darwin2[0-1] | darwin2[0-1].*)
+ gl_cv_func_printf_flag_alt_precision_zero="guessing no" ;;
+ darwin*) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
+ *) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
dnl Test whether the *printf family of functions supports large precisions.
dnl On mingw, precisions larger than 512 are treated like 512, in integer,
dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
@@ -1629,7 +1688,6 @@ changequote(,)dnl
linux*-android*) gl_cv_func_snprintf_retval_c99="guessing
yes";;
changequote([,])dnl
# Guess yes on MSVC, no on mingw.
- windows*-gnu*) gl_cv_func_snprintf_retval_c99="guessing no"
;;
windows*-msvc*) gl_cv_func_snprintf_retval_c99="guessing yes"
;;
mingw* | windows*) AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
@@ -1660,8 +1718,14 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <signal.h>
#include <stdio.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#if HAVE_SNPRINTF
# define my_snprintf snprintf
#else
@@ -1676,11 +1740,18 @@ static int my_snprintf (char *buf, int size, const char
*format, ...)
return ret;
}
#endif
+static void
+abort_handler (int sig)
+{
+ (void) sig;
+ _exit (1);
+}
static char fmtstring[10];
static char buf[100];
int main ()
{
int count = -1;
+ signal (SIGABRT, abort_handler);
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
support %n in format strings in read-only memory but not in writable
memory. */
@@ -1986,7 +2057,7 @@ static wchar_t buf[100];
int main ()
{
int result = 0;
- /* This catches a glibc 2.15 and Haiku 2022 bug. */
+ /* This catches a glibc 2.15, Haiku 2022, NetBSD 10.0 bug. */
if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
L"%La %d", 3.1416015625L, 33, 44, 55) < 0
|| (wcscmp (buf, L"0x1.922p+1 33") != 0
@@ -2016,6 +2087,8 @@ int main ()
*-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing
yes";;
# Guess yes on Android.
linux*-android*) gl_cv_func_swprintf_directive_la="guessing
yes";;
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_swprintf_directive_la="guessing no";;
# Guess no on native Windows.
mingw* | windows*) gl_cv_func_swprintf_directive_la="guessing no";;
# If we don't know, obey --enable-cross-guesses.
@@ -2089,17 +2162,18 @@ dnl 13 = gl_PRINTF_POSITIONS
dnl 14 = gl_PRINTF_FLAG_GROUPING
dnl 15 = gl_PRINTF_FLAG_LEFTADJUST
dnl 16 = gl_PRINTF_FLAG_ZERO
-dnl 17 = gl_PRINTF_PRECISION
-dnl 18 = gl_PRINTF_ENOMEM
-dnl 19 = gl_SNPRINTF_PRESENCE
-dnl 20 = gl_SNPRINTF_TRUNCATION_C99
-dnl 21 = gl_SNPRINTF_RETVAL_C99
-dnl 22 = gl_SNPRINTF_DIRECTIVE_N
-dnl 23 = gl_SNPRINTF_SIZE1
-dnl 24 = gl_VSNPRINTF_ZEROSIZE_C99
-dnl 25 = gl_SWPRINTF_WORKS
-dnl 26 = gl_SWPRINTF_DIRECTIVE_LA
-dnl 27 = gl_SWPRINTF_DIRECTIVE_LC
+dnl 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO
+dnl 18 = gl_PRINTF_PRECISION
+dnl 19 = gl_PRINTF_ENOMEM
+dnl 20 = gl_SNPRINTF_PRESENCE
+dnl 21 = gl_SNPRINTF_TRUNCATION_C99
+dnl 22 = gl_SNPRINTF_RETVAL_C99
+dnl 23 = gl_SNPRINTF_DIRECTIVE_N
+dnl 24 = gl_SNPRINTF_SIZE1
+dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl 26 = gl_SWPRINTF_WORKS
+dnl 27 = gl_SWPRINTF_DIRECTIVE_LA
+dnl 28 = gl_SWPRINTF_DIRECTIVE_LC
dnl
dnl 1 = checking whether printf supports size specifiers as in C99...
dnl 2 = checking whether printf supports size specifiers as in C23...
@@ -2117,58 +2191,60 @@ dnl 13 = checking whether printf supports POSIX/XSI
format strings with position
dnl 14 = checking whether printf supports the grouping flag...
dnl 15 = checking whether printf supports the left-adjust flag correctly...
dnl 16 = checking whether printf supports the zero flag correctly...
-dnl 17 = checking whether printf supports large precisions...
-dnl 18 = checking whether printf survives out-of-memory conditions...
-dnl 19 = checking for snprintf...
-dnl 20 = checking whether snprintf truncates the result as in C99...
-dnl 21 = checking whether snprintf returns a byte count as in C99...
-dnl 22 = checking whether snprintf fully supports the 'n' directive...
-dnl 23 = checking whether snprintf respects a size of 1...
-dnl 24 = checking whether vsnprintf respects a zero size as in C99...
-dnl 25 = checking whether swprintf works...
-dnl 26 = checking whether swprintf supports the 'La' and 'LA' directives...
-dnl 27 = checking whether swprintf supports the 'lc' directive...
+dnl 17 = checking whether printf supports the alternative flag with a zero
precision...
+dnl 18 = checking whether printf supports large precisions...
+dnl 19 = checking whether printf survives out-of-memory conditions...
+dnl 20 = checking for snprintf...
+dnl 21 = checking whether snprintf truncates the result as in C99...
+dnl 22 = checking whether snprintf returns a byte count as in C99...
+dnl 23 = checking whether snprintf fully supports the 'n' directive...
+dnl 24 = checking whether snprintf respects a size of 1...
+dnl 25 = checking whether vsnprintf respects a zero size as in C99...
+dnl 26 = checking whether swprintf works...
+dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives...
+dnl 28 = checking whether swprintf supports the 'lc' directive...
dnl
dnl . = yes, # = no.
dnl
-dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27
-dnl musl libc 1.2.3 . # . . . . # # . . . . . .
. . . . . . . . . . # . #
-dnl glibc 2.35 . # . . . . . . . . . # . .
. . . . . . . . . . . . .
-dnl glibc 2.5 . # . . . . # # . . . # . .
. . . . . . . . . . . # .
-dnl glibc 2.3.6 . # . . . # # # . . . # . .
. . . . . . . . . . . # .
-dnl FreeBSD 13.0 . # . . . # # # . . . # . .
. . . # . . . . . . # . #
-dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl Mac OS X 10.13.5 . # . . # # # # . # . # . .
. . . . . . . # . . # ? ?
-dnl Mac OS X 10.5.8 . # . . # # # # . . . # . .
. # . . . . . . . . # ? ?
-dnl Mac OS X 10.3.9 . # . . . # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . .
. . . # . . . . . . # . #
-dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . #
. # . # . . . . . . # ? ?
-dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . .
. . . ? . . . . . . ? ? ?
-dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . .
. . . # . . . . . . ? ? ?
-dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . #
. # # # . . . . . . ? ? ?
-dnl Solaris 11.4 . # . # # # # # . . # # . .
. # . . . . . . . . . # .
-dnl Solaris 11.3 . # . . . # # # . . # # . .
. . . . . . . . . . . # .
-dnl Solaris 11.0 . # . # # # # # . . # # . .
. # . . . . . . . . ? ? ?
-dnl Solaris 10 . # . # # # # # . . # # . .
. # # . . . . . . . . # .
-dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . .
. # # . . . # . . . ? ? ?
-dnl Solaris 2.5.1 # # . # # # # # # . # # . .
. # . . # # # # # # ? ? ?
-dnl AIX 7.1 . # . # # # # # . . . # . .
. # # . . . . . . . # . .
-dnl AIX 5.2 . # . # # # # # . . . # . .
. # . . . . . . . . # ? ?
-dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . .
. # . . . . # . . . # ? ?
-dnl HP-UX 11.31 . # . . . # # # . . . ? . .
. # . . . . # # . . ? ? ?
-dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . .
. # . . . . # # . # ? ? ?
-dnl HP-UX 10.20 # # . # . # # # # . ? ? . .
# # . . . . # # ? # ? ? ?
-dnl IRIX 6.5 # # . # # # # # # . # # . .
. # . . . . # . . . # ? ?
-dnl OSF/1 5.1 # # . # # # # # # . . ? . .
. # . . . . # . . # ? ? ?
-dnl OSF/1 4.0d # # . # # # # # # . . ? . .
. # . . # # # # # # ? ? ?
-dnl NetBSD 9.0 . # . . . # # # . . . # . .
. . . . . . . . . . # . #
-dnl NetBSD 5.0 . # . . # # # # . . . # . .
. # . # . . . . . . # ? ?
-dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ?
? ? ? ? . . . ? ? ? # ? ?
-dnl NetBSD 3.0 . # . . . # # # # . ? # # #
? # . # . . . . . . # ? ?
-dnl Haiku . # . . # # # # # . # ? . .
. . . ? . . ? . . . . # .
-dnl BeOS # # # . # # # # # . ? ? # .
? . # ? . . ? . . . ? ? ?
-dnl Android 4.3 . # . # # # # # # # # ? . #
. # . # . . . # . . ? ? ?
-dnl old mingw / msvcrt # # # # # # # # # . . ? # #
. # # ? . # # # . . # ? ?
-dnl MSVC 9 # # # # # # # # # # . ? # #
. # # ? # # # # . . # ? ?
-dnl mingw 2009-2011 . # # . # . # # . . . ? # #
. . . ? . . . . . . # ? ?
-dnl mingw-w64 2011 # # # # # # # # # . . ? # #
. # # ? . # # # . . # ? ?
+dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28
+dnl musl libc 1.2.3 . # . . . . # # . . . # . .
. . ? . . . . . . . . # . #
+dnl glibc 2.35 . # . . . . . . . . . . . .
. . . . . . . . . . . . . .
+dnl glibc 2.5 . # . . . . # # . . . . . .
. . . . . . . . . . . . # .
+dnl glibc 2.3.6 . # . . . # # # . . . . . .
. . . . . . . . . . . . # .
+dnl FreeBSD 14.0 . . . . . # . . . . . . . .
. . . . # . . . . . . # . #
+dnl FreeBSD 13.0 . # . . . # # # . . . . . .
. . . . # . . . . . . # . #
+dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . .
. # ? . # . . . . . . # ? ?
+dnl Mac OS X 10.13.5 . # . . # # # # . # . . . .
. . . . . . . . # . . # ? ?
+dnl Mac OS X 10.5.8 . # . . # # # # . . . . . .
. # # . . . . . . . . # ? ?
+dnl Mac OS X 10.3.9 . # . . . # # # . . . . . .
. # # . # . . . . . . # ? ?
+dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . .
. . . . # . . . . . . # . #
+dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . #
. # ? . # . . . . . . # ? ?
+dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . .
. . ? . ? . . . . . . ? ? ?
+dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . .
. . ? . # . . . . . . ? ? ?
+dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . #
. # ? # # . . . . . . ? ? ?
+dnl Solaris 11.4 . # . # # # # # . . # . . .
. # . . . . . . . . . . # .
+dnl Solaris 11.3 . # . . . # # # . . # . . .
. . . . . . . . . . . . # .
+dnl Solaris 11.0 . # . # # # # # . . # . . .
. # . . . . . . . . . ? ? ?
+dnl Solaris 10 . # . # # # # # . . # . . .
. # . # . . . . . . . . # .
+dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . .
. # ? # . . . # . . . ? ? ?
+dnl Solaris 2.5.1 # # . # # # # # # . # . . .
. # ? . . # # # # # # ? ? ?
+dnl AIX 7.1 . # . # # # # # . . . . . .
. # . # . . . . . . . # . .
+dnl AIX 5.2 . # . # # # # # . . . . . .
. # ? . . . . . . . . # ? ?
+dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . .
. # ? . . . . # . . . # ? ?
+dnl HP-UX 11.31 . # . . . # # # . . . ? . .
. # ? . . . . # # . . ? ? ?
+dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . .
. # ? . . . . # # . # ? ? ?
+dnl HP-UX 10.20 # # . # . # # # # . ? ? . .
# # ? . . . . # # ? # ? ? ?
+dnl IRIX 6.5 # # . # # # # # # . # . . .
. # ? . . . . # . . . # ? ?
+dnl OSF/1 5.1 # # . # # # # # # . . ? . .
. # ? . . . . # . . # ? ? ?
+dnl OSF/1 4.0d # # . # # # # # # . . ? . .
. # ? . . # # # # # # ? ? ?
+dnl NetBSD 9.0 . # . . . # # # . . . . . .
. . . . . . . . . . . # . #
+dnl NetBSD 5.0 . # . . # # # # . . . . . .
. # ? . # . . . . . . # ? ?
+dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ?
? ? ? ? ? . . . ? ? ? # ? ?
+dnl NetBSD 3.0 . # . . . # # # # . ? . # #
? # ? . # . . . . . . # ? ?
+dnl Haiku . # . . # # # # # . # ? . .
. . ? . ? . . ? . . . . # .
+dnl BeOS # # # . # # # # # . ? ? # .
? . ? # ? . . ? . . . ? ? ?
+dnl Android 4.3 . # . # # # # # # # # ? . #
. # ? . # . . . # . . ? ? ?
+dnl old mingw / msvcrt # # # # # # # # # . . ? # #
. # ? # ? . # # # . . # ? ?
+dnl MSVC 9 # # # # # # # # # # . ? # #
. # ? # ? # # # # . . # ? ?
+dnl mingw 2009-2011 . # # . # . # # . . . ? # #
. . ? . ? . . . . . . # ? ?
+dnl mingw-w64 2011 # # # # # # # # # . . ? # #
. # ? # ? . # # # . . # ? ?
diff --git a/tp/Texinfo/XS/gnulib/m4/rawmemchr.m4
b/tp/Texinfo/XS/gnulib/m4/rawmemchr.m4
index a48d829526..6e0fa0a55e 100644
--- a/tp/Texinfo/XS/gnulib/m4/rawmemchr.m4
+++ b/tp/Texinfo/XS/gnulib/m4/rawmemchr.m4
@@ -1,5 +1,6 @@
-# rawmemchr.m4 serial 3
-dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+# rawmemchr.m4
+# serial 3
+dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/size_max.m4
b/tp/Texinfo/XS/gnulib/m4/size_max.m4
index 0763366dfc..df91cf0629 100644
--- a/tp/Texinfo/XS/gnulib/m4/size_max.m4
+++ b/tp/Texinfo/XS/gnulib/m4/size_max.m4
@@ -1,5 +1,6 @@
-# size_max.m4 serial 12
-dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc.
+# size_max.m4
+# serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/ssize_t.m4
b/tp/Texinfo/XS/gnulib/m4/ssize_t.m4
index 52bd77d2ae..c15f948adb 100644
--- a/tp/Texinfo/XS/gnulib/m4/ssize_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/ssize_t.m4
@@ -1,5 +1,6 @@
-# ssize_t.m4 serial 6
-dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc.
+# ssize_t.m4
+# serial 6
+dnl Copyright (C) 2001-2003, 2006, 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/std-gnu11.m4
b/tp/Texinfo/XS/gnulib/m4/std-gnu11.m4
index 4179470ec9..e8d5de7a1e 100644
--- a/tp/Texinfo/XS/gnulib/m4/std-gnu11.m4
+++ b/tp/Texinfo/XS/gnulib/m4/std-gnu11.m4
@@ -1,5 +1,11 @@
+# std-gnu11.m4
+# serial 2
+
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
+# The std-gnu23 module, which defines _AC_C_C23_OPTIONS, supersedes us.
+m4_ifndef([_AC_C_C23_OPTIONS], [
+
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
# commit 017d5ddd82854911f0119691d91ea8a1438824d6
# dated Sun Apr 3 13:57:17 2016 -0700
@@ -9,7 +15,7 @@
m4_version_prereq([2.70], [], [
-# Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,7 +41,7 @@ m4_version_prereq([2.70], [], [
# COMPILER ... is a space separated list of C compilers to search for.
# This just gives the user an opportunity to specify an alternative
# search list for the C compiler.
-AC_DEFUN_ONCE([AC_PROG_CC],
+AC_DEFUN([AC_PROG_CC],
[AC_LANG_PUSH(C)dnl
AC_ARG_VAR([CC], [C compiler command])dnl
AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
@@ -827,3 +833,4 @@ dnl with extended modes being tried first.
])# m4_version_prereq
+])# !_AC_C_C23_OPTIONS
diff --git a/tp/Texinfo/XS/gnulib/m4/stdalign.m4
b/tp/Texinfo/XS/gnulib/m4/stdalign.m4
index 5880efb2eb..1c29d1e4fb 100644
--- a/tp/Texinfo/XS/gnulib/m4/stdalign.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stdalign.m4
@@ -1,10 +1,12 @@
-# Check for alignas and alignof that conform to C23.
-
-dnl Copyright 2011-2023 Free Software Foundation, Inc.
+# stdalign.m4
+# serial 1
+dnl Copyright 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# Check for alignas and alignof that conform to C23.
+
dnl Written by Paul Eggert and Bruno Haible.
# Prepare for substituting <stdalign.h> if it is not supported.
@@ -13,10 +15,10 @@ AC_DEFUN([gl_ALIGNASOF],
[
AC_CACHE_CHECK([for alignas and alignof],
[gl_cv_header_working_stdalign_h],
- [gl_save_CFLAGS=$CFLAGS
+ [gl_saved_CFLAGS=$CFLAGS
for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
AS_CASE([$gl_working],
- [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"])
+ [*stdalign.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_STDALIGN_H"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdint.h>
@@ -56,7 +58,7 @@ AC_DEFUN([gl_ALIGNASOF],
[gl_cv_header_working_stdalign_h=$gl_working],
[gl_cv_header_working_stdalign_h=no])
- CFLAGS=$gl_save_CFLAGS
+ CFLAGS=$gl_saved_CFLAGS
test "$gl_cv_header_working_stdalign_h" != no && break
done])
@@ -79,7 +81,7 @@ AC_DEFUN([gl_ALIGNASOF],
References:
ISO C23 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>)
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf>)
sections 6.5.3.4, 6.7.5, 7.15.
C++11 (latest free draft
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
diff --git a/tp/Texinfo/XS/gnulib/m4/stddef_h.m4
b/tp/Texinfo/XS/gnulib/m4/stddef_h.m4
index aa012219fc..c7f75b37fa 100644
--- a/tp/Texinfo/XS/gnulib/m4/stddef_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stddef_h.m4
@@ -1,5 +1,6 @@
-# stddef_h.m4 serial 14
-dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+# stddef_h.m4
+# serial 17
+dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +10,6 @@ dnl A placeholder for <stddef.h>, for platforms that have
issues.
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -51,11 +51,6 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
- if test $gt_cv_c_wchar_t = no; then
- HAVE_WCHAR_T=0
- GL_GENERATE_STDDEF_H=true
- fi
-
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
[gl_cv_decl_null_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -83,6 +78,36 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
+ dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
+ AC_CACHE_CHECK([whether nullptr_t needs <stddef.h>],
+ [gl_cv_nullptr_t_needs_stddef],
+ [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]],
+ [gl_cv_nullptr_t_needs_stddef=no],
+ [gl_cv_nullptr_t_needs_stddef=yes])])
+ if test "$gl_cv_nullptr_t_needs_stddef" = no; then
+ NULLPTR_T_NEEDS_STDDEF=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ AC_CACHE_CHECK([for clean definition of __STDC_VERSION_STDDEF_H__],
+ [gl_cv_clean_version_stddef],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE(
+ [[/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 */
+ #include <stddef.h>
+ #undef __STDC_VERSION_STDDEF_H__
+ #include <time.h>
+ #ifdef __STDC_VERSION_STDDEF_H__
+ # error "<time.h> defines __STDC_VERSION_STDDEF_H__"
+ #endif
+ ]])],
+ [gl_cv_clean_version_stddef=yes],
+ [gl_cv_clean_version_stddef=no])])
+ if test "$gl_cv_clean_version_stddef" = no; then
+ STDDEF_NOT_IDEMPOTENT=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
if $GL_GENERATE_STDDEF_H; then
gl_NEXT_HEADERS([stddef.h])
fi
@@ -113,7 +138,8 @@ AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
AC_DEFUN([gl_STDDEF_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
+ NULLPTR_T_NEEDS_STDDEF=1; AC_SUBST([NULLPTR_T_NEEDS_STDDEF])
+ STDDEF_NOT_IDEMPOTENT=0; AC_SUBST([STDDEF_NOT_IDEMPOTENT])
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
- HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/stdint.m4
b/tp/Texinfo/XS/gnulib/m4/stdint.m4
index d5ff08b1b8..2dea846914 100644
--- a/tp/Texinfo/XS/gnulib/m4/stdint.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stdint.m4
@@ -1,5 +1,6 @@
-# stdint.m4 serial 63
-dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
+# stdint.m4
+# serial 63
+dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/stdint_h.m4
b/tp/Texinfo/XS/gnulib/m4/stdint_h.m4
index 70349f6cb2..29f42160b0 100644
--- a/tp/Texinfo/XS/gnulib/m4/stdint_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stdint_h.m4
@@ -1,5 +1,6 @@
-# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+# stdint_h.m4
+# serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/stdio_h.m4
b/tp/Texinfo/XS/gnulib/m4/stdio_h.m4
index dbfa0d5d61..ec52ae92ff 100644
--- a/tp/Texinfo/XS/gnulib/m4/stdio_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stdio_h.m4
@@ -1,5 +1,6 @@
-# stdio_h.m4 serial 63
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# stdio_h.m4
+# serial 75
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -132,6 +133,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
@@ -152,12 +154,14 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_ZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN])
@@ -171,20 +175,29 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZPRINTF])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
diff --git a/tp/Texinfo/XS/gnulib/m4/stdlib_h.m4
b/tp/Texinfo/XS/gnulib/m4/stdlib_h.m4
index f47c1eb37b..332669f946 100644
--- a/tp/Texinfo/XS/gnulib/m4/stdlib_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/stdlib_h.m4
@@ -1,5 +1,6 @@
-# stdlib_h.m4 serial 75
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# stdlib_h.m4
+# serial 79
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -109,6 +110,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ABORT_DEBUG])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU])
@@ -134,6 +136,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
@@ -143,7 +146,9 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STACK_TRACE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
@@ -204,6 +209,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF])
HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL])
HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
@@ -214,6 +220,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT])
+ REPLACE_ABORT=0; AC_SUBST([REPLACE_ABORT])
REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
REPLACE_CALLOC_FOR_CALLOC_POSIX=0;
AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
@@ -237,6 +244,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
+ REPLACE_RAND=0; AC_SUBST([REPLACE_RAND])
REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
REPLACE_REALLOC_FOR_REALLOC_GNU=0;
AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU])
@@ -246,6 +254,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF])
REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL])
REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL])
@@ -253,4 +262,5 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
+ CAN_PRINT_STACK_TRACE=0; AC_SUBST([CAN_PRINT_STACK_TRACE])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/strchrnul.m4
b/tp/Texinfo/XS/gnulib/m4/strchrnul.m4
index 9b9ab11ada..3712476e58 100644
--- a/tp/Texinfo/XS/gnulib/m4/strchrnul.m4
+++ b/tp/Texinfo/XS/gnulib/m4/strchrnul.m4
@@ -1,5 +1,6 @@
-# strchrnul.m4 serial 12
-dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
+# strchrnul.m4
+# serial 12
+dnl Copyright (C) 2003, 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/string_h.m4
b/tp/Texinfo/XS/gnulib/m4/string_h.m4
index 7f51391cbf..f31264ae85 100644
--- a/tp/Texinfo/XS/gnulib/m4/string_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/string_h.m4
@@ -1,11 +1,11 @@
-# Configure a GNU-like replacement for <string.h>.
-
-# Copyright (C) 2007-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# string_h.m4
+# serial 39
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# serial 37
+# Configure a GNU-like replacement for <string.h>.
# Written by Paul Eggert.
@@ -132,6 +132,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
+ REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT])
REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
@@ -146,5 +147,6 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP])
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/strndup.m4
b/tp/Texinfo/XS/gnulib/m4/strndup.m4
index 9ec9715c79..7a2c5860b8 100644
--- a/tp/Texinfo/XS/gnulib/m4/strndup.m4
+++ b/tp/Texinfo/XS/gnulib/m4/strndup.m4
@@ -1,5 +1,6 @@
-# strndup.m4 serial 23
-dnl Copyright (C) 2002-2003, 2005-2023 Free Software Foundation, Inc.
+# strndup.m4
+# serial 23
+dnl Copyright (C) 2002-2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/strnlen.m4
b/tp/Texinfo/XS/gnulib/m4/strnlen.m4
index d2cac59b6f..83a75c0c32 100644
--- a/tp/Texinfo/XS/gnulib/m4/strnlen.m4
+++ b/tp/Texinfo/XS/gnulib/m4/strnlen.m4
@@ -1,10 +1,60 @@
-# strnlen.m4 serial 14
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
+# strnlen.m4
+# serial 15
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+m4_version_prereq([2.73], [], [
+# Replace AC_FUNC_STRNLEN from Autoconf 2.72 and earlier,
+# which does not check for Android strnlen bugs.
+
+AC_DEFUN([AC_FUNC_STRNLEN],
+[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
+AC_CACHE_CHECK([for working strnlen], [ac_cv_func_strnlen_working],
+[AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ [/* Use pstrnlen to test; 'volatile' prevents the compiler
+ from optimizing the strnlen calls away. */
+ size_t (*volatile pstrnlen) (char const *, size_t) = strnlen;
+ char const s[] = "foobar";
+ int s_len = sizeof s - 1;
+ ]],
+ [[
+ /* AIX 4.3 is buggy: strnlen (S, 1) == 3. */
+ int i;
+ for (i = 0; i < s_len + 1; ++i)
+ {
+ int expected = i <= s_len ? i : s_len;
+ if (pstrnlen (s, i) != expected)
+ return 1;
+ }
+
+ /* Android 5.0 (API 21) strnlen ("", SIZE_MAX) incorrectly crashes. */
+ if (pstrnlen ("", -1) != 0)
+ return 1;]])],
+ [ac_cv_func_strnlen_working=yes],
+ [ac_cv_func_strnlen_working=no],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+ [[#if defined _AIX && !defined _AIX51
+ #error "AIX pre 5.1 is buggy"
+ #endif
+ #ifdef __ANDROID__
+ #include <android/api-level.h>
+ #if __ANDROID_API__ < 22
+ #error "Android API < 22 is buggy"
+ #endif
+ #endif
+ ]])],
+ [ac_cv_func_strnlen_working=yes],
+ [ac_cv_func_strnlen_working=no])])])
+test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])
+])# AC_FUNC_STRNLEN
+])
+
AC_DEFUN([gl_FUNC_STRNLEN],
[
AC_REQUIRE([gl_STRING_H_DEFAULTS])
diff --git a/tp/Texinfo/XS/gnulib/m4/sys_types_h.m4
b/tp/Texinfo/XS/gnulib/m4/sys_types_h.m4
index 627671fbdf..7c7f265527 100644
--- a/tp/Texinfo/XS/gnulib/m4/sys_types_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/sys_types_h.m4
@@ -1,5 +1,6 @@
-# sys_types_h.m4 serial 13
-dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# sys_types_h.m4
+# serial 14
+dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -22,6 +23,9 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
dnl Whether to override the 'off_t' type.
AC_REQUIRE([gl_TYPE_OFF_T])
+ dnl Whether to define the 'off64_t' type.
+ AC_REQUIRE([gl_TYPE_OFF64_T])
+
dnl Whether to override the 'dev_t' and 'ino_t' types.
m4_ifdef([gl_WINDOWS_STAT_INODES], [
AC_REQUIRE([gl_WINDOWS_STAT_INODES])
diff --git a/tp/Texinfo/XS/gnulib/m4/unistd_h.m4
b/tp/Texinfo/XS/gnulib/m4/unistd_h.m4
index 1c96158155..04fa79c9ca 100644
--- a/tp/Texinfo/XS/gnulib/m4/unistd_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/unistd_h.m4
@@ -1,5 +1,6 @@
-# unistd_h.m4 serial 94
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# unistd_h.m4
+# serial 96
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -234,6 +235,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP])
REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
+ REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC])
REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
@@ -246,6 +248,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
REPLACE_GETPASS_FOR_GETPASS_GNU=0;
AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU])
+ REPLACE_GETUSERSHELL=0; AC_SUBST([REPLACE_GETUSERSHELL])
REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
diff --git a/tp/Texinfo/XS/gnulib/m4/vararrays.m4
b/tp/Texinfo/XS/gnulib/m4/vararrays.m4
index fd6230c296..9211f69d4d 100644
--- a/tp/Texinfo/XS/gnulib/m4/vararrays.m4
+++ b/tp/Texinfo/XS/gnulib/m4/vararrays.m4
@@ -1,13 +1,13 @@
-# Check for variable-length arrays.
-
+# vararrays.m4
# serial 6
+dnl Copyright (C) 2001, 2009-2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
-# From Paul Eggert
+# Check for variable-length arrays.
-# Copyright (C) 2001, 2009-2023 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# From Paul Eggert
m4_version_prereq([2.70], [], [
diff --git a/tp/Texinfo/XS/gnulib/m4/vasnprintf.m4
b/tp/Texinfo/XS/gnulib/m4/vasnprintf.m4
index df87b9e798..a02f4e1e1d 100644
--- a/tp/Texinfo/XS/gnulib/m4/vasnprintf.m4
+++ b/tp/Texinfo/XS/gnulib/m4/vasnprintf.m4
@@ -1,13 +1,46 @@
-# vasnprintf.m4 serial 50
-dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc.
+# vasnprintf.m4
+# serial 54
+dnl Copyright (C) 2002-2004, 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_VASNPRINTF],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([vasnprintf])
- if test $ac_cv_func_vasnprintf = no; then
+ if test $ac_cv_func_vasnprintf = yes; then
+ dnl On Cygwin, in directives with a huge width, the width is ignored, and
+ dnl the function returns a wrong result.
+ AC_CACHE_CHECK([whether vasnprintf works],
+ [gl_cv_func_vasnprintf_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <stdio.h>
+ ]],
+ [[size_t len;
+ char *res = vasnprintf (NULL, &len, "x%03000000000dy\n", -17);
+ /* On Cygwin 3.4.6, res is "x-17y\n" and len == 6: wrong. */
+ return (res != NULL && len < 10);
+ ]])
+ ],
+ [gl_cv_func_vasnprintf_works=yes],
+ [gl_cv_func_vasnprintf_works=no],
+ [case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_vasnprintf_works="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vasnprintf_works="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+ fi
+ if test $ac_cv_func_vasnprintf != yes \
+ || case "$gl_cv_func_vasnprintf_works" in
+ *yes) false;;
+ *) true;;
+ esac
+ then
gl_REPLACE_VASNPRINTF
fi
])
@@ -41,7 +74,6 @@ AC_DEFUN([gl_FUNC_VASNWPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
@@ -50,7 +82,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
@@ -94,6 +125,7 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
# Prerequisites of lib/vasnwprintf.c.
AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc])
AC_CHECK_DECLS([_snwprintf], , , [[#include <stdio.h>]])
AC_CHECK_DECLS([wcsnlen], , , [[#include <wchar.h>]])
@@ -183,7 +215,6 @@ int main()
AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS([wcslen])
dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
@@ -367,6 +398,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
esac
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the # flag with a
+# zero precision and a zero value in the 'x' and 'X' directives.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO])
+ case "$gl_cv_func_printf_flag_alt_precision_zero" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_ALT_PRECISION_ZERO], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ # flag with a zero precision and a zero value in the 'x' and 'X'
directives.])
+ ;;
+ esac
+])
+
# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
[
@@ -425,6 +472,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS],
gl_PREREQ_VASNPRINTF_FLAG_GROUPING
gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
gl_PREREQ_VASNPRINTF_FLAG_ZERO
+ gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO
gl_PREREQ_VASNPRINTF_PRECISION
gl_PREREQ_VASNPRINTF_ENOMEM
])
diff --git a/tp/Texinfo/XS/gnulib/m4/vasprintf.m4
b/tp/Texinfo/XS/gnulib/m4/vasprintf.m4
index 6e6156a754..73f7b8073d 100644
--- a/tp/Texinfo/XS/gnulib/m4/vasprintf.m4
+++ b/tp/Texinfo/XS/gnulib/m4/vasprintf.m4
@@ -1,5 +1,6 @@
-# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation,
+# vasprintf.m4
+# serial 6
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/tp/Texinfo/XS/gnulib/m4/warn-on-use.m4
b/tp/Texinfo/XS/gnulib/m4/warn-on-use.m4
index 10649c5cba..6c8c76b883 100644
--- a/tp/Texinfo/XS/gnulib/m4/warn-on-use.m4
+++ b/tp/Texinfo/XS/gnulib/m4/warn-on-use.m4
@@ -1,5 +1,6 @@
-# warn-on-use.m4 serial 10
-dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+# warn-on-use.m4
+# serial 11
+dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,7 +37,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead
dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
- ac_save_ac_compile="$ac_compile"
+ ac_saved_ac_compile="$ac_compile"
if test -n "$ac_compile_for_check_decl"; then
ac_compile="$ac_compile_for_check_decl"
fi
@@ -46,7 +47,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
[[#undef $gl_func
(void) $gl_func;]])],
[AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
- ac_compile="$ac_save_ac_compile"
+ ac_compile="$ac_saved_ac_compile"
AS_VAR_IF([gl_Symbol], [yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
dnl Shortcut for an AC_CHECK_DECL invocation that may come later:
diff --git a/tp/Texinfo/XS/gnulib/m4/wchar_h.m4
b/tp/Texinfo/XS/gnulib/m4/wchar_h.m4
index 31f5b0794d..995bdc659d 100644
--- a/tp/Texinfo/XS/gnulib/m4/wchar_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/wchar_h.m4
@@ -1,13 +1,13 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# wchar_h.m4
+# serial 64
+dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-dnl Written by Eric Blake.
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-# wchar_h.m4 serial 61
+dnl Written by Eric Blake.
AC_DEFUN_ONCE([gl_WCHAR_H],
[
@@ -86,8 +86,8 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
dnl z/OS when using the XPLINK object format (due to duplicate
dnl CSECT names). Instead, temporarily redefine $ac_compile so
dnl that the object file has the latter name from the start.
- save_ac_compile="$ac_compile"
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ saved_ac_compile="$ac_compile"
+ ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest1/`
if echo '#include "conftest.c"' >conftest1.c \
&& AC_TRY_EVAL([ac_compile]); then
AC_LANG_CONFTEST([
@@ -97,7 +97,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
int zero (void) { return 0; }
]])])
dnl See note above about renaming object files.
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest2/`
if echo '#include "conftest.c"' >conftest2.c \
&& AC_TRY_EVAL([ac_compile]); then
if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS
conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
@@ -107,7 +107,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
fi
fi
fi
- ac_compile="$save_ac_compile"
+ ac_compile="$saved_ac_compile"
rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
;;
esac
@@ -186,6 +186,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WGETCWD])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
])
diff --git a/tp/Texinfo/XS/gnulib/m4/wchar_t.m4
b/tp/Texinfo/XS/gnulib/m4/wchar_t.m4
deleted file mode 100644
index 50bde08aec..0000000000
--- a/tp/Texinfo/XS/gnulib/m4/wchar_t.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
- AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';]],
- [[]])],
- [gt_cv_c_wchar_t=yes],
- [gt_cv_c_wchar_t=no])])
- if test $gt_cv_c_wchar_t = yes; then
- AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
- fi
-])
diff --git a/tp/Texinfo/XS/gnulib/m4/wctype_h.m4
b/tp/Texinfo/XS/gnulib/m4/wctype_h.m4
index ac9c35b2da..a3b07c2a23 100644
--- a/tp/Texinfo/XS/gnulib/m4/wctype_h.m4
+++ b/tp/Texinfo/XS/gnulib/m4/wctype_h.m4
@@ -1,8 +1,9 @@
-# wctype_h.m4 serial 33
+# wctype_h.m4
+# serial 33
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/wcwidth.m4
b/tp/Texinfo/XS/gnulib/m4/wcwidth.m4
index e7829e98c8..f2fa198022 100644
--- a/tp/Texinfo/XS/gnulib/m4/wcwidth.m4
+++ b/tp/Texinfo/XS/gnulib/m4/wcwidth.m4
@@ -1,5 +1,6 @@
-# wcwidth.m4 serial 36
-dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+# wcwidth.m4
+# serial 38
+dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,7 +13,6 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_HEADERS_ONCE([wchar.h])
@@ -41,9 +41,9 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes;
then
HAVE_WCWIDTH=1
dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
- dnl On macOS 12.5, NetBSD 9.0, OpenBSD 5.0, MidnightBSD 1.1,
+ dnl On macOS 12.5, NetBSD 9.3, OpenBSD 5.0, MidnightBSD 1.1,
dnl wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.
- dnl On macOS 12.5, NetBSD 9.0, MidnightBSD 1.1, OSF/1 5.1,
+ dnl On macOS 12.5, NetBSD 9.3, MidnightBSD 1.1, OSF/1 5.1,
dnl wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0.
dnl This leads to bugs in 'ls' (coreutils).
diff --git a/tp/Texinfo/XS/gnulib/m4/wint_t.m4
b/tp/Texinfo/XS/gnulib/m4/wint_t.m4
index dfd743b3a6..883fac28ed 100644
--- a/tp/Texinfo/XS/gnulib/m4/wint_t.m4
+++ b/tp/Texinfo/XS/gnulib/m4/wint_t.m4
@@ -1,5 +1,6 @@
-# wint_t.m4 serial 11
-dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+# wint_t.m4
+# serial 11
+dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/xsize.m4 b/tp/Texinfo/XS/gnulib/m4/xsize.m4
index 649db9c5ea..e5784973e7 100644
--- a/tp/Texinfo/XS/gnulib/m4/xsize.m4
+++ b/tp/Texinfo/XS/gnulib/m4/xsize.m4
@@ -1,5 +1,6 @@
-# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc.
+# xsize.m4
+# serial 5
+dnl Copyright (C) 2003-2004, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/tp/Texinfo/XS/gnulib/m4/zzgnulib.m4
b/tp/Texinfo/XS/gnulib/m4/zzgnulib.m4
index 362102b606..710fba4e29 100644
--- a/tp/Texinfo/XS/gnulib/m4/zzgnulib.m4
+++ b/tp/Texinfo/XS/gnulib/m4/zzgnulib.m4
@@ -1,5 +1,6 @@
-# zzgnulib.m4 serial 1
-dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+# zzgnulib.m4
+# serial 1
+dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.