summaryrefslogtreecommitdiff
path: root/gl/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gl/lib')
-rw-r--r--gl/lib/Makefile.am360
-rw-r--r--gl/lib/Makefile.in1179
-rw-r--r--gl/lib/_Noreturn.h7
-rw-r--r--gl/lib/alloca.in.h2
-rw-r--r--gl/lib/arg-nonnull.h2
-rw-r--r--gl/lib/argp-ba.c2
-rw-r--r--gl/lib/argp-eexst.c2
-rw-r--r--gl/lib/argp-fmtstream.c2
-rw-r--r--gl/lib/argp-fmtstream.h11
-rw-r--r--gl/lib/argp-fs-xinl.c2
-rw-r--r--gl/lib/argp-help.c3
-rw-r--r--gl/lib/argp-namefrob.h2
-rw-r--r--gl/lib/argp-parse.c5
-rw-r--r--gl/lib/argp-pin.c2
-rw-r--r--gl/lib/argp-pv.c2
-rw-r--r--gl/lib/argp-pvh.c2
-rw-r--r--gl/lib/argp-xinl.c2
-rw-r--r--gl/lib/argp.h12
-rw-r--r--gl/lib/asnprintf.c2
-rw-r--r--gl/lib/asprintf.c2
-rw-r--r--gl/lib/assert.in.h27
-rw-r--r--gl/lib/assure.h2
-rw-r--r--gl/lib/at-func.c2
-rw-r--r--gl/lib/at-func2.c2
-rw-r--r--gl/lib/attribute.h19
-rw-r--r--gl/lib/basename-lgpl.c3
-rw-r--r--gl/lib/basename-lgpl.h7
-rw-r--r--gl/lib/basename.c2
-rw-r--r--gl/lib/bitrotate.c2
-rw-r--r--gl/lib/bitrotate.h10
-rw-r--r--gl/lib/btowc.c10
-rw-r--r--gl/lib/c++defs.h8
-rw-r--r--gl/lib/calloc.c2
-rw-r--r--gl/lib/canonicalize-lgpl.c125
-rw-r--r--gl/lib/canonicalize.c108
-rw-r--r--gl/lib/canonicalize.h7
-rw-r--r--gl/lib/cdefs.h42
-rw-r--r--gl/lib/chdir-long.c3
-rw-r--r--gl/lib/chdir-long.h2
-rw-r--r--gl/lib/chown.c3
-rw-r--r--gl/lib/cloexec.c2
-rw-r--r--gl/lib/cloexec.h4
-rw-r--r--gl/lib/close.c2
-rw-r--r--gl/lib/closedir.c30
-rw-r--r--gl/lib/ctype.in.h7
-rw-r--r--gl/lib/dirent-private.h33
-rw-r--r--gl/lib/dirent.in.h51
-rw-r--r--gl/lib/dirfd.c19
-rw-r--r--gl/lib/dirname-lgpl.c2
-rw-r--r--gl/lib/dirname.c2
-rw-r--r--gl/lib/dirname.h9
-rw-r--r--gl/lib/dup-safer-flag.c2
-rw-r--r--gl/lib/dup-safer.c2
-rw-r--r--gl/lib/dup.c2
-rw-r--r--gl/lib/dup2.c2
-rw-r--r--gl/lib/dynarray.h2
-rw-r--r--gl/lib/eloop-threshold.h7
-rw-r--r--gl/lib/errno.in.h2
-rw-r--r--gl/lib/error.c5
-rw-r--r--gl/lib/error.h66
-rw-r--r--gl/lib/error.in.h215
-rw-r--r--gl/lib/exitfail.c2
-rw-r--r--gl/lib/exitfail.h2
-rw-r--r--gl/lib/fchdir.c4
-rw-r--r--gl/lib/fchown-stub.c2
-rw-r--r--gl/lib/fcntl.c2
-rw-r--r--gl/lib/fcntl.in.h7
-rw-r--r--gl/lib/fd-hook.c2
-rw-r--r--gl/lib/fd-hook.h2
-rw-r--r--gl/lib/fd-safer-flag.c2
-rw-r--r--gl/lib/fd-safer.c2
-rw-r--r--gl/lib/fdopendir.c99
-rw-r--r--gl/lib/file-set.c2
-rw-r--r--gl/lib/file-set.h3
-rw-r--r--gl/lib/filename.h2
-rw-r--r--gl/lib/filenamecat-lgpl.c2
-rw-r--r--gl/lib/filenamecat.h7
-rw-r--r--gl/lib/flexmember.h20
-rw-r--r--gl/lib/float+.h2
-rw-r--r--gl/lib/float.c2
-rw-r--r--gl/lib/float.in.h2
-rw-r--r--gl/lib/flock.c2
-rw-r--r--gl/lib/fnmatch.c7
-rw-r--r--gl/lib/fnmatch.in.h7
-rw-r--r--gl/lib/fnmatch_loop.c6
-rw-r--r--gl/lib/free.c2
-rw-r--r--gl/lib/fstat.c2
-rw-r--r--gl/lib/fstatat.c2
-rw-r--r--gl/lib/getcwd-lgpl.c2
-rw-r--r--gl/lib/getcwd.c84
-rw-r--r--gl/lib/getdelim.c6
-rw-r--r--gl/lib/getdtablesize.c2
-rw-r--r--gl/lib/getline.c2
-rw-r--r--gl/lib/getlogin_r.c2
-rw-r--r--gl/lib/getopt-cdefs.in.h2
-rw-r--r--gl/lib/getopt-core.h2
-rw-r--r--gl/lib/getopt-ext.h2
-rw-r--r--gl/lib/getopt-pfx-core.h4
-rw-r--r--gl/lib/getopt-pfx-ext.h2
-rw-r--r--gl/lib/getopt.c2
-rw-r--r--gl/lib/getopt.in.h2
-rw-r--r--gl/lib/getopt1.c2
-rw-r--r--gl/lib/getopt_int.h2
-rw-r--r--gl/lib/getprogname.c24
-rw-r--r--gl/lib/getprogname.h20
-rw-r--r--gl/lib/getrandom.c3
-rw-r--r--gl/lib/gettext.h2
-rw-r--r--gl/lib/gettime.c6
-rw-r--r--gl/lib/gettimeofday.c16
-rw-r--r--gl/lib/gl_anyhash1.h2
-rw-r--r--gl/lib/gl_anyhash2.h2
-rw-r--r--gl/lib/gl_anyhash_primes.h2
-rw-r--r--gl/lib/gl_anylinked_list1.h2
-rw-r--r--gl/lib/gl_anylinked_list2.h2
-rw-r--r--gl/lib/gl_anyrbtree_list1.h2
-rw-r--r--gl/lib/gl_anyrbtree_list2.h2
-rw-r--r--gl/lib/gl_anytree_list1.h2
-rw-r--r--gl/lib/gl_anytree_list2.h2
-rw-r--r--gl/lib/gl_array_list.c2
-rw-r--r--gl/lib/gl_array_list.h2
-rw-r--r--gl/lib/gl_hash_map.c2
-rw-r--r--gl/lib/gl_hash_map.h2
-rw-r--r--gl/lib/gl_hash_set.c2
-rw-r--r--gl/lib/gl_hash_set.h2
-rw-r--r--gl/lib/gl_linkedhash_list.c2
-rw-r--r--gl/lib/gl_linkedhash_list.h2
-rw-r--r--gl/lib/gl_list.c2
-rw-r--r--gl/lib/gl_list.h12
-rw-r--r--gl/lib/gl_map.c2
-rw-r--r--gl/lib/gl_map.h12
-rw-r--r--gl/lib/gl_rbtree_list.c5
-rw-r--r--gl/lib/gl_rbtree_list.h2
-rw-r--r--gl/lib/gl_set.c2
-rw-r--r--gl/lib/gl_set.h12
-rw-r--r--gl/lib/gl_xlist.c2
-rw-r--r--gl/lib/gl_xlist.h11
-rw-r--r--gl/lib/gl_xmap.c2
-rw-r--r--gl/lib/gl_xmap.h11
-rw-r--r--gl/lib/gl_xset.c2
-rw-r--r--gl/lib/gl_xset.h11
-rw-r--r--gl/lib/glob-libc.h2
-rw-r--r--gl/lib/glob.c24
-rw-r--r--gl/lib/glob.in.h9
-rw-r--r--gl/lib/glob_internal.h2
-rw-r--r--gl/lib/glob_pattern_p.c2
-rw-r--r--gl/lib/globfree.c2
-rw-r--r--gl/lib/glthread/lock.c2
-rw-r--r--gl/lib/glthread/lock.h10
-rw-r--r--gl/lib/glthread/threadlib.c2
-rw-r--r--gl/lib/hard-locale.c16
-rw-r--r--gl/lib/hard-locale.h8
-rw-r--r--gl/lib/hash-pjw-bare.c2
-rw-r--r--gl/lib/hash-pjw-bare.h7
-rw-r--r--gl/lib/hash-pjw.c2
-rw-r--r--gl/lib/hash-pjw.h7
-rw-r--r--gl/lib/hash-triple-simple.c2
-rw-r--r--gl/lib/hash-triple.h8
-rw-r--r--gl/lib/hash.c2
-rw-r--r--gl/lib/hash.h12
-rw-r--r--gl/lib/ialloc.c2
-rw-r--r--gl/lib/ialloc.h25
-rw-r--r--gl/lib/idpriv-drop.c2
-rw-r--r--gl/lib/idpriv-droptemp.c2
-rw-r--r--gl/lib/idpriv.h2
-rw-r--r--gl/lib/idx.h2
-rw-r--r--gl/lib/intprops-internal.h392
-rw-r--r--gl/lib/intprops.h361
-rw-r--r--gl/lib/inttypes.in.h41
-rw-r--r--gl/lib/ioctl.c2
-rw-r--r--gl/lib/isblank.c2
-rw-r--r--gl/lib/itold.c2
-rw-r--r--gl/lib/langinfo.in.h9
-rw-r--r--gl/lib/lc-charset-dispatch.c2
-rw-r--r--gl/lib/lc-charset-dispatch.h2
-rw-r--r--gl/lib/lchown.c3
-rw-r--r--gl/lib/libc-config.h24
-rw-r--r--gl/lib/limits.in.h36
-rw-r--r--gl/lib/localcharset.c2
-rw-r--r--gl/lib/localcharset.h2
-rw-r--r--gl/lib/locale.in.h31
-rw-r--r--gl/lib/localeconv.c47
-rw-r--r--gl/lib/lstat.c2
-rw-r--r--gl/lib/malloc.c2
-rw-r--r--gl/lib/malloc/dynarray-skeleton.c2
-rw-r--r--gl/lib/malloc/dynarray.h3
-rw-r--r--gl/lib/malloc/dynarray_at_failure.c2
-rw-r--r--gl/lib/malloc/dynarray_emplace_enlarge.c6
-rw-r--r--gl/lib/malloc/dynarray_finalize.c2
-rw-r--r--gl/lib/malloc/dynarray_resize.c6
-rw-r--r--gl/lib/malloc/dynarray_resize_clear.c2
-rw-r--r--gl/lib/malloc/scratch_buffer.h18
-rw-r--r--gl/lib/malloc/scratch_buffer_dupfree.c41
-rw-r--r--gl/lib/malloc/scratch_buffer_grow.c2
-rw-r--r--gl/lib/malloc/scratch_buffer_grow_preserve.c2
-rw-r--r--gl/lib/malloc/scratch_buffer_set_array_size.c2
-rw-r--r--gl/lib/malloca.c15
-rw-r--r--gl/lib/malloca.h8
-rw-r--r--gl/lib/mbrtowc-impl-utf8.h2
-rw-r--r--gl/lib/mbrtowc-impl.h2
-rw-r--r--gl/lib/mbrtowc.c5
-rw-r--r--gl/lib/mbsinit.c5
-rw-r--r--gl/lib/mbsrtowcs-impl.h2
-rw-r--r--gl/lib/mbsrtowcs-state.c2
-rw-r--r--gl/lib/mbsrtowcs.c2
-rw-r--r--gl/lib/mbtowc-impl.h2
-rw-r--r--gl/lib/mbtowc-lock.c2
-rw-r--r--gl/lib/mbtowc-lock.h2
-rw-r--r--gl/lib/mbtowc.c2
-rw-r--r--gl/lib/memchr.c2
-rw-r--r--gl/lib/memchr.valgrind2
-rw-r--r--gl/lib/memmem.c2
-rw-r--r--gl/lib/mempcpy.c2
-rw-r--r--gl/lib/memrchr.c2
-rw-r--r--gl/lib/minmax.h7
-rw-r--r--gl/lib/mkdir.c2
-rw-r--r--gl/lib/mkdtemp.c2
-rw-r--r--gl/lib/mkstemp.c2
-rw-r--r--gl/lib/msvc-inval.c2
-rw-r--r--gl/lib/msvc-inval.h7
-rw-r--r--gl/lib/msvc-nothrow.c2
-rw-r--r--gl/lib/msvc-nothrow.h7
-rw-r--r--gl/lib/nanosleep.c9
-rw-r--r--gl/lib/nl_langinfo-lock.c2
-rw-r--r--gl/lib/nl_langinfo.c4
-rw-r--r--gl/lib/nonblocking.c2
-rw-r--r--gl/lib/nonblocking.h4
-rw-r--r--gl/lib/open.c2
-rw-r--r--gl/lib/openat-die.c2
-rw-r--r--gl/lib/openat-priv.h2
-rw-r--r--gl/lib/openat-proc.c29
-rw-r--r--gl/lib/openat.c3
-rw-r--r--gl/lib/openat.h12
-rw-r--r--gl/lib/opendir.c41
-rw-r--r--gl/lib/pathmax.h7
-rw-r--r--gl/lib/pipe-safer.c2
-rw-r--r--gl/lib/pipe.c2
-rw-r--r--gl/lib/printf-args.c125
-rw-r--r--gl/lib/printf-args.h61
-rw-r--r--gl/lib/printf-parse.c499
-rw-r--r--gl/lib/printf-parse.h10
-rw-r--r--gl/lib/progname.c2
-rw-r--r--gl/lib/progname.h2
-rw-r--r--gl/lib/pselect.c14
-rw-r--r--gl/lib/pthread_sigmask.c2
-rw-r--r--gl/lib/raise.c2
-rw-r--r--gl/lib/rawmemchr.c6
-rw-r--r--gl/lib/rawmemchr.valgrind2
-rw-r--r--gl/lib/readdir.c11
-rw-r--r--gl/lib/readlink.c2
-rw-r--r--gl/lib/readlinkat.c2
-rw-r--r--gl/lib/realloc.c2
-rw-r--r--gl/lib/reallocarray.c7
-rw-r--r--gl/lib/regcomp.c4
-rw-r--r--gl/lib/regex.c2
-rw-r--r--gl/lib/regex.h2
-rw-r--r--gl/lib/regex_internal.c2
-rw-r--r--gl/lib/regex_internal.h9
-rw-r--r--gl/lib/regexec.c4
-rw-r--r--gl/lib/rename.c5
-rw-r--r--gl/lib/renameat.c2
-rw-r--r--gl/lib/renameatu.c3
-rw-r--r--gl/lib/renameatu.h2
-rw-r--r--gl/lib/rewinddir.c11
-rw-r--r--gl/lib/rmdir.c2
-rw-r--r--gl/lib/same-inode.h2
-rw-r--r--gl/lib/save-cwd.c3
-rw-r--r--gl/lib/save-cwd.h2
-rw-r--r--gl/lib/scratch_buffer.h12
-rw-r--r--gl/lib/select.c9
-rw-r--r--gl/lib/setenv.c7
-rw-r--r--gl/lib/setlocale-lock.c2
-rw-r--r--gl/lib/setlocale_null.c6
-rw-r--r--gl/lib/setlocale_null.h2
-rw-r--r--gl/lib/sig-handler.c2
-rw-r--r--gl/lib/sig-handler.h10
-rw-r--r--gl/lib/sigaction.c2
-rw-r--r--gl/lib/signal.in.h21
-rw-r--r--gl/lib/sigprocmask.c2
-rw-r--r--gl/lib/size_max.h7
-rw-r--r--gl/lib/sleep.c6
-rw-r--r--gl/lib/sockets.c2
-rw-r--r--gl/lib/sockets.h7
-rw-r--r--gl/lib/stat-time.c2
-rw-r--r--gl/lib/stat-time.h50
-rw-r--r--gl/lib/stat-w32.c5
-rw-r--r--gl/lib/stat-w32.h2
-rw-r--r--gl/lib/stat.c4
-rw-r--r--gl/lib/stdalign.in.h127
-rw-r--r--gl/lib/stdarg.in.h7
-rw-r--r--gl/lib/stdbool.in.h132
-rw-r--r--gl/lib/stdckdint.in.h35
-rw-r--r--gl/lib/stddef.in.h54
-rw-r--r--gl/lib/stdint.in.h2
-rw-r--r--gl/lib/stdio-read.c2
-rw-r--r--gl/lib/stdio-write.c2
-rw-r--r--gl/lib/stdio.in.h111
-rw-r--r--gl/lib/stdlib.in.h208
-rw-r--r--gl/lib/stdopen.c2
-rw-r--r--gl/lib/stdopen.h2
-rw-r--r--gl/lib/stpcpy.c2
-rw-r--r--gl/lib/str-two-way.h2
-rw-r--r--gl/lib/strcasecmp.c2
-rw-r--r--gl/lib/strcasestr.c3
-rw-r--r--gl/lib/strchrnul.c2
-rw-r--r--gl/lib/strchrnul.valgrind2
-rw-r--r--gl/lib/strdup.c2
-rw-r--r--gl/lib/streq.h2
-rw-r--r--gl/lib/strerror-override.c2
-rw-r--r--gl/lib/strerror-override.h7
-rw-r--r--gl/lib/strerror.c5
-rw-r--r--gl/lib/string.in.h93
-rw-r--r--gl/lib/strings.in.h7
-rw-r--r--gl/lib/stripslash.c2
-rw-r--r--gl/lib/strncasecmp.c2
-rw-r--r--gl/lib/strndup.c2
-rw-r--r--gl/lib/strnlen.c2
-rw-r--r--gl/lib/strnlen1.c2
-rw-r--r--gl/lib/strnlen1.h7
-rw-r--r--gl/lib/strsep.c2
-rw-r--r--gl/lib/sys_file.in.h9
-rw-r--r--gl/lib/sys_ioctl.in.h9
-rw-r--r--gl/lib/sys_random.in.h9
-rw-r--r--gl/lib/sys_select.in.h23
-rw-r--r--gl/lib/sys_socket.c2
-rw-r--r--gl/lib/sys_socket.in.h8
-rw-r--r--gl/lib/sys_stat.in.h98
-rw-r--r--gl/lib/sys_time.in.h14
-rw-r--r--gl/lib/sys_types.in.h9
-rw-r--r--gl/lib/sys_uio.in.h2
-rw-r--r--gl/lib/sysexits.in.h2
-rw-r--r--gl/lib/tempname.c173
-rw-r--r--gl/lib/tempname.h4
-rw-r--r--gl/lib/termios.in.h7
-rw-r--r--gl/lib/time.in.h56
-rw-r--r--gl/lib/timespec.c2
-rw-r--r--gl/lib/timespec.h16
-rw-r--r--gl/lib/unistd--.h2
-rw-r--r--gl/lib/unistd-safer.h2
-rw-r--r--gl/lib/unistd.c2
-rw-r--r--gl/lib/unistd.in.h113
-rw-r--r--gl/lib/unlink.c2
-rw-r--r--gl/lib/unlinkat.c2
-rw-r--r--gl/lib/utime.c3
-rw-r--r--gl/lib/utime.in.h14
-rw-r--r--gl/lib/utimens.c23
-rw-r--r--gl/lib/utimens.h10
-rw-r--r--gl/lib/vasnprintf.c1578
-rw-r--r--gl/lib/vasnprintf.h7
-rw-r--r--gl/lib/vasprintf.c2
-rw-r--r--gl/lib/verify.h97
-rw-r--r--gl/lib/verror.c2
-rw-r--r--gl/lib/verror.h7
-rw-r--r--gl/lib/vsnprintf.c2
-rw-r--r--gl/lib/w32sock.h2
-rw-r--r--gl/lib/warn-on-use.h2
-rw-r--r--gl/lib/wchar.in.h138
-rw-r--r--gl/lib/wcrtomb.c2
-rw-r--r--gl/lib/wctype-h.c2
-rw-r--r--gl/lib/wctype.in.h11
-rw-r--r--gl/lib/windows-initguard.h2
-rw-r--r--gl/lib/windows-mutex.c2
-rw-r--r--gl/lib/windows-mutex.h2
-rw-r--r--gl/lib/windows-once.c2
-rw-r--r--gl/lib/windows-once.h2
-rw-r--r--gl/lib/windows-recmutex.c2
-rw-r--r--gl/lib/windows-recmutex.h2
-rw-r--r--gl/lib/windows-rwlock.c2
-rw-r--r--gl/lib/windows-rwlock.h2
-rw-r--r--gl/lib/wmemchr-impl.h2
-rw-r--r--gl/lib/wmemchr.c2
-rw-r--r--gl/lib/wmempcpy.c2
-rw-r--r--gl/lib/xalloc-die.c2
-rw-r--r--gl/lib/xalloc-oversized.h2
-rw-r--r--gl/lib/xalloc.h16
-rw-r--r--gl/lib/xasprintf.c2
-rw-r--r--gl/lib/xgetcwd.c2
-rw-r--r--gl/lib/xgetcwd.h7
-rw-r--r--gl/lib/xmalloc.c15
-rw-r--r--gl/lib/xsize.c2
-rw-r--r--gl/lib/xsize.h10
-rw-r--r--gl/lib/xstdopen.c2
-rw-r--r--gl/lib/xstdopen.h2
-rw-r--r--gl/lib/xstrndup.c2
-rw-r--r--gl/lib/xstrndup.h7
-rw-r--r--gl/lib/xvasprintf.c2
-rw-r--r--gl/lib/xvasprintf.h7
386 files changed, 5839 insertions, 2914 deletions
diff --git a/gl/lib/Makefile.am b/gl/lib/Makefile.am
index a8e268e2..2c18ae1d 100644
--- a/gl/lib/Makefile.am
+++ b/gl/lib/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 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
@@ -104,7 +104,8 @@
# xset \
# xstdopen \
# xstrndup \
-# xvasprintf
+# xvasprintf \
+# year2038-recommended
AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects
@@ -134,18 +135,18 @@ libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
EXTRA_libgnu_la_SOURCES =
libgnu_la_LDFLAGS = $(AM_LDFLAGS)
libgnu_la_LDFLAGS += -no-undefined
+libgnu_la_LDFLAGS += $(CLOCK_TIME_LIB)
+libgnu_la_LDFLAGS += $(GETLOGIN_LIB)
+libgnu_la_LDFLAGS += $(GETRANDOM_LIB)
+libgnu_la_LDFLAGS += $(HARD_LOCALE_LIB)
libgnu_la_LDFLAGS += $(LIBSOCKET)
libgnu_la_LDFLAGS += $(LIBTHREAD)
-libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
-libgnu_la_LDFLAGS += $(LIB_GETLOGIN)
-libgnu_la_LDFLAGS += $(LIB_GETRANDOM)
-libgnu_la_LDFLAGS += $(LIB_HARD_LOCALE)
-libgnu_la_LDFLAGS += $(LIB_MBRTOWC)
-libgnu_la_LDFLAGS += $(LIB_NANOSLEEP)
-libgnu_la_LDFLAGS += $(LIB_PTHREAD_SIGMASK)
-libgnu_la_LDFLAGS += $(LIB_SELECT)
-libgnu_la_LDFLAGS += $(LIB_SETLOCALE_NULL)
libgnu_la_LDFLAGS += $(LTLIBINTL)
+libgnu_la_LDFLAGS += $(MBRTOWC_LIB)
+libgnu_la_LDFLAGS += $(NANOSLEEP_LIB)
+libgnu_la_LDFLAGS += $(PTHREAD_SIGMASK_LIB)
+libgnu_la_LDFLAGS += $(SELECT_LIB)
+libgnu_la_LDFLAGS += $(SETLOCALE_NULL_LIB)
AM_CPPFLAGS += -DDEFAULT_TEXT_DOMAIN=\"man-db-gnulib\"
@@ -203,6 +204,37 @@ libgnu_la_SOURCES += gl_array_list.h gl_array_list.c
## end gnulib module array-list
+## begin gnulib module assert-h
+
+BUILT_SOURCES += $(ASSERT_H)
+
+# We need the following in order to create <assert.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ASSERT_H
+assert.h: assert.in.h verify.h $(top_builddir)/config.status
+ $(gl_V_at){ $(SED_HEADER_STDOUT) \
+ -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_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \
+ < $(srcdir)/assert.in.h && \
+ sed -e '/@assert.h omit start@/,/@assert.h omit end@/d' \
+ -e 's|_gl_verify|_gl_static_assert|g' \
+ -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \
+ -e 's|_GL\(_STATIC_ASSERT_H\)|_GL\1|g' \
+ < $(srcdir)/verify.h; \
+ } > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+assert.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += assert.h assert.h-t
+
+EXTRA_DIST += assert.in.h verify.h
+
+## end gnulib module assert-h
+
## begin gnulib module assure
@@ -365,6 +397,7 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''DIR_HAS_FD_MEMBER''@/$(DIR_HAS_FD_MEMBER)/g' \
-e 's/@''GNULIB_OPENDIR''@/$(GL_GNULIB_OPENDIR)/g' \
-e 's/@''GNULIB_READDIR''@/$(GL_GNULIB_READDIR)/g' \
-e 's/@''GNULIB_REWINDDIR''@/$(GL_GNULIB_REWINDDIR)/g' \
@@ -383,6 +416,8 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_READDIR''@|$(REPLACE_READDIR)|g' \
+ -e 's|@''REPLACE_REWINDDIR''@|$(REPLACE_REWINDDIR)|g' \
-e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
@@ -403,6 +438,8 @@ if GL_COND_OBJ_DIRFD
libgnu_la_SOURCES += dirfd.c
endif
+EXTRA_DIST += dirent-private.h
+
## end gnulib module dirfd
## begin gnulib module dirname
@@ -439,39 +476,6 @@ endif
## end gnulib module dup2
-## begin gnulib module dynarray
-
-BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
-
-malloc/dynarray.gl.h: malloc/dynarray.h
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/dynarray.h > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
-
-malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
- -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
- -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
- -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- $(srcdir)/malloc/dynarray-skeleton.c > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
-
-libgnu_la_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
-
-EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
-
-EXTRA_libgnu_la_SOURCES += malloc/dynarray-skeleton.c
-
-## end gnulib module dynarray
-
## begin gnulib module eloop-threshold
@@ -517,10 +521,32 @@ if GL_COND_OBJ_ERROR
libgnu_la_SOURCES += error.c
endif
-EXTRA_DIST += error.h
-
## end gnulib module error
+## begin gnulib module error-h
+
+BUILT_SOURCES += error.h
+
+# We need the following in order to override <error.h>.
+error.h: error.in.h $(top_builddir)/config.status $(CXXDEFS_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_ERROR_H''@|$(HAVE_ERROR_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''NEXT_ERROR_H''@|$(NEXT_ERROR_H)|g' \
+ -e 's|@''HAVE_ERROR''@|$(HAVE_ERROR)|g' \
+ -e 's|@''HAVE_ERROR_AT_LINE''@|$(HAVE_ERROR_AT_LINE)|g' \
+ -e 's|@''REPLACE_ERROR''@|$(REPLACE_ERROR)|g' \
+ -e 's|@''REPLACE_ERROR_AT_LINE''@|$(REPLACE_ERROR_AT_LINE)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ $(srcdir)/error.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += error.h error.h-t
+
+EXTRA_DIST += error.in.h
+
+## end gnulib module error-h
+
## begin gnulib module exitfail
libgnu_la_SOURCES += exitfail.c
@@ -602,6 +628,8 @@ if GL_COND_OBJ_FDOPENDIR
libgnu_la_SOURCES += fdopendir.c
endif
+EXTRA_DIST += dirent-private.h
+
## end gnulib module fdopendir
## begin gnulib module file-set
@@ -871,7 +899,11 @@ EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h get
## begin gnulib module getprogname
-libgnu_la_SOURCES += getprogname.h getprogname.c
+if GL_COND_OBJ_GETPROGNAME
+libgnu_la_SOURCES += getprogname.c
+endif
+
+EXTRA_DIST += getprogname.h
## end gnulib module getprogname
@@ -910,6 +942,60 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog
## end gnulib module gitlog-to-changelog
+## begin gnulib module glibc-internal/dynarray
+
+BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
+
+libgnu_la_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
+
+EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
+
+EXTRA_libgnu_la_SOURCES += malloc/dynarray-skeleton.c
+
+## end gnulib module glibc-internal/dynarray
+
+## begin gnulib module glibc-internal/scratch_buffer
+
+BUILT_SOURCES += malloc/scratch_buffer.gl.h
+
+malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/scratch_buffer.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t
+
+libgnu_la_SOURCES += malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
+
+EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
+
+## end gnulib module glibc-internal/scratch_buffer
+
## begin gnulib module glob
if GL_COND_OBJ_GLOB
@@ -1069,7 +1155,7 @@ libgnu_la_SOURCES += idx.h
## begin gnulib module intprops
-EXTRA_DIST += intprops.h
+EXTRA_DIST += intprops-internal.h intprops.h
## end gnulib module intprops
@@ -1097,6 +1183,8 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
-e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_IMAXABS''@/$(REPLACE_IMAXABS)/g' \
+ -e 's/@''REPLACE_IMAXDIV''@/$(REPLACE_IMAXDIV)/g' \
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
@@ -1717,27 +1805,6 @@ EXTRA_DIST += save-cwd.h
## end gnulib module save-cwd
-## begin gnulib module scratch_buffer
-
-BUILT_SOURCES += malloc/scratch_buffer.gl.h
-
-malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/scratch_buffer.h > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t
-
-libgnu_la_SOURCES += malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
-
-EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
-
-## end gnulib module scratch_buffer
-
## begin gnulib module select
if GL_COND_OBJ_SELECT
@@ -1929,26 +1996,6 @@ EXTRA_DIST += stat-time.h
## end gnulib module stat-time
-## begin gnulib module stdalign
-
-BUILT_SOURCES += $(STDALIGN_H)
-
-# We need the following in order to create <stdalign.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDALIGN_H
-stdalign.h: stdalign.in.h $(top_builddir)/config.status
- $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
- $(AM_V_at)mv $@-t $@
-else
-stdalign.h: $(top_builddir)/config.status
- rm -f $@
-endif
-MOSTLYCLEANFILES += stdalign.h stdalign.h-t
-
-EXTRA_DIST += stdalign.in.h
-
-## end gnulib module stdalign
-
## begin gnulib module stdarg
BUILT_SOURCES += $(STDARG_H)
@@ -1975,27 +2022,26 @@ EXTRA_DIST += stdarg.in.h
## end gnulib module stdarg
-## begin gnulib module stdbool
+## begin gnulib module stdckdint
-BUILT_SOURCES += $(STDBOOL_H)
+BUILT_SOURCES += $(STDCKDINT_H)
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDBOOL_H
-stdbool.h: stdbool.in.h $(top_builddir)/config.status
+# We need the following in order to create <stdckdint.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDCKDINT_H
+stdckdint.h: stdckdint.in.h $(top_builddir)/config.status
$(gl_V_at)$(SED_HEADER_STDOUT) \
- -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
- $(srcdir)/stdbool.in.h > $@-t
+ $(srcdir)/stdckdint.in.h > $@-t
$(AM_V_at)mv $@-t $@
else
-stdbool.h: $(top_builddir)/config.status
+stdckdint.h: $(top_builddir)/config.status
rm -f $@
endif
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+MOSTLYCLEANFILES += stdckdint.h stdckdint.h-t
-EXTRA_DIST += stdbool.in.h
+EXTRA_DIST += intprops-internal.h stdckdint.in.h
-## end gnulib module stdbool
+## end gnulib module stdckdint
## begin gnulib module stddef
@@ -2147,14 +2193,17 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
-e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
-e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
- < $(srcdir)/stdio.in.h | \
- sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ < $(srcdir)/stdio.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
-e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_GETW''@|$(HAVE_DECL_GETW)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_PUTW''@|$(HAVE_DECL_PUTW)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
@@ -2165,6 +2214,8 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
@@ -2202,9 +2253,10 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += stdio.h stdio.h-t
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t1 stdio.h-t2 stdio.h-t3
if GL_COND_OBJ_STDIO_READ
libgnu_la_SOURCES += stdio-read.c
@@ -2239,10 +2291,12 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
-e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETPROGNAME''@/$(GL_GNULIB_GETPROGNAME)/g' \
-e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
-e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
-e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
-e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBSTOWCS''@/$(GL_GNULIB_MBSTOWCS)/g' \
-e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
-e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
@@ -2279,8 +2333,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
-e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
-e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
- < $(srcdir)/stdlib.in.h | \
- sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ < $(srcdir)/stdlib.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
@@ -2288,6 +2343,8 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
-e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_DECL_PROGRAM_INVOCATION_NAME''@|$(HAVE_DECL_PROGRAM_INVOCATION_NAME)|g' \
+ -e 's|@''HAVE_GETPROGNAME''@|$(HAVE_GETPROGNAME)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
-e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
@@ -2323,17 +2380,28 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE__EXIT''@|$(REPLACE__EXIT)|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' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_GETLOADAVG''@|$(REPLACE_GETLOADAVG)|g' \
+ -e 's|@''REPLACE_GETPROGNAME''@|$(REPLACE_GETPROGNAME)|g' \
+ -e 's|@''REPLACE_GETSUBOPT''@|$(REPLACE_GETSUBOPT)|g' \
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MB_CUR_MAX''@|$(REPLACE_MB_CUR_MAX)|g' \
+ -e 's|@''REPLACE_MBSTOWCS''@|$(REPLACE_MBSTOWCS)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKOSTEMP''@|$(REPLACE_MKOSTEMP)|g' \
+ -e 's|@''REPLACE_MKOSTEMPS''@|$(REPLACE_MKOSTEMPS)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_POSIX_OPENPT''@|$(REPLACE_POSIX_OPENPT)|g' \
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
@@ -2358,9 +2426,10 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(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)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
+MOSTLYCLEANFILES += stdlib.h stdlib.h-t1 stdlib.h-t2 stdlib.h-t3
EXTRA_DIST += stdlib.in.h
@@ -2488,6 +2557,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_MEMSET_EXPLICIT''@/$(GL_GNULIB_MEMSET_EXPLICIT)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
@@ -2511,14 +2581,16 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
-e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
- < $(srcdir)/string.in.h | \
- sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ < $(srcdir)/string.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
-e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_MEMSET_EXPLICIT''@|$(HAVE_MEMSET_EXPLICIT)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
@@ -2539,7 +2611,9 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
@@ -2557,9 +2631,10 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += string.h string.h-t
+ < $@-t1 > $@-t2
+ $(AM_V_at)rm -f $@-t1
+ $(AM_V_at)mv $@-t2 $@
+MOSTLYCLEANFILES += string.h string.h-t1 string.h-t2
EXTRA_DIST += string.in.h
@@ -3013,7 +3088,7 @@ libgnu_la_SOURCES += glthread/threadlib.c
## end gnulib module threadlib
-## begin gnulib module time
+## begin gnulib module time-h
BUILT_SOURCES += time.h
@@ -3032,6 +3107,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIME''@/$(GL_GNULIB_TIME)/g' \
-e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
-e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
-e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
@@ -3053,7 +3129,9 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -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_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' \
@@ -3069,7 +3147,7 @@ MOSTLYCLEANFILES += time.h time.h-t
EXTRA_DIST += time.in.h
-## end gnulib module time
+## end gnulib module time-h
## begin gnulib module timespec
@@ -3118,6 +3196,8 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
-e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
-e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ < $(srcdir)/unistd.in.h > $@-t1
+ $(AM_V_at)sed \
-e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
@@ -3179,8 +3259,9 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
-e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
-e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
- < $(srcdir)/unistd.in.h | \
- sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
@@ -3227,13 +3308,15 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- | \
- sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ < $@-t2 > $@-t3
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
-e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_DUP3''@|$(REPLACE_DUP3)|g' \
-e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
-e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
-e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
@@ -3243,10 +3326,12 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
-e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FDATASYNC''@|$(REPLACE_FDATASYNC)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETENTROPY''@|$(REPLACE_GETENTROPY)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
@@ -3257,12 +3342,14 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PIPE2''@|$(REPLACE_PIPE2)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SETHOSTNAME''@|$(REPLACE_SETHOSTNAME)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
@@ -3278,9 +3365,10 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += unistd.h unistd.h-t
+ < $@-t3 > $@-t4
+ $(AM_V_at)rm -f $@-t1 $@-t2 $@-t3
+ $(AM_V_at)mv $@-t4 $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t1 unistd.h-t2 unistd.h-t3 unistd.h-t4
EXTRA_DIST += unistd.in.h
@@ -3459,8 +3547,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/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 | \
- sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ < $(srcdir)/wchar.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
-e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
-e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
@@ -3503,8 +3592,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
-e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- | \
- sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
-e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
-e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
@@ -3519,13 +3609,19 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
-e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSCMP''@|$(REPLACE_WCSCMP)|g' \
+ -e 's|@''REPLACE_WCSNCMP''@|$(REPLACE_WCSNCMP)|g' \
+ -e 's|@''REPLACE_WCSSTR''@|$(REPLACE_WCSSTR)|g' \
-e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e 's|@''REPLACE_WMEMCMP''@|$(REPLACE_WMEMCMP)|g' \
+ -e 's|@''REPLACE_WMEMPCPY''@|$(REPLACE_WMEMPCPY)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += wchar.h wchar.h-t
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
+MOSTLYCLEANFILES += wchar.h wchar.h-t1 wchar.h-t2 wchar.h-t3
EXTRA_DIST += wchar.in.h
diff --git a/gl/lib/Makefile.in b/gl/lib/Makefile.in
index 3caa632f..50c172b5 100644
--- a/gl/lib/Makefile.in
+++ b/gl/lib/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 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
@@ -118,7 +118,8 @@
# xset \
# xstdopen \
# xstrndup \
-# xvasprintf
+# xvasprintf \
+# year2038-recommended
@@ -223,76 +224,77 @@ host_triplet = @host@
@GL_COND_OBJ_GETLINE_TRUE@am__append_25 = getline.c
@GL_COND_OBJ_GETLOGIN_R_TRUE@am__append_26 = getlogin_r.c
@GL_COND_OBJ_GETOPT_TRUE@am__append_27 = getopt.c getopt1.c
-@GL_COND_OBJ_GETRANDOM_TRUE@am__append_28 = getrandom.c
-@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__append_29 = gettimeofday.c
-@GL_COND_OBJ_GLOB_TRUE@am__append_30 = glob.c globfree.c
-@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__append_31 = glob_pattern_p.c
-@GL_COND_OBJ_IOCTL_TRUE@am__append_32 = ioctl.c
-@GL_COND_OBJ_ISBLANK_TRUE@am__append_33 = isblank.c
-@GL_COND_OBJ_LCHOWN_TRUE@am__append_34 = lchown.c
-@GL_COND_OBJ_LOCALECONV_TRUE@am__append_35 = localeconv.c
-@GL_COND_OBJ_LSTAT_TRUE@am__append_36 = lstat.c
-@GL_COND_OBJ_MBRTOWC_TRUE@am__append_37 = mbrtowc.c
-@GL_COND_OBJ_MBSINIT_TRUE@am__append_38 = mbsinit.c
-@GL_COND_OBJ_MBSRTOWCS_TRUE@am__append_39 = mbsrtowcs.c
-@GL_COND_OBJ_MBTOWC_TRUE@am__append_40 = mbtowc.c
-@GL_COND_OBJ_MEMCHR_TRUE@am__append_41 = memchr.c
-@GL_COND_OBJ_MEMPCPY_TRUE@am__append_42 = mempcpy.c
-@GL_COND_OBJ_MEMRCHR_TRUE@am__append_43 = memrchr.c
-@GL_COND_OBJ_MKDIR_TRUE@am__append_44 = mkdir.c
-@GL_COND_OBJ_MKDTEMP_TRUE@am__append_45 = mkdtemp.c
-@GL_COND_OBJ_MKSTEMP_TRUE@am__append_46 = mkstemp.c
-@GL_COND_OBJ_MSVC_INVAL_TRUE@am__append_47 = msvc-inval.c
-@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__append_48 = msvc-nothrow.c
-@GL_COND_OBJ_NANOSLEEP_TRUE@am__append_49 = nanosleep.c
-@GL_COND_OBJ_NL_LANGINFO_TRUE@am__append_50 = nl_langinfo.c
-@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__append_51 = nl_langinfo-lock.c
-@GL_COND_OBJ_OPEN_TRUE@am__append_52 = open.c
-@GL_COND_OBJ_OPENAT_TRUE@am__append_53 = openat.c
-@GL_COND_OBJ_OPENDIR_TRUE@am__append_54 = opendir.c
-@GL_COND_OBJ_PIPE_TRUE@am__append_55 = pipe.c
-@GL_COND_OBJ_PSELECT_TRUE@am__append_56 = pselect.c
-@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__append_57 = pthread_sigmask.c
-@GL_COND_OBJ_RAISE_TRUE@am__append_58 = raise.c
-@GL_COND_OBJ_RAWMEMCHR_TRUE@am__append_59 = rawmemchr.c
-@GL_COND_OBJ_READDIR_TRUE@am__append_60 = readdir.c
-@GL_COND_OBJ_READLINK_TRUE@am__append_61 = readlink.c
-@GL_COND_OBJ_READLINKAT_TRUE@am__append_62 = readlinkat.c
-@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_63 = reallocarray.c
-@GL_COND_OBJ_REGEX_TRUE@am__append_64 = regex.c
-@GL_COND_OBJ_RENAME_TRUE@am__append_65 = rename.c
-@GL_COND_OBJ_RENAMEAT_TRUE@am__append_66 = renameat.c
-@GL_COND_OBJ_REWINDDIR_TRUE@am__append_67 = rewinddir.c
-@GL_COND_OBJ_RMDIR_TRUE@am__append_68 = rmdir.c
-@GL_COND_OBJ_SELECT_TRUE@am__append_69 = select.c
-@GL_COND_OBJ_SETENV_TRUE@am__append_70 = setenv.c
-@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_71 = setlocale-lock.c
-@GL_COND_OBJ_SIGACTION_TRUE@am__append_72 = sigaction.c
-@GL_COND_OBJ_SIGPROCMASK_TRUE@am__append_73 = sigprocmask.c
-@GL_COND_OBJ_SLEEP_TRUE@am__append_74 = sleep.c
-@GL_COND_OBJ_STAT_TRUE@am__append_75 = stat.c
-@GL_COND_OBJ_STDIO_READ_TRUE@am__append_76 = stdio-read.c
-@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_77 = stdio-write.c
-@GL_COND_OBJ_STPCPY_TRUE@am__append_78 = stpcpy.c
-@GL_COND_OBJ_STRCASECMP_TRUE@am__append_79 = strcasecmp.c
-@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_80 = strncasecmp.c
-@GL_COND_OBJ_STRCHRNUL_TRUE@am__append_81 = strchrnul.c
-@GL_COND_OBJ_STRDUP_TRUE@am__append_82 = strdup.c
-@GL_COND_OBJ_STRERROR_TRUE@am__append_83 = strerror.c
-@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_84 = strerror-override.c
-@GL_COND_OBJ_STRNDUP_TRUE@am__append_85 = strndup.c
-@GL_COND_OBJ_STRNLEN_TRUE@am__append_86 = strnlen.c
-@GL_COND_OBJ_STRSEP_TRUE@am__append_87 = strsep.c
-@GL_COND_OBJ_UNLINK_TRUE@am__append_88 = unlink.c
-@GL_COND_OBJ_UNLINKAT_TRUE@am__append_89 = unlinkat.c
-@GL_COND_OBJ_UTIME_TRUE@am__append_90 = utime.c
-@GL_COND_OBJ_WCRTOMB_TRUE@am__append_91 = wcrtomb.c
-@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_92 = windows-mutex.c
-@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_93 = windows-once.c
-@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_94 = windows-recmutex.c
-@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_95 = windows-rwlock.c
-@GL_COND_OBJ_WMEMCHR_TRUE@am__append_96 = wmemchr.c
-@GL_COND_OBJ_WMEMPCPY_TRUE@am__append_97 = wmempcpy.c
+@GL_COND_OBJ_GETPROGNAME_TRUE@am__append_28 = getprogname.c
+@GL_COND_OBJ_GETRANDOM_TRUE@am__append_29 = getrandom.c
+@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__append_30 = gettimeofday.c
+@GL_COND_OBJ_GLOB_TRUE@am__append_31 = glob.c globfree.c
+@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__append_32 = glob_pattern_p.c
+@GL_COND_OBJ_IOCTL_TRUE@am__append_33 = ioctl.c
+@GL_COND_OBJ_ISBLANK_TRUE@am__append_34 = isblank.c
+@GL_COND_OBJ_LCHOWN_TRUE@am__append_35 = lchown.c
+@GL_COND_OBJ_LOCALECONV_TRUE@am__append_36 = localeconv.c
+@GL_COND_OBJ_LSTAT_TRUE@am__append_37 = lstat.c
+@GL_COND_OBJ_MBRTOWC_TRUE@am__append_38 = mbrtowc.c
+@GL_COND_OBJ_MBSINIT_TRUE@am__append_39 = mbsinit.c
+@GL_COND_OBJ_MBSRTOWCS_TRUE@am__append_40 = mbsrtowcs.c
+@GL_COND_OBJ_MBTOWC_TRUE@am__append_41 = mbtowc.c
+@GL_COND_OBJ_MEMCHR_TRUE@am__append_42 = memchr.c
+@GL_COND_OBJ_MEMPCPY_TRUE@am__append_43 = mempcpy.c
+@GL_COND_OBJ_MEMRCHR_TRUE@am__append_44 = memrchr.c
+@GL_COND_OBJ_MKDIR_TRUE@am__append_45 = mkdir.c
+@GL_COND_OBJ_MKDTEMP_TRUE@am__append_46 = mkdtemp.c
+@GL_COND_OBJ_MKSTEMP_TRUE@am__append_47 = mkstemp.c
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__append_48 = msvc-inval.c
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__append_49 = msvc-nothrow.c
+@GL_COND_OBJ_NANOSLEEP_TRUE@am__append_50 = nanosleep.c
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__append_51 = nl_langinfo.c
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__append_52 = nl_langinfo-lock.c
+@GL_COND_OBJ_OPEN_TRUE@am__append_53 = open.c
+@GL_COND_OBJ_OPENAT_TRUE@am__append_54 = openat.c
+@GL_COND_OBJ_OPENDIR_TRUE@am__append_55 = opendir.c
+@GL_COND_OBJ_PIPE_TRUE@am__append_56 = pipe.c
+@GL_COND_OBJ_PSELECT_TRUE@am__append_57 = pselect.c
+@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__append_58 = pthread_sigmask.c
+@GL_COND_OBJ_RAISE_TRUE@am__append_59 = raise.c
+@GL_COND_OBJ_RAWMEMCHR_TRUE@am__append_60 = rawmemchr.c
+@GL_COND_OBJ_READDIR_TRUE@am__append_61 = readdir.c
+@GL_COND_OBJ_READLINK_TRUE@am__append_62 = readlink.c
+@GL_COND_OBJ_READLINKAT_TRUE@am__append_63 = readlinkat.c
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_64 = reallocarray.c
+@GL_COND_OBJ_REGEX_TRUE@am__append_65 = regex.c
+@GL_COND_OBJ_RENAME_TRUE@am__append_66 = rename.c
+@GL_COND_OBJ_RENAMEAT_TRUE@am__append_67 = renameat.c
+@GL_COND_OBJ_REWINDDIR_TRUE@am__append_68 = rewinddir.c
+@GL_COND_OBJ_RMDIR_TRUE@am__append_69 = rmdir.c
+@GL_COND_OBJ_SELECT_TRUE@am__append_70 = select.c
+@GL_COND_OBJ_SETENV_TRUE@am__append_71 = setenv.c
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_72 = setlocale-lock.c
+@GL_COND_OBJ_SIGACTION_TRUE@am__append_73 = sigaction.c
+@GL_COND_OBJ_SIGPROCMASK_TRUE@am__append_74 = sigprocmask.c
+@GL_COND_OBJ_SLEEP_TRUE@am__append_75 = sleep.c
+@GL_COND_OBJ_STAT_TRUE@am__append_76 = stat.c
+@GL_COND_OBJ_STDIO_READ_TRUE@am__append_77 = stdio-read.c
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_78 = stdio-write.c
+@GL_COND_OBJ_STPCPY_TRUE@am__append_79 = stpcpy.c
+@GL_COND_OBJ_STRCASECMP_TRUE@am__append_80 = strcasecmp.c
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_81 = strncasecmp.c
+@GL_COND_OBJ_STRCHRNUL_TRUE@am__append_82 = strchrnul.c
+@GL_COND_OBJ_STRDUP_TRUE@am__append_83 = strdup.c
+@GL_COND_OBJ_STRERROR_TRUE@am__append_84 = strerror.c
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_85 = strerror-override.c
+@GL_COND_OBJ_STRNDUP_TRUE@am__append_86 = strndup.c
+@GL_COND_OBJ_STRNLEN_TRUE@am__append_87 = strnlen.c
+@GL_COND_OBJ_STRSEP_TRUE@am__append_88 = strsep.c
+@GL_COND_OBJ_UNLINK_TRUE@am__append_89 = unlink.c
+@GL_COND_OBJ_UNLINKAT_TRUE@am__append_90 = unlinkat.c
+@GL_COND_OBJ_UTIME_TRUE@am__append_91 = utime.c
+@GL_COND_OBJ_WCRTOMB_TRUE@am__append_92 = wcrtomb.c
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_93 = windows-mutex.c
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_94 = windows-once.c
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_95 = windows-recmutex.c
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_96 = windows-rwlock.c
+@GL_COND_OBJ_WMEMCHR_TRUE@am__append_97 = wmemchr.c
+@GL_COND_OBJ_WMEMPCPY_TRUE@am__append_98 = wmempcpy.c
subdir = gl/lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
@@ -324,9 +326,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/absolute-header.m4 \
$(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/argp.m4 \
$(top_srcdir)/gl/m4/asm-underscore.m4 \
- $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/btowc.m4 \
$(top_srcdir)/gl/m4/builtin-expect.m4 \
- $(top_srcdir)/gl/m4/calloc.m4 \
+ $(top_srcdir)/gl/m4/c-bool.m4 $(top_srcdir)/gl/m4/calloc.m4 \
$(top_srcdir)/gl/m4/canonicalize.m4 \
$(top_srcdir)/gl/m4/chdir-long.m4 $(top_srcdir)/gl/m4/chown.m4 \
$(top_srcdir)/gl/m4/clock_time.m4 $(top_srcdir)/gl/m4/close.m4 \
@@ -338,6 +340,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/dup.m4 $(top_srcdir)/gl/m4/dup2.m4 \
$(top_srcdir)/gl/m4/eealloc.m4 $(top_srcdir)/gl/m4/environ.m4 \
$(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \
+ $(top_srcdir)/gl/m4/error_h.m4 \
$(top_srcdir)/gl/m4/exponentd.m4 \
$(top_srcdir)/gl/m4/extensions.m4 \
$(top_srcdir)/gl/m4/extern-inline.m4 \
@@ -401,7 +404,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/mmap-anon.m4 $(top_srcdir)/gl/m4/mode_t.m4 \
$(top_srcdir)/gl/m4/msvc-inval.m4 \
$(top_srcdir)/gl/m4/msvc-nothrow.m4 \
- $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 $(top_srcdir)/gl/m4/musl.m4 \
$(top_srcdir)/gl/m4/nanosleep.m4 \
$(top_srcdir)/gl/m4/nl_langinfo.m4 $(top_srcdir)/gl/m4/nls.m4 \
$(top_srcdir)/gl/m4/nocrash.m4 \
@@ -435,10 +438,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/ssize_t.m4 \
$(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
$(top_srcdir)/gl/m4/stdalign.m4 $(top_srcdir)/gl/m4/stdarg.m4 \
- $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \
- $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdint_h.m4 \
- $(top_srcdir)/gl/m4/stdio_h.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \
- $(top_srcdir)/gl/m4/stpcpy.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/stpcpy.m4 \
+ $(top_srcdir)/gl/m4/strcase.m4 \
$(top_srcdir)/gl/m4/strcasestr.m4 \
$(top_srcdir)/gl/m4/strchrnul.m4 $(top_srcdir)/gl/m4/strdup.m4 \
$(top_srcdir)/gl/m4/strerror.m4 \
@@ -477,7 +480,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xgetcwd.m4 \
$(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
$(top_srcdir)/gl/m4/xvasprintf.m4 \
- $(top_srcdir)/gl/m4/year2038.m4 \
$(top_srcdir)/gl/m4/zzgnulib.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -497,51 +499,51 @@ am__libgnu_la_SOURCES_DIST = argp.h argp-ba.c argp-eexst.c \
openat-proc.c basename-lgpl.c bitrotate.h bitrotate.c btowc.c \
canonicalize.c canonicalize-lgpl.c chdir-long.c chown.c \
fchown-stub.c cloexec.c close.c closedir.c dirfd.c dirname.c \
- basename.c dirname-lgpl.c stripslash.c dup.c dup2.c \
+ basename.c dirname-lgpl.c stripslash.c dup.c dup2.c error.c \
+ exitfail.c fchdir.c fcntl.c fd-hook.c fd-safer-flag.c \
+ dup-safer-flag.c fdopendir.c file-set.c filenamecat-lgpl.c \
+ float.c itold.c flock.c free.c fstat.c fstatat.c getcwd.c \
+ getcwd-lgpl.c getdelim.c getdtablesize.c getline.c \
+ getlogin_r.c getopt.c getopt1.c getprogname.c getrandom.c \
+ gettext.h gettime.c gettimeofday.c \
malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
malloc/dynarray_finalize.c malloc/dynarray_resize.c \
- malloc/dynarray_resize_clear.c error.c exitfail.c fchdir.c \
- fcntl.c fd-hook.c fd-safer-flag.c dup-safer-flag.c fdopendir.c \
- file-set.c filenamecat-lgpl.c float.c itold.c flock.c free.c \
- fstat.c fstatat.c getcwd.c getcwd-lgpl.c getdelim.c \
- getdtablesize.c getline.c getlogin_r.c getopt.c getopt1.c \
- getprogname.h getprogname.c getrandom.c gettext.h gettime.c \
- gettimeofday.c glob.c globfree.c glob_pattern_p.c \
- hard-locale.c hash.c gl_hash_map.h gl_hash_map.c gl_anyhash1.h \
- gl_anyhash2.h gl_anyhash_primes.h hash-pjw.h hash-pjw.c \
- hash-pjw-bare.h hash-pjw-bare.c gl_hash_set.h gl_hash_set.c \
- hash-triple-simple.c ialloc.c idpriv-drop.c idpriv-droptemp.c \
- idx.h ioctl.c isblank.c lchown.c gl_linkedhash_list.h \
- gl_linkedhash_list.c gl_anylinked_list1.h gl_anylinked_list2.h \
- gl_list.h gl_list.c localcharset.c localeconv.c \
- glthread/lock.h glthread/lock.c lstat.c malloca.c gl_map.h \
- gl_map.c mbrtowc.c mbsinit.c mbsrtowcs.c mbtowc.c memchr.c \
- mempcpy.c memrchr.c minmax.h mkdir.c mkdtemp.c mkstemp.c \
- msvc-inval.c msvc-nothrow.c nanosleep.c nl_langinfo.c \
- nl_langinfo-lock.c nonblocking.c open.c openat.c openat-die.c \
- opendir.c pipe.c progname.h progname.c pselect.c \
- pthread_sigmask.c raise.c rawmemchr.c gl_rbtree_list.h \
- gl_rbtree_list.c gl_anyrbtree_list1.h gl_anyrbtree_list2.h \
- gl_anytree_list1.h gl_anytree_list2.h readdir.c readlink.c \
- readlinkat.c reallocarray.c regex.c rename.c renameat.c \
- renameatu.c rewinddir.c rmdir.c save-cwd.c \
- malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c \
+ malloc/dynarray_resize_clear.c malloc/scratch_buffer_grow.c \
malloc/scratch_buffer_grow_preserve.c \
- malloc/scratch_buffer_set_array_size.c select.c gl_set.h \
- gl_set.c setenv.c setlocale_null.c setlocale-lock.c \
- sigaction.c sig-handler.c sigprocmask.c size_max.h sleep.c \
- sockets.h sockets.c stat.c stat-time.c stdio-read.c \
- stdio-write.c stdopen.c stpcpy.c strcasecmp.c strncasecmp.c \
- strchrnul.c strdup.c strerror.c strerror-override.c strndup.c \
- strnlen.c strnlen1.h strnlen1.c strsep.c sys_socket.c \
- tempname.c glthread/threadlib.c timespec.c unistd.c \
- dup-safer.c fd-safer.c pipe-safer.c unlink.c unlinkat.c \
- utime.c utimens.c verror.h verror.c wcrtomb.c wctype-h.c \
- windows-mutex.c windows-once.c windows-recmutex.c \
- windows-rwlock.c wmemchr.c wmempcpy.c xmalloc.c xalloc-die.c \
- xgetcwd.c gl_xlist.h gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h \
- gl_xset.c xsize.h xsize.c xstdopen.c xstrndup.h xstrndup.c \
- xvasprintf.h xvasprintf.c xasprintf.c
+ malloc/scratch_buffer_set_array_size.c glob.c globfree.c \
+ glob_pattern_p.c hard-locale.c hash.c gl_hash_map.h \
+ gl_hash_map.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h \
+ hash-pjw.h hash-pjw.c hash-pjw-bare.h hash-pjw-bare.c \
+ gl_hash_set.h gl_hash_set.c hash-triple-simple.c ialloc.c \
+ idpriv-drop.c idpriv-droptemp.c idx.h ioctl.c isblank.c \
+ lchown.c gl_linkedhash_list.h gl_linkedhash_list.c \
+ gl_anylinked_list1.h gl_anylinked_list2.h gl_list.h gl_list.c \
+ localcharset.c localeconv.c glthread/lock.h glthread/lock.c \
+ lstat.c malloca.c gl_map.h gl_map.c mbrtowc.c mbsinit.c \
+ mbsrtowcs.c mbtowc.c memchr.c mempcpy.c memrchr.c minmax.h \
+ mkdir.c mkdtemp.c mkstemp.c msvc-inval.c msvc-nothrow.c \
+ nanosleep.c nl_langinfo.c nl_langinfo-lock.c nonblocking.c \
+ open.c openat.c openat-die.c opendir.c pipe.c progname.h \
+ progname.c pselect.c pthread_sigmask.c raise.c rawmemchr.c \
+ gl_rbtree_list.h gl_rbtree_list.c gl_anyrbtree_list1.h \
+ gl_anyrbtree_list2.h gl_anytree_list1.h gl_anytree_list2.h \
+ readdir.c readlink.c readlinkat.c reallocarray.c regex.c \
+ rename.c renameat.c renameatu.c rewinddir.c rmdir.c save-cwd.c \
+ select.c gl_set.h gl_set.c setenv.c setlocale_null.c \
+ setlocale-lock.c sigaction.c sig-handler.c sigprocmask.c \
+ size_max.h sleep.c sockets.h sockets.c stat.c stat-time.c \
+ stdio-read.c stdio-write.c stdopen.c stpcpy.c strcasecmp.c \
+ strncasecmp.c strchrnul.c strdup.c strerror.c \
+ strerror-override.c strndup.c strnlen.c strnlen1.h strnlen1.c \
+ strsep.c sys_socket.c tempname.c glthread/threadlib.c \
+ timespec.c unistd.c dup-safer.c fd-safer.c pipe-safer.c \
+ unlink.c unlinkat.c utime.c utimens.c verror.h verror.c \
+ wcrtomb.c wctype-h.c windows-mutex.c windows-once.c \
+ windows-recmutex.c windows-rwlock.c wmemchr.c wmempcpy.c \
+ xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h gl_xlist.c \
+ gl_xmap.h gl_xmap.c gl_xset.h gl_xset.c xsize.h xsize.c \
+ xstdopen.c xstrndup.h xstrndup.c xvasprintf.h xvasprintf.c \
+ xasprintf.c
@GL_COND_OBJ_BTOWC_TRUE@am__objects_1 = libgnu_la-btowc.lo
@GL_COND_OBJ_CANONICALIZE_LGPL_TRUE@am__objects_2 = libgnu_la-canonicalize-lgpl.lo
@GL_COND_OBJ_CHDIR_LONG_TRUE@am__objects_3 = libgnu_la-chdir-long.lo
@@ -553,7 +555,6 @@ am__libgnu_la_SOURCES_DIST = argp.h argp-ba.c argp-eexst.c \
@GL_COND_OBJ_DIRFD_TRUE@am__objects_8 = libgnu_la-dirfd.lo
@GL_COND_OBJ_DUP_TRUE@am__objects_9 = libgnu_la-dup.lo
@GL_COND_OBJ_DUP2_TRUE@am__objects_10 = libgnu_la-dup2.lo
-am__dirstamp = $(am__leading_dot)dirstamp
@GL_COND_OBJ_ERROR_TRUE@am__objects_11 = libgnu_la-error.lo
@GL_COND_OBJ_FCHDIR_TRUE@am__objects_12 = libgnu_la-fchdir.lo
@GL_COND_OBJ_FCNTL_TRUE@am__objects_13 = libgnu_la-fcntl.lo
@@ -574,89 +575,92 @@ am__dirstamp = $(am__leading_dot)dirstamp
@GL_COND_OBJ_GETLOGIN_R_TRUE@am__objects_26 = libgnu_la-getlogin_r.lo
@GL_COND_OBJ_GETOPT_TRUE@am__objects_27 = libgnu_la-getopt.lo \
@GL_COND_OBJ_GETOPT_TRUE@ libgnu_la-getopt1.lo
-@GL_COND_OBJ_GETRANDOM_TRUE@am__objects_28 = libgnu_la-getrandom.lo
-@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__objects_29 = \
+@GL_COND_OBJ_GETPROGNAME_TRUE@am__objects_28 = \
+@GL_COND_OBJ_GETPROGNAME_TRUE@ libgnu_la-getprogname.lo
+@GL_COND_OBJ_GETRANDOM_TRUE@am__objects_29 = libgnu_la-getrandom.lo
+@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__objects_30 = \
@GL_COND_OBJ_GETTIMEOFDAY_TRUE@ libgnu_la-gettimeofday.lo
-@GL_COND_OBJ_GLOB_TRUE@am__objects_30 = libgnu_la-glob.lo \
+am__dirstamp = $(am__leading_dot)dirstamp
+@GL_COND_OBJ_GLOB_TRUE@am__objects_31 = libgnu_la-glob.lo \
@GL_COND_OBJ_GLOB_TRUE@ libgnu_la-globfree.lo
-@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__objects_31 = \
+@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__objects_32 = \
@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@ libgnu_la-glob_pattern_p.lo
-@GL_COND_OBJ_IOCTL_TRUE@am__objects_32 = libgnu_la-ioctl.lo
-@GL_COND_OBJ_ISBLANK_TRUE@am__objects_33 = libgnu_la-isblank.lo
-@GL_COND_OBJ_LCHOWN_TRUE@am__objects_34 = libgnu_la-lchown.lo
-@GL_COND_OBJ_LOCALECONV_TRUE@am__objects_35 = libgnu_la-localeconv.lo
-@GL_COND_OBJ_LSTAT_TRUE@am__objects_36 = libgnu_la-lstat.lo
-@GL_COND_OBJ_MBRTOWC_TRUE@am__objects_37 = libgnu_la-mbrtowc.lo
-@GL_COND_OBJ_MBSINIT_TRUE@am__objects_38 = libgnu_la-mbsinit.lo
-@GL_COND_OBJ_MBSRTOWCS_TRUE@am__objects_39 = libgnu_la-mbsrtowcs.lo
-@GL_COND_OBJ_MBTOWC_TRUE@am__objects_40 = libgnu_la-mbtowc.lo
-@GL_COND_OBJ_MEMCHR_TRUE@am__objects_41 = libgnu_la-memchr.lo
-@GL_COND_OBJ_MEMPCPY_TRUE@am__objects_42 = libgnu_la-mempcpy.lo
-@GL_COND_OBJ_MEMRCHR_TRUE@am__objects_43 = libgnu_la-memrchr.lo
-@GL_COND_OBJ_MKDIR_TRUE@am__objects_44 = libgnu_la-mkdir.lo
-@GL_COND_OBJ_MKDTEMP_TRUE@am__objects_45 = libgnu_la-mkdtemp.lo
-@GL_COND_OBJ_MKSTEMP_TRUE@am__objects_46 = libgnu_la-mkstemp.lo
-@GL_COND_OBJ_MSVC_INVAL_TRUE@am__objects_47 = libgnu_la-msvc-inval.lo
-@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__objects_48 = \
+@GL_COND_OBJ_IOCTL_TRUE@am__objects_33 = libgnu_la-ioctl.lo
+@GL_COND_OBJ_ISBLANK_TRUE@am__objects_34 = libgnu_la-isblank.lo
+@GL_COND_OBJ_LCHOWN_TRUE@am__objects_35 = libgnu_la-lchown.lo
+@GL_COND_OBJ_LOCALECONV_TRUE@am__objects_36 = libgnu_la-localeconv.lo
+@GL_COND_OBJ_LSTAT_TRUE@am__objects_37 = libgnu_la-lstat.lo
+@GL_COND_OBJ_MBRTOWC_TRUE@am__objects_38 = libgnu_la-mbrtowc.lo
+@GL_COND_OBJ_MBSINIT_TRUE@am__objects_39 = libgnu_la-mbsinit.lo
+@GL_COND_OBJ_MBSRTOWCS_TRUE@am__objects_40 = libgnu_la-mbsrtowcs.lo
+@GL_COND_OBJ_MBTOWC_TRUE@am__objects_41 = libgnu_la-mbtowc.lo
+@GL_COND_OBJ_MEMCHR_TRUE@am__objects_42 = libgnu_la-memchr.lo
+@GL_COND_OBJ_MEMPCPY_TRUE@am__objects_43 = libgnu_la-mempcpy.lo
+@GL_COND_OBJ_MEMRCHR_TRUE@am__objects_44 = libgnu_la-memrchr.lo
+@GL_COND_OBJ_MKDIR_TRUE@am__objects_45 = libgnu_la-mkdir.lo
+@GL_COND_OBJ_MKDTEMP_TRUE@am__objects_46 = libgnu_la-mkdtemp.lo
+@GL_COND_OBJ_MKSTEMP_TRUE@am__objects_47 = libgnu_la-mkstemp.lo
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__objects_48 = libgnu_la-msvc-inval.lo
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__objects_49 = \
@GL_COND_OBJ_MSVC_NOTHROW_TRUE@ libgnu_la-msvc-nothrow.lo
-@GL_COND_OBJ_NANOSLEEP_TRUE@am__objects_49 = libgnu_la-nanosleep.lo
-@GL_COND_OBJ_NL_LANGINFO_TRUE@am__objects_50 = \
+@GL_COND_OBJ_NANOSLEEP_TRUE@am__objects_50 = libgnu_la-nanosleep.lo
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__objects_51 = \
@GL_COND_OBJ_NL_LANGINFO_TRUE@ libgnu_la-nl_langinfo.lo
-@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__objects_51 = libgnu_la-nl_langinfo-lock.lo
-@GL_COND_OBJ_OPEN_TRUE@am__objects_52 = libgnu_la-open.lo
-@GL_COND_OBJ_OPENAT_TRUE@am__objects_53 = libgnu_la-openat.lo
-@GL_COND_OBJ_OPENDIR_TRUE@am__objects_54 = libgnu_la-opendir.lo
-@GL_COND_OBJ_PIPE_TRUE@am__objects_55 = libgnu_la-pipe.lo
-@GL_COND_OBJ_PSELECT_TRUE@am__objects_56 = libgnu_la-pselect.lo
-@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__objects_57 = libgnu_la-pthread_sigmask.lo
-@GL_COND_OBJ_RAISE_TRUE@am__objects_58 = libgnu_la-raise.lo
-@GL_COND_OBJ_RAWMEMCHR_TRUE@am__objects_59 = libgnu_la-rawmemchr.lo
-@GL_COND_OBJ_READDIR_TRUE@am__objects_60 = libgnu_la-readdir.lo
-@GL_COND_OBJ_READLINK_TRUE@am__objects_61 = libgnu_la-readlink.lo
-@GL_COND_OBJ_READLINKAT_TRUE@am__objects_62 = libgnu_la-readlinkat.lo
-@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_63 = \
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__objects_52 = libgnu_la-nl_langinfo-lock.lo
+@GL_COND_OBJ_OPEN_TRUE@am__objects_53 = libgnu_la-open.lo
+@GL_COND_OBJ_OPENAT_TRUE@am__objects_54 = libgnu_la-openat.lo
+@GL_COND_OBJ_OPENDIR_TRUE@am__objects_55 = libgnu_la-opendir.lo
+@GL_COND_OBJ_PIPE_TRUE@am__objects_56 = libgnu_la-pipe.lo
+@GL_COND_OBJ_PSELECT_TRUE@am__objects_57 = libgnu_la-pselect.lo
+@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__objects_58 = libgnu_la-pthread_sigmask.lo
+@GL_COND_OBJ_RAISE_TRUE@am__objects_59 = libgnu_la-raise.lo
+@GL_COND_OBJ_RAWMEMCHR_TRUE@am__objects_60 = libgnu_la-rawmemchr.lo
+@GL_COND_OBJ_READDIR_TRUE@am__objects_61 = libgnu_la-readdir.lo
+@GL_COND_OBJ_READLINK_TRUE@am__objects_62 = libgnu_la-readlink.lo
+@GL_COND_OBJ_READLINKAT_TRUE@am__objects_63 = libgnu_la-readlinkat.lo
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_64 = \
@GL_COND_OBJ_REALLOCARRAY_TRUE@ libgnu_la-reallocarray.lo
-@GL_COND_OBJ_REGEX_TRUE@am__objects_64 = libgnu_la-regex.lo
-@GL_COND_OBJ_RENAME_TRUE@am__objects_65 = libgnu_la-rename.lo
-@GL_COND_OBJ_RENAMEAT_TRUE@am__objects_66 = libgnu_la-renameat.lo
-@GL_COND_OBJ_REWINDDIR_TRUE@am__objects_67 = libgnu_la-rewinddir.lo
-@GL_COND_OBJ_RMDIR_TRUE@am__objects_68 = libgnu_la-rmdir.lo
-@GL_COND_OBJ_SELECT_TRUE@am__objects_69 = libgnu_la-select.lo
-@GL_COND_OBJ_SETENV_TRUE@am__objects_70 = libgnu_la-setenv.lo
-@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_71 = \
+@GL_COND_OBJ_REGEX_TRUE@am__objects_65 = libgnu_la-regex.lo
+@GL_COND_OBJ_RENAME_TRUE@am__objects_66 = libgnu_la-rename.lo
+@GL_COND_OBJ_RENAMEAT_TRUE@am__objects_67 = libgnu_la-renameat.lo
+@GL_COND_OBJ_REWINDDIR_TRUE@am__objects_68 = libgnu_la-rewinddir.lo
+@GL_COND_OBJ_RMDIR_TRUE@am__objects_69 = libgnu_la-rmdir.lo
+@GL_COND_OBJ_SELECT_TRUE@am__objects_70 = libgnu_la-select.lo
+@GL_COND_OBJ_SETENV_TRUE@am__objects_71 = libgnu_la-setenv.lo
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_72 = \
@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@ libgnu_la-setlocale-lock.lo
-@GL_COND_OBJ_SIGACTION_TRUE@am__objects_72 = libgnu_la-sigaction.lo
-@GL_COND_OBJ_SIGPROCMASK_TRUE@am__objects_73 = \
+@GL_COND_OBJ_SIGACTION_TRUE@am__objects_73 = libgnu_la-sigaction.lo
+@GL_COND_OBJ_SIGPROCMASK_TRUE@am__objects_74 = \
@GL_COND_OBJ_SIGPROCMASK_TRUE@ libgnu_la-sigprocmask.lo
-@GL_COND_OBJ_SLEEP_TRUE@am__objects_74 = libgnu_la-sleep.lo
-@GL_COND_OBJ_STAT_TRUE@am__objects_75 = libgnu_la-stat.lo
-@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_76 = libgnu_la-stdio-read.lo
-@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_77 = \
+@GL_COND_OBJ_SLEEP_TRUE@am__objects_75 = libgnu_la-sleep.lo
+@GL_COND_OBJ_STAT_TRUE@am__objects_76 = libgnu_la-stat.lo
+@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_77 = libgnu_la-stdio-read.lo
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_78 = \
@GL_COND_OBJ_STDIO_WRITE_TRUE@ libgnu_la-stdio-write.lo
-@GL_COND_OBJ_STPCPY_TRUE@am__objects_78 = libgnu_la-stpcpy.lo
-@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_79 = libgnu_la-strcasecmp.lo
-@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_80 = \
+@GL_COND_OBJ_STPCPY_TRUE@am__objects_79 = libgnu_la-stpcpy.lo
+@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_80 = libgnu_la-strcasecmp.lo
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_81 = \
@GL_COND_OBJ_STRNCASECMP_TRUE@ libgnu_la-strncasecmp.lo
-@GL_COND_OBJ_STRCHRNUL_TRUE@am__objects_81 = libgnu_la-strchrnul.lo
-@GL_COND_OBJ_STRDUP_TRUE@am__objects_82 = libgnu_la-strdup.lo
-@GL_COND_OBJ_STRERROR_TRUE@am__objects_83 = libgnu_la-strerror.lo
-@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_84 = libgnu_la-strerror-override.lo
-@GL_COND_OBJ_STRNDUP_TRUE@am__objects_85 = libgnu_la-strndup.lo
-@GL_COND_OBJ_STRNLEN_TRUE@am__objects_86 = libgnu_la-strnlen.lo
-@GL_COND_OBJ_STRSEP_TRUE@am__objects_87 = libgnu_la-strsep.lo
-@GL_COND_OBJ_UNLINK_TRUE@am__objects_88 = libgnu_la-unlink.lo
-@GL_COND_OBJ_UNLINKAT_TRUE@am__objects_89 = libgnu_la-unlinkat.lo
-@GL_COND_OBJ_UTIME_TRUE@am__objects_90 = libgnu_la-utime.lo
-@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_91 = libgnu_la-wcrtomb.lo
-@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_92 = \
+@GL_COND_OBJ_STRCHRNUL_TRUE@am__objects_82 = libgnu_la-strchrnul.lo
+@GL_COND_OBJ_STRDUP_TRUE@am__objects_83 = libgnu_la-strdup.lo
+@GL_COND_OBJ_STRERROR_TRUE@am__objects_84 = libgnu_la-strerror.lo
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_85 = libgnu_la-strerror-override.lo
+@GL_COND_OBJ_STRNDUP_TRUE@am__objects_86 = libgnu_la-strndup.lo
+@GL_COND_OBJ_STRNLEN_TRUE@am__objects_87 = libgnu_la-strnlen.lo
+@GL_COND_OBJ_STRSEP_TRUE@am__objects_88 = libgnu_la-strsep.lo
+@GL_COND_OBJ_UNLINK_TRUE@am__objects_89 = libgnu_la-unlink.lo
+@GL_COND_OBJ_UNLINKAT_TRUE@am__objects_90 = libgnu_la-unlinkat.lo
+@GL_COND_OBJ_UTIME_TRUE@am__objects_91 = libgnu_la-utime.lo
+@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_92 = libgnu_la-wcrtomb.lo
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_93 = \
@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@ libgnu_la-windows-mutex.lo
-@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_93 = \
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_94 = \
@GL_COND_OBJ_WINDOWS_ONCE_TRUE@ libgnu_la-windows-once.lo
-@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_94 = libgnu_la-windows-recmutex.lo
-@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_95 = \
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_95 = libgnu_la-windows-recmutex.lo
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_96 = \
@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@ libgnu_la-windows-rwlock.lo
-@GL_COND_OBJ_WMEMCHR_TRUE@am__objects_96 = libgnu_la-wmemchr.lo
-@GL_COND_OBJ_WMEMPCPY_TRUE@am__objects_97 = libgnu_la-wmempcpy.lo
+@GL_COND_OBJ_WMEMCHR_TRUE@am__objects_97 = libgnu_la-wmemchr.lo
+@GL_COND_OBJ_WMEMPCPY_TRUE@am__objects_98 = libgnu_la-wmempcpy.lo
am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \
libgnu_la-argp-fmtstream.lo libgnu_la-argp-fs-xinl.lo \
libgnu_la-argp-help.lo libgnu_la-argp-parse.lo \
@@ -669,12 +673,7 @@ am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \
libgnu_la-cloexec.lo $(am__objects_6) $(am__objects_7) \
$(am__objects_8) libgnu_la-dirname.lo libgnu_la-basename.lo \
libgnu_la-dirname-lgpl.lo libgnu_la-stripslash.lo \
- $(am__objects_9) $(am__objects_10) \
- malloc/libgnu_la-dynarray_at_failure.lo \
- malloc/libgnu_la-dynarray_emplace_enlarge.lo \
- malloc/libgnu_la-dynarray_finalize.lo \
- malloc/libgnu_la-dynarray_resize.lo \
- malloc/libgnu_la-dynarray_resize_clear.lo $(am__objects_11) \
+ $(am__objects_9) $(am__objects_10) $(am__objects_11) \
libgnu_la-exitfail.lo $(am__objects_12) $(am__objects_13) \
libgnu_la-fd-hook.lo libgnu_la-fd-safer-flag.lo \
libgnu_la-dup-safer-flag.lo $(am__objects_14) \
@@ -683,53 +682,58 @@ am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \
$(am__objects_18) $(am__objects_19) $(am__objects_20) \
$(am__objects_21) $(am__objects_22) $(am__objects_23) \
$(am__objects_24) $(am__objects_25) $(am__objects_26) \
- $(am__objects_27) libgnu_la-getprogname.lo $(am__objects_28) \
- libgnu_la-gettime.lo $(am__objects_29) $(am__objects_30) \
- $(am__objects_31) libgnu_la-hard-locale.lo libgnu_la-hash.lo \
- libgnu_la-gl_hash_map.lo libgnu_la-hash-pjw.lo \
- libgnu_la-hash-pjw-bare.lo libgnu_la-gl_hash_set.lo \
- libgnu_la-hash-triple-simple.lo libgnu_la-ialloc.lo \
- libgnu_la-idpriv-drop.lo libgnu_la-idpriv-droptemp.lo \
- $(am__objects_32) $(am__objects_33) $(am__objects_34) \
- libgnu_la-gl_linkedhash_list.lo libgnu_la-gl_list.lo \
- libgnu_la-localcharset.lo $(am__objects_35) \
- glthread/libgnu_la-lock.lo $(am__objects_36) \
- libgnu_la-malloca.lo libgnu_la-gl_map.lo $(am__objects_37) \
- $(am__objects_38) $(am__objects_39) $(am__objects_40) \
- $(am__objects_41) $(am__objects_42) $(am__objects_43) \
- $(am__objects_44) $(am__objects_45) $(am__objects_46) \
- $(am__objects_47) $(am__objects_48) $(am__objects_49) \
- $(am__objects_50) $(am__objects_51) libgnu_la-nonblocking.lo \
- $(am__objects_52) $(am__objects_53) libgnu_la-openat-die.lo \
- $(am__objects_54) $(am__objects_55) libgnu_la-progname.lo \
- $(am__objects_56) $(am__objects_57) $(am__objects_58) \
- $(am__objects_59) libgnu_la-gl_rbtree_list.lo \
- $(am__objects_60) $(am__objects_61) $(am__objects_62) \
- $(am__objects_63) $(am__objects_64) $(am__objects_65) \
- $(am__objects_66) libgnu_la-renameatu.lo $(am__objects_67) \
- $(am__objects_68) libgnu_la-save-cwd.lo \
- malloc/libgnu_la-scratch_buffer_dupfree.lo \
+ $(am__objects_27) $(am__objects_28) $(am__objects_29) \
+ libgnu_la-gettime.lo $(am__objects_30) \
+ malloc/libgnu_la-dynarray_at_failure.lo \
+ malloc/libgnu_la-dynarray_emplace_enlarge.lo \
+ malloc/libgnu_la-dynarray_finalize.lo \
+ malloc/libgnu_la-dynarray_resize.lo \
+ malloc/libgnu_la-dynarray_resize_clear.lo \
malloc/libgnu_la-scratch_buffer_grow.lo \
malloc/libgnu_la-scratch_buffer_grow_preserve.lo \
malloc/libgnu_la-scratch_buffer_set_array_size.lo \
- $(am__objects_69) libgnu_la-gl_set.lo $(am__objects_70) \
- libgnu_la-setlocale_null.lo $(am__objects_71) \
- $(am__objects_72) libgnu_la-sig-handler.lo $(am__objects_73) \
- $(am__objects_74) libgnu_la-sockets.lo $(am__objects_75) \
- libgnu_la-stat-time.lo $(am__objects_76) $(am__objects_77) \
- libgnu_la-stdopen.lo $(am__objects_78) $(am__objects_79) \
- $(am__objects_80) $(am__objects_81) $(am__objects_82) \
- $(am__objects_83) $(am__objects_84) $(am__objects_85) \
- $(am__objects_86) libgnu_la-strnlen1.lo $(am__objects_87) \
+ $(am__objects_31) $(am__objects_32) libgnu_la-hard-locale.lo \
+ libgnu_la-hash.lo libgnu_la-gl_hash_map.lo \
+ libgnu_la-hash-pjw.lo libgnu_la-hash-pjw-bare.lo \
+ libgnu_la-gl_hash_set.lo libgnu_la-hash-triple-simple.lo \
+ libgnu_la-ialloc.lo libgnu_la-idpriv-drop.lo \
+ libgnu_la-idpriv-droptemp.lo $(am__objects_33) \
+ $(am__objects_34) $(am__objects_35) \
+ libgnu_la-gl_linkedhash_list.lo libgnu_la-gl_list.lo \
+ libgnu_la-localcharset.lo $(am__objects_36) \
+ glthread/libgnu_la-lock.lo $(am__objects_37) \
+ libgnu_la-malloca.lo libgnu_la-gl_map.lo $(am__objects_38) \
+ $(am__objects_39) $(am__objects_40) $(am__objects_41) \
+ $(am__objects_42) $(am__objects_43) $(am__objects_44) \
+ $(am__objects_45) $(am__objects_46) $(am__objects_47) \
+ $(am__objects_48) $(am__objects_49) $(am__objects_50) \
+ $(am__objects_51) $(am__objects_52) libgnu_la-nonblocking.lo \
+ $(am__objects_53) $(am__objects_54) libgnu_la-openat-die.lo \
+ $(am__objects_55) $(am__objects_56) libgnu_la-progname.lo \
+ $(am__objects_57) $(am__objects_58) $(am__objects_59) \
+ $(am__objects_60) libgnu_la-gl_rbtree_list.lo \
+ $(am__objects_61) $(am__objects_62) $(am__objects_63) \
+ $(am__objects_64) $(am__objects_65) $(am__objects_66) \
+ $(am__objects_67) libgnu_la-renameatu.lo $(am__objects_68) \
+ $(am__objects_69) libgnu_la-save-cwd.lo $(am__objects_70) \
+ libgnu_la-gl_set.lo $(am__objects_71) \
+ libgnu_la-setlocale_null.lo $(am__objects_72) \
+ $(am__objects_73) libgnu_la-sig-handler.lo $(am__objects_74) \
+ $(am__objects_75) libgnu_la-sockets.lo $(am__objects_76) \
+ libgnu_la-stat-time.lo $(am__objects_77) $(am__objects_78) \
+ libgnu_la-stdopen.lo $(am__objects_79) $(am__objects_80) \
+ $(am__objects_81) $(am__objects_82) $(am__objects_83) \
+ $(am__objects_84) $(am__objects_85) $(am__objects_86) \
+ $(am__objects_87) libgnu_la-strnlen1.lo $(am__objects_88) \
libgnu_la-sys_socket.lo libgnu_la-tempname.lo \
glthread/libgnu_la-threadlib.lo libgnu_la-timespec.lo \
libgnu_la-unistd.lo libgnu_la-dup-safer.lo \
libgnu_la-fd-safer.lo libgnu_la-pipe-safer.lo \
- $(am__objects_88) $(am__objects_89) $(am__objects_90) \
- libgnu_la-utimens.lo libgnu_la-verror.lo $(am__objects_91) \
- libgnu_la-wctype-h.lo $(am__objects_92) $(am__objects_93) \
- $(am__objects_94) $(am__objects_95) $(am__objects_96) \
- $(am__objects_97) libgnu_la-xmalloc.lo libgnu_la-xalloc-die.lo \
+ $(am__objects_89) $(am__objects_90) $(am__objects_91) \
+ libgnu_la-utimens.lo libgnu_la-verror.lo $(am__objects_92) \
+ libgnu_la-wctype-h.lo $(am__objects_93) $(am__objects_94) \
+ $(am__objects_95) $(am__objects_96) $(am__objects_97) \
+ $(am__objects_98) libgnu_la-xmalloc.lo libgnu_la-xalloc-die.lo \
libgnu_la-xgetcwd.lo libgnu_la-gl_xlist.lo \
libgnu_la-gl_xmap.lo libgnu_la-gl_xset.lo libgnu_la-xsize.lo \
libgnu_la-xstdopen.lo libgnu_la-xstrndup.lo \
@@ -964,7 +968,6 @@ am__depfiles_remade = ./$(DEPDIR)/alloca.Plo \
malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo \
malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo \
malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo \
- malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo \
malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo \
malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo \
malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
@@ -1067,6 +1070,7 @@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
AR = @AR@
ARFLAGS = @ARFLAGS@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
+ASSERT_H = @ASSERT_H@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -1080,6 +1084,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CLOCK_TIME_LIB = @CLOCK_TIME_LIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
@@ -1089,6 +1094,7 @@ DBLIBS = @DBLIBS@
DBTYPE = @DBTYPE@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DIR_HAS_FD_MEMBER = @DIR_HAS_FD_MEMBER@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
@@ -1109,8 +1115,10 @@ FGREP = @FGREP@
FILECMD = @FILECMD@
FLOAT_H = @FLOAT_H@
FNMATCH_H = @FNMATCH_H@
+GETLOGIN_LIB = @GETLOGIN_LIB@
GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
GETOPT_H = @GETOPT_H@
+GETRANDOM_LIB = @GETRANDOM_LIB@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GLOB_H = @GLOB_H@
GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
@@ -1207,6 +1215,7 @@ GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETPROGNAME = @GL_GNULIB_GETPROGNAME@
GL_GNULIB_GETRANDOM = @GL_GNULIB_GETRANDOM@
GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
@@ -1257,6 +1266,7 @@ GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBSTOWCS = @GL_GNULIB_MBSTOWCS@
GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
@@ -1304,6 +1314,7 @@ GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
@@ -1420,6 +1431,7 @@ GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
GL_GNULIB_TCGETSID = @GL_GNULIB_TCGETSID@
+GL_GNULIB_TIME = @GL_GNULIB_TIME@
GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
@@ -1495,6 +1507,7 @@ GMSGFMT_015 = @GMSGFMT_015@
GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
GREP = @GREP@
+HARD_LOCALE_LIB = @HARD_LOCALE_LIB@
HAVE_ACCEPT4 = @HAVE_ACCEPT4@
HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
@@ -1528,6 +1541,7 @@ HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_GETW = @HAVE_DECL_GETW@
HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
@@ -1535,6 +1549,8 @@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_PROGRAM_INVOCATION_NAME = @HAVE_DECL_PROGRAM_INVOCATION_NAME@
+HAVE_DECL_PUTW = @HAVE_DECL_PUTW@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
@@ -1560,6 +1576,9 @@ HAVE_DIRENT_H = @HAVE_DIRENT_H@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_ERROR = @HAVE_ERROR@
+HAVE_ERROR_AT_LINE = @HAVE_ERROR_AT_LINE@
+HAVE_ERROR_H = @HAVE_ERROR_H@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
HAVE_EXECVPE = @HAVE_EXECVPE@
HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
@@ -1592,6 +1611,7 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
HAVE_GETOPT_H = @HAVE_GETOPT_H@
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETPROGNAME = @HAVE_GETPROGNAME@
HAVE_GETRANDOM = @HAVE_GETRANDOM@
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
@@ -1601,6 +1621,9 @@ HAVE_GLOB_H = @HAVE_GLOB_H@
HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@
HAVE_GRANTPT = @HAVE_GRANTPT@
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_ICONV = @HAVE_ICONV@
+HAVE_IMAXABS = @HAVE_IMAXABS@
+HAVE_IMAXDIV = @HAVE_IMAXDIV@
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
HAVE_INITSTATE = @HAVE_INITSTATE@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
@@ -1627,6 +1650,7 @@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
HAVE_MBTOWC = @HAVE_MBTOWC@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFO = @HAVE_MKFIFO@
@@ -1784,7 +1808,6 @@ HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
HAVE_WMEMSET = @HAVE_WMEMSET@
HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
-HAVE__BOOL = @HAVE__BOOL@
HAVE__EXIT = @HAVE__EXIT@
IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
INCLUDE_NEXT = @INCLUDE_NEXT@
@@ -1798,6 +1821,10 @@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LC_COLLATE_IMPLEMENTED = @LC_COLLATE_IMPLEMENTED@
+LC_MONETARY_IMPLEMENTED = @LC_MONETARY_IMPLEMENTED@
+LC_NUMERIC_IMPLEMENTED = @LC_NUMERIC_IMPLEMENTED@
+LC_TIME_IMPLEMENTED = @LC_TIME_IMPLEMENTED@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
@@ -1848,13 +1875,18 @@ MAKEINFO = @MAKEINFO@
MANDIR_LAYOUT = @MANDIR_LAYOUT@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBDIRS = @MAN_SUBDIRS@
+MBRTOWC_LIB = @MBRTOWC_LIB@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
+NANOSLEEP_LIB = @NANOSLEEP_LIB@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_ERROR_H = @NEXT_AS_FIRST_DIRECTIVE_ERROR_H@
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@
@@ -1891,6 +1923,7 @@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
NEXT_CTYPE_H = @NEXT_CTYPE_H@
NEXT_DIRENT_H = @NEXT_DIRENT_H@
NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_ERROR_H = @NEXT_ERROR_H@
NEXT_FCNTL_H = @NEXT_FCNTL_H@
NEXT_FLOAT_H = @NEXT_FLOAT_H@
NEXT_FNMATCH_H = @NEXT_FNMATCH_H@
@@ -1947,6 +1980,7 @@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRIPTR_PREFIX = @PRIPTR_PREFIX@
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTHREAD_SIGMASK_LIB = @PTHREAD_SIGMASK_LIB@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_ACCESS = @REPLACE_ACCESS@
@@ -1966,7 +2000,10 @@ REPLACE_DIRFD = @REPLACE_DIRFD@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP = @REPLACE_DUP@
REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUP3 = @REPLACE_DUP3@
REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_ERROR = @REPLACE_ERROR@
+REPLACE_ERROR_AT_LINE = @REPLACE_ERROR_AT_LINE@
REPLACE_EXECL = @REPLACE_EXECL@
REPLACE_EXECLE = @REPLACE_EXECLE@
REPLACE_EXECLP = @REPLACE_EXECLP@
@@ -1979,6 +2016,7 @@ REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDATASYNC = @REPLACE_FDATASYNC@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
@@ -2003,17 +2041,23 @@ REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETENTROPY = @REPLACE_GETENTROPY@
REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOADAVG = @REPLACE_GETLOADAVG@
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETPASS = @REPLACE_GETPASS@
REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GETPROGNAME = @REPLACE_GETPROGNAME@
REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
+REPLACE_GETSUBOPT = @REPLACE_GETSUBOPT@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_GLOB = @REPLACE_GLOB@
REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@
REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_IMAXABS = @REPLACE_IMAXABS@
+REPLACE_IMAXDIV = @REPLACE_IMAXDIV@
REPLACE_INITSTATE = @REPLACE_INITSTATE@
REPLACE_IOCTL = @REPLACE_IOCTL@
REPLACE_ISATTY = @REPLACE_ISATTY@
@@ -2038,14 +2082,19 @@ REPLACE_MBSINIT = @REPLACE_MBSINIT@
REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBSTOWCS = @REPLACE_MBSTOWCS@
REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MB_CUR_MAX = @REPLACE_MB_CUR_MAX@
REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MEMPCPY = @REPLACE_MEMPCPY@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKFIFO = @REPLACE_MKFIFO@
REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
REPLACE_MKNOD = @REPLACE_MKNOD@
REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKOSTEMP = @REPLACE_MKOSTEMP@
+REPLACE_MKOSTEMPS = @REPLACE_MKOSTEMPS@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
REPLACE_MKTIME = @REPLACE_MKTIME@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
@@ -2057,8 +2106,10 @@ REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_OPENAT = @REPLACE_OPENAT@
REPLACE_OPENDIR = @REPLACE_OPENDIR@
REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_PIPE2 = @REPLACE_PIPE2@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_POSIX_OPENPT = @REPLACE_POSIX_OPENPT@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PSELECT = @REPLACE_PSELECT@
@@ -2072,6 +2123,7 @@ REPLACE_RAISE = @REPLACE_RAISE@
REPLACE_RANDOM = @REPLACE_RANDOM@
REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
REPLACE_READ = @REPLACE_READ@
+REPLACE_READDIR = @REPLACE_READDIR@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_READLINKAT = @REPLACE_READLINKAT@
REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
@@ -2081,9 +2133,11 @@ REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_REWINDDIR = @REPLACE_REWINDDIR@
REPLACE_RMDIR = @REPLACE_RMDIR@
REPLACE_SELECT = @REPLACE_SELECT@
REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETHOSTNAME = @REPLACE_SETHOSTNAME@
REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
REPLACE_SETSTATE = @REPLACE_SETSTATE@
REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -2092,6 +2146,7 @@ REPLACE_SPRINTF = @REPLACE_SPRINTF@
REPLACE_STAT = @REPLACE_STAT@
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPCPY = @REPLACE_STPCPY@
REPLACE_STPNCPY = @REPLACE_STPNCPY@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
@@ -2118,7 +2173,9 @@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TIME = @REPLACE_TIME@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TIMESPEC_GET = @REPLACE_TIMESPEC_GET@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
@@ -2137,23 +2194,31 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSCMP = @REPLACE_WCSCMP@
REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNCMP = @REPLACE_WCSNCMP@
REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSSTR = @REPLACE_WCSSTR@
REPLACE_WCSTOK = @REPLACE_WCSTOK@
REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
REPLACE_WCTOB = @REPLACE_WCTOB@
REPLACE_WCTOMB = @REPLACE_WCTOMB@
REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WMEMCMP = @REPLACE_WMEMCMP@
+REPLACE_WMEMPCPY = @REPLACE_WMEMPCPY@
REPLACE_WRITE = @REPLACE_WRITE@
+REPLACE__EXIT = @REPLACE__EXIT@
+SCHED_YIELD_LIB = @SCHED_YIELD_LIB@
SED = @SED@
+SELECT_LIB = @SELECT_LIB@
+SETLOCALE_NULL_LIB = @SETLOCALE_NULL_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
-STDALIGN_H = @STDALIGN_H@
STDARG_H = @STDARG_H@
-STDBOOL_H = @STDBOOL_H@
+STDCKDINT_H = @STDCKDINT_H@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
@@ -2312,82 +2377,86 @@ SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES = libgnu.la
-EXTRA_DIST = alloca.c alloca.in.h assure.h attribute.h basename-lgpl.h \
- calloc.c calloc.c canonicalize.h chdir-long.h cloexec.h \
- dirent-private.h ctype.in.h dirent.in.h stripslash.c dirname.h \
- dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h \
- eloop-threshold.h errno.in.h error.h exitfail.h fcntl.in.h \
- fd-hook.h file-set.h filename.h filenamecat.h flexmember.h \
- float.in.h fnmatch.c fnmatch_loop.c fnmatch.c fnmatch.in.h \
- stat-w32.c stat-w32.h at-func.c getopt-cdefs.in.h \
+EXTRA_DIST = alloca.c alloca.in.h assert.in.h verify.h assure.h \
+ attribute.h basename-lgpl.h calloc.c calloc.c canonicalize.h \
+ chdir-long.h cloexec.h dirent-private.h ctype.in.h dirent.in.h \
+ dirent-private.h stripslash.c dirname.h eloop-threshold.h \
+ errno.in.h error.in.h exitfail.h fcntl.in.h fd-hook.h \
+ dirent-private.h file-set.h filename.h filenamecat.h \
+ flexmember.h float.in.h fnmatch.c fnmatch_loop.c fnmatch.c \
+ fnmatch.in.h stat-w32.c stat-w32.h at-func.c getopt-cdefs.in.h \
getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h \
- getopt.in.h getopt_int.h \
- $(top_srcdir)/build-aux/gitlog-to-changelog glob_internal.h \
+ getopt.in.h getopt_int.h getprogname.h \
+ $(top_srcdir)/build-aux/gitlog-to-changelog dynarray.h \
+ malloc/dynarray-skeleton.c malloc/dynarray.h \
+ malloc/scratch_buffer.h scratch_buffer.h glob_internal.h \
glob-libc.h glob.in.h $(top_srcdir)/build-aux/gnupload \
hard-locale.h hash.h hash-triple.h \
$(top_srcdir)/build-aux/config.rpath ialloc.h idpriv.h \
- idpriv.h intprops.h inttypes.in.h w32sock.h langinfo.in.h \
- cdefs.h libc-config.h limits.in.h localcharset.h locale.in.h \
- malloc.c malloc.c malloca.h lc-charset-dispatch.c \
- lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h \
- mbtowc-lock.c mbtowc-lock.h windows-initguard.h \
- mbsrtowcs-impl.h mbsrtowcs-state.c mbtowc-impl.h \
- memchr.valgrind memmem.c memmem.c str-two-way.h msvc-inval.h \
- msvc-nothrow.h windows-initguard.h nonblocking.h stdio-read.c \
- stdio-write.c openat.h dirent-private.h pathmax.h \
+ idpriv.h intprops-internal.h intprops.h inttypes.in.h \
+ w32sock.h langinfo.in.h cdefs.h libc-config.h limits.in.h \
+ localcharset.h locale.in.h malloc.c malloc.c malloca.h \
+ lc-charset-dispatch.c lc-charset-dispatch.h \
+ mbrtowc-impl-utf8.h mbrtowc-impl.h mbtowc-lock.c mbtowc-lock.h \
+ windows-initguard.h mbsrtowcs-impl.h mbsrtowcs-state.c \
+ mbtowc-impl.h memchr.valgrind memmem.c memmem.c str-two-way.h \
+ msvc-inval.h msvc-nothrow.h windows-initguard.h nonblocking.h \
+ stdio-read.c stdio-write.c openat.h dirent-private.h pathmax.h \
rawmemchr.valgrind dirent-private.h at-func.c realloc.c \
realloc.c regcomp.c regex.h regex_internal.c regex_internal.h \
regexec.c at-func2.c at-func2.c renameatu.h dirent-private.h \
- same-inode.h save-cwd.h malloc/scratch_buffer.h \
- scratch_buffer.h setlocale_null.h windows-initguard.h \
+ same-inode.h save-cwd.h setlocale_null.h windows-initguard.h \
sig-handler.h signal.in.h stdio-write.c _Noreturn.h \
arg-nonnull.h c++defs.h warn-on-use.h w32sock.h stat-w32.c \
- stat-w32.h stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h \
- stddef.in.h stdint.in.h stdio.in.h stdlib.in.h stdopen.h \
- strcasestr.c str-two-way.h strcasestr.c strchrnul.valgrind \
- streq.h strerror-override.h string.in.h strings.in.h \
- sys_file.in.h sys_ioctl.in.h sys_random.in.h sys_select.in.h \
- sys_socket.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \
- sys_uio.in.h sysexits.in.h tempname.h termios.in.h time.in.h \
- timespec.h unistd.in.h unistd--.h unistd-safer.h at-func.c \
- utime.in.h utimens.h asnprintf.c float+.h printf-args.c \
- printf-args.h printf-parse.c printf-parse.h vasnprintf.c \
- vasnprintf.h asprintf.c vasprintf.c verify.h vsnprintf.c \
- wchar.in.h wctype.in.h windows-initguard.h windows-mutex.h \
- windows-once.h windows-initguard.h windows-recmutex.h \
- windows-initguard.h windows-rwlock.h wmemchr-impl.h xalloc.h \
- xalloc.h xalloc-oversized.h xgetcwd.h xstdopen.h xalloc.h
-BUILT_SOURCES = $(ALLOCA_H) ctype.h dirent.h malloc/dynarray.gl.h \
- malloc/dynarray-skeleton.gl.h $(ERRNO_H) fcntl.h $(FLOAT_H) \
- $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) $(GLOB_H) \
- glob-libc.gl.h inttypes.h langinfo.h $(LIMITS_H) locale.h \
- malloc/scratch_buffer.gl.h signal.h $(STDALIGN_H) $(STDARG_H) \
- $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h string.h \
- strings.h sys/file.h sys/ioctl.h sys/random.h sys/select.h \
- sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h \
- $(SYSEXITS_H) termios.h time.h unistd.h utime.h wchar.h \
- wctype.h
+ stat-w32.h stat-time.h stdarg.in.h intprops-internal.h \
+ stdckdint.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
+ stdopen.h strcasestr.c str-two-way.h strcasestr.c \
+ strchrnul.valgrind streq.h strerror-override.h string.in.h \
+ strings.in.h sys_file.in.h sys_ioctl.in.h sys_random.in.h \
+ sys_select.in.h sys_socket.in.h sys_stat.in.h sys_time.in.h \
+ sys_types.in.h sys_uio.in.h sysexits.in.h tempname.h \
+ termios.in.h time.in.h timespec.h unistd.in.h unistd--.h \
+ unistd-safer.h at-func.c utime.in.h utimens.h asnprintf.c \
+ float+.h printf-args.c printf-args.h printf-parse.c \
+ printf-parse.h vasnprintf.c vasnprintf.h asprintf.c \
+ vasprintf.c verify.h vsnprintf.c wchar.in.h wctype.in.h \
+ windows-initguard.h windows-mutex.h windows-once.h \
+ windows-initguard.h windows-recmutex.h windows-initguard.h \
+ windows-rwlock.h wmemchr-impl.h xalloc.h xalloc.h \
+ xalloc-oversized.h xgetcwd.h xstdopen.h xalloc.h
+BUILT_SOURCES = $(ALLOCA_H) $(ASSERT_H) ctype.h dirent.h $(ERRNO_H) \
+ error.h fcntl.h $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) \
+ $(GETOPT_CDEFS_H) malloc/dynarray.gl.h \
+ malloc/dynarray-skeleton.gl.h malloc/scratch_buffer.gl.h \
+ $(GLOB_H) glob-libc.gl.h inttypes.h langinfo.h $(LIMITS_H) \
+ locale.h signal.h $(STDARG_H) $(STDCKDINT_H) $(STDDEF_H) \
+ $(STDINT_H) stdio.h stdlib.h string.h strings.h sys/file.h \
+ sys/ioctl.h sys/random.h sys/select.h sys/socket.h sys/stat.h \
+ sys/time.h sys/types.h sys/uio.h $(SYSEXITS_H) termios.h \
+ time.h unistd.h utime.h wchar.h wctype.h
SUFFIXES =
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \
- ctype.h-t dirent.h dirent.h-t malloc/dynarray.gl.h \
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t assert.h \
+ assert.h-t ctype.h ctype.h-t dirent.h dirent.h-t errno.h \
+ errno.h-t error.h error.h-t fcntl.h fcntl.h-t float.h \
+ float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t \
+ getopt-cdefs.h getopt-cdefs.h-t malloc/dynarray.gl.h \
malloc/dynarray.gl.h-t malloc/dynarray-skeleton.gl.h \
- malloc/dynarray-skeleton.gl.h-t errno.h errno.h-t fcntl.h \
- fcntl.h-t float.h float.h-t fnmatch.h fnmatch.h-t getopt.h \
- getopt.h-t getopt-cdefs.h getopt-cdefs.h-t glob.h glob.h-t \
- glob-libc.gl.h glob-libc.gl.h-t inttypes.h inttypes.h-t \
- langinfo.h langinfo.h-t limits.h limits.h-t locale.h \
- locale.h-t malloc/scratch_buffer.gl.h \
- malloc/scratch_buffer.gl.h-t signal.h signal.h-t stdalign.h \
- stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \
- stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
- stdlib.h stdlib.h-t string.h string.h-t strings.h strings.h-t \
- sys/file.h sys/file.h-t sys/ioctl.h sys/ioctl.h-t sys/random.h \
- sys/random.h-t sys/select.h sys/select.h-t sys/socket.h \
- sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
- sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t sysexits.h \
- sysexits.h-t termios.h termios.h-t time.h time.h-t unistd.h \
- unistd.h-t utime.h utime.h-t wchar.h wchar.h-t wctype.h \
- wctype.h-t
+ malloc/dynarray-skeleton.gl.h-t malloc/scratch_buffer.gl.h \
+ malloc/scratch_buffer.gl.h-t glob.h glob.h-t glob-libc.gl.h \
+ glob-libc.gl.h-t inttypes.h inttypes.h-t langinfo.h \
+ langinfo.h-t limits.h limits.h-t locale.h locale.h-t signal.h \
+ signal.h-t stdarg.h stdarg.h-t stdckdint.h stdckdint.h-t \
+ stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t1 \
+ stdio.h-t2 stdio.h-t3 stdlib.h stdlib.h-t1 stdlib.h-t2 \
+ stdlib.h-t3 string.h string.h-t1 string.h-t2 strings.h \
+ strings.h-t sys/file.h sys/file.h-t sys/ioctl.h sys/ioctl.h-t \
+ sys/random.h sys/random.h-t sys/select.h sys/select.h-t \
+ sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h \
+ sys/time.h-t sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t \
+ sysexits.h sysexits.h-t termios.h termios.h-t time.h time.h-t \
+ unistd.h unistd.h-t1 unistd.h-t2 unistd.h-t3 unistd.h-t4 \
+ utime.h utime.h-t wchar.h wchar.h-t1 wchar.h-t2 wchar.h-t3 \
+ wctype.h wctype.h-t
MOSTLYCLEANDIRS = sys sys sys sys sys sys sys
CLEANFILES =
DISTCLEANFILES =
@@ -2403,81 +2472,79 @@ libgnu_la_SOURCES = argp.h argp-ba.c argp-eexst.c argp-fmtstream.c \
canonicalize.c $(am__append_2) $(am__append_3) $(am__append_4) \
$(am__append_5) cloexec.c $(am__append_6) $(am__append_7) \
$(am__append_8) dirname.c basename.c dirname-lgpl.c \
- stripslash.c $(am__append_9) $(am__append_10) \
- malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
- malloc/dynarray_finalize.c malloc/dynarray_resize.c \
- malloc/dynarray_resize_clear.c $(am__append_11) exitfail.c \
- $(am__append_12) $(am__append_13) fd-hook.c fd-safer-flag.c \
- dup-safer-flag.c $(am__append_14) file-set.c \
+ stripslash.c $(am__append_9) $(am__append_10) $(am__append_11) \
+ exitfail.c $(am__append_12) $(am__append_13) fd-hook.c \
+ fd-safer-flag.c dup-safer-flag.c $(am__append_14) file-set.c \
filenamecat-lgpl.c $(am__append_15) $(am__append_16) \
$(am__append_17) $(am__append_18) $(am__append_19) \
$(am__append_20) $(am__append_21) $(am__append_22) \
$(am__append_23) $(am__append_24) $(am__append_25) \
- $(am__append_26) $(am__append_27) getprogname.h getprogname.c \
- $(am__append_28) gettext.h gettime.c $(am__append_29) \
- $(am__append_30) $(am__append_31) hard-locale.c hash.c \
- gl_hash_map.h gl_hash_map.c gl_anyhash1.h gl_anyhash2.h \
- gl_anyhash_primes.h hash-pjw.h hash-pjw.c hash-pjw-bare.h \
- hash-pjw-bare.c gl_hash_set.h gl_hash_set.c gl_anyhash1.h \
- gl_anyhash2.h gl_anyhash_primes.h hash-triple-simple.c \
- ialloc.c idpriv-drop.c idpriv-droptemp.c idx.h \
- $(am__append_32) $(am__append_33) $(am__append_34) \
- gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash1.h \
- gl_anyhash2.h gl_anyhash_primes.h gl_anylinked_list1.h \
- gl_anylinked_list2.h gl_list.h gl_list.c localcharset.c \
- $(am__append_35) glthread/lock.h glthread/lock.c \
- $(am__append_36) malloca.c gl_map.h gl_map.c $(am__append_37) \
- $(am__append_38) $(am__append_39) $(am__append_40) \
- $(am__append_41) $(am__append_42) $(am__append_43) minmax.h \
- $(am__append_44) $(am__append_45) $(am__append_46) \
- $(am__append_47) $(am__append_48) $(am__append_49) \
- $(am__append_50) $(am__append_51) nonblocking.c \
- $(am__append_52) $(am__append_53) openat-die.c \
- $(am__append_54) $(am__append_55) progname.h progname.c \
- $(am__append_56) $(am__append_57) $(am__append_58) \
- $(am__append_59) gl_rbtree_list.h gl_rbtree_list.c \
- gl_anyrbtree_list1.h gl_anyrbtree_list2.h gl_anytree_list1.h \
- gl_anytree_list2.h $(am__append_60) $(am__append_61) \
- $(am__append_62) $(am__append_63) $(am__append_64) \
- $(am__append_65) $(am__append_66) renameatu.c $(am__append_67) \
- $(am__append_68) save-cwd.c malloc/scratch_buffer_dupfree.c \
- malloc/scratch_buffer_grow.c \
+ $(am__append_26) $(am__append_27) $(am__append_28) \
+ $(am__append_29) gettext.h gettime.c $(am__append_30) \
+ malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
+ malloc/dynarray_finalize.c malloc/dynarray_resize.c \
+ malloc/dynarray_resize_clear.c malloc/scratch_buffer_grow.c \
malloc/scratch_buffer_grow_preserve.c \
- malloc/scratch_buffer_set_array_size.c $(am__append_69) \
- gl_set.h gl_set.c $(am__append_70) setlocale_null.c \
- $(am__append_71) $(am__append_72) sig-handler.c \
- $(am__append_73) size_max.h $(am__append_74) sockets.h \
- sockets.c $(am__append_75) stat-time.c $(am__append_76) \
- $(am__append_77) stdopen.c $(am__append_78) $(am__append_79) \
+ malloc/scratch_buffer_set_array_size.c $(am__append_31) \
+ $(am__append_32) hard-locale.c hash.c gl_hash_map.h \
+ gl_hash_map.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h \
+ hash-pjw.h hash-pjw.c hash-pjw-bare.h hash-pjw-bare.c \
+ gl_hash_set.h gl_hash_set.c gl_anyhash1.h gl_anyhash2.h \
+ gl_anyhash_primes.h hash-triple-simple.c ialloc.c \
+ idpriv-drop.c idpriv-droptemp.c idx.h $(am__append_33) \
+ $(am__append_34) $(am__append_35) gl_linkedhash_list.h \
+ gl_linkedhash_list.c gl_anyhash1.h gl_anyhash2.h \
+ gl_anyhash_primes.h gl_anylinked_list1.h gl_anylinked_list2.h \
+ gl_list.h gl_list.c localcharset.c $(am__append_36) \
+ glthread/lock.h glthread/lock.c $(am__append_37) malloca.c \
+ gl_map.h gl_map.c $(am__append_38) $(am__append_39) \
+ $(am__append_40) $(am__append_41) $(am__append_42) \
+ $(am__append_43) $(am__append_44) minmax.h $(am__append_45) \
+ $(am__append_46) $(am__append_47) $(am__append_48) \
+ $(am__append_49) $(am__append_50) $(am__append_51) \
+ $(am__append_52) nonblocking.c $(am__append_53) \
+ $(am__append_54) openat-die.c $(am__append_55) \
+ $(am__append_56) progname.h progname.c $(am__append_57) \
+ $(am__append_58) $(am__append_59) $(am__append_60) \
+ gl_rbtree_list.h gl_rbtree_list.c gl_anyrbtree_list1.h \
+ gl_anyrbtree_list2.h gl_anytree_list1.h gl_anytree_list2.h \
+ $(am__append_61) $(am__append_62) $(am__append_63) \
+ $(am__append_64) $(am__append_65) $(am__append_66) \
+ $(am__append_67) renameatu.c $(am__append_68) $(am__append_69) \
+ save-cwd.c $(am__append_70) gl_set.h gl_set.c $(am__append_71) \
+ setlocale_null.c $(am__append_72) $(am__append_73) \
+ sig-handler.c $(am__append_74) size_max.h $(am__append_75) \
+ sockets.h sockets.c $(am__append_76) stat-time.c \
+ $(am__append_77) $(am__append_78) stdopen.c $(am__append_79) \
$(am__append_80) $(am__append_81) $(am__append_82) \
$(am__append_83) $(am__append_84) $(am__append_85) \
- $(am__append_86) strnlen1.h strnlen1.c $(am__append_87) \
- sys_socket.c tempname.c glthread/threadlib.c timespec.c \
- unistd.c dup-safer.c fd-safer.c pipe-safer.c $(am__append_88) \
- $(am__append_89) $(am__append_90) utimens.c verror.h verror.c \
- $(am__append_91) wctype-h.c $(am__append_92) $(am__append_93) \
+ $(am__append_86) $(am__append_87) strnlen1.h strnlen1.c \
+ $(am__append_88) sys_socket.c tempname.c glthread/threadlib.c \
+ timespec.c unistd.c dup-safer.c fd-safer.c pipe-safer.c \
+ $(am__append_89) $(am__append_90) $(am__append_91) utimens.c \
+ verror.h verror.c $(am__append_92) wctype-h.c $(am__append_93) \
$(am__append_94) $(am__append_95) $(am__append_96) \
- $(am__append_97) xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h \
- gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h gl_xset.c xsize.h \
- xsize.c xstdopen.c xstrndup.h xstrndup.c xvasprintf.h \
- xvasprintf.c xasprintf.c
+ $(am__append_97) $(am__append_98) xmalloc.c xalloc-die.c \
+ xgetcwd.c gl_xlist.h gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h \
+ gl_xset.c xsize.h xsize.c xstdopen.c xstrndup.h xstrndup.c \
+ xvasprintf.h xvasprintf.c xasprintf.c
libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
libgnu_la_LIBADD = $(gl_LTLIBOBJS) @LTALLOCA@
libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) @LTALLOCA@
EXTRA_libgnu_la_SOURCES = alloca.c calloc.c calloc.c stripslash.c \
- malloc/dynarray-skeleton.c fnmatch.c fnmatch_loop.c fnmatch.c \
- stat-w32.c at-func.c malloc.c malloc.c lc-charset-dispatch.c \
- mbtowc-lock.c mbsrtowcs-state.c memmem.c memmem.c stdio-read.c \
- stdio-write.c at-func.c realloc.c realloc.c regcomp.c \
- regex_internal.c regexec.c at-func2.c at-func2.c stdio-write.c \
- stat-w32.c strcasestr.c strcasestr.c at-func.c asnprintf.c \
- printf-args.c printf-parse.c vasnprintf.c asprintf.c \
- vasprintf.c vsnprintf.c
-libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LIBSOCKET) \
- $(LIBTHREAD) $(LIB_CLOCK_GETTIME) $(LIB_GETLOGIN) \
- $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) \
- $(LIB_NANOSLEEP) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) \
- $(LIB_SETLOCALE_NULL) $(LTLIBINTL)
+ fnmatch.c fnmatch_loop.c fnmatch.c stat-w32.c at-func.c \
+ malloc/dynarray-skeleton.c malloc.c malloc.c \
+ lc-charset-dispatch.c mbtowc-lock.c mbsrtowcs-state.c memmem.c \
+ memmem.c stdio-read.c stdio-write.c at-func.c realloc.c \
+ realloc.c regcomp.c regex_internal.c regexec.c at-func2.c \
+ at-func2.c stdio-write.c stat-w32.c strcasestr.c strcasestr.c \
+ at-func.c asnprintf.c printf-args.c printf-parse.c \
+ vasnprintf.c asprintf.c vasprintf.c vsnprintf.c
+libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(CLOCK_TIME_LIB) \
+ $(GETLOGIN_LIB) $(GETRANDOM_LIB) $(HARD_LOCALE_LIB) \
+ $(LIBSOCKET) $(LIBTHREAD) $(LTLIBINTL) $(MBRTOWC_LIB) \
+ $(NANOSLEEP_LIB) $(PTHREAD_SIGMASK_LIB) $(SELECT_LIB) \
+ $(SETLOCALE_NULL_LIB)
# Use this preprocessor expression to decide whether #include_next works.
# Do not rely on a 'configure'-time test for this, since the expression
@@ -2582,6 +2649,12 @@ malloc/libgnu_la-dynarray_resize.lo: malloc/$(am__dirstamp) \
malloc/$(DEPDIR)/$(am__dirstamp)
malloc/libgnu_la-dynarray_resize_clear.lo: malloc/$(am__dirstamp) \
malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_grow.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_grow_preserve.lo: \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_set_array_size.lo: \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
glthread/$(am__dirstamp):
@$(MKDIR_P) glthread
@: > glthread/$(am__dirstamp)
@@ -2590,14 +2663,6 @@ glthread/$(DEPDIR)/$(am__dirstamp):
@: > glthread/$(DEPDIR)/$(am__dirstamp)
glthread/libgnu_la-lock.lo: glthread/$(am__dirstamp) \
glthread/$(DEPDIR)/$(am__dirstamp)
-malloc/libgnu_la-scratch_buffer_dupfree.lo: malloc/$(am__dirstamp) \
- malloc/$(DEPDIR)/$(am__dirstamp)
-malloc/libgnu_la-scratch_buffer_grow.lo: malloc/$(am__dirstamp) \
- malloc/$(DEPDIR)/$(am__dirstamp)
-malloc/libgnu_la-scratch_buffer_grow_preserve.lo: \
- malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
-malloc/libgnu_la-scratch_buffer_set_array_size.lo: \
- malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
glthread/libgnu_la-threadlib.lo: glthread/$(am__dirstamp) \
glthread/$(DEPDIR)/$(am__dirstamp)
malloc/libgnu_la-dynarray-skeleton.lo: malloc/$(am__dirstamp) \
@@ -2825,7 +2890,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo@am__quote@ # am--include-marker
@@ -3070,41 +3134,6 @@ libgnu_la-dup2.lo: dup2.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dup2.lo `test -f 'dup2.c' || echo '$(srcdir)/'`dup2.c
-malloc/libgnu_la-dynarray_at_failure.lo: malloc/dynarray_at_failure.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_at_failure.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_at_failure.c' object='malloc/libgnu_la-dynarray_at_failure.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
-
-malloc/libgnu_la-dynarray_emplace_enlarge.lo: malloc/dynarray_emplace_enlarge.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_emplace_enlarge.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_emplace_enlarge.c' object='malloc/libgnu_la-dynarray_emplace_enlarge.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
-
-malloc/libgnu_la-dynarray_finalize.lo: malloc/dynarray_finalize.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_finalize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_finalize.c' object='malloc/libgnu_la-dynarray_finalize.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
-
-malloc/libgnu_la-dynarray_resize.lo: malloc/dynarray_resize.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize.c' object='malloc/libgnu_la-dynarray_resize.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
-
-malloc/libgnu_la-dynarray_resize_clear.lo: malloc/dynarray_resize_clear.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize_clear.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize_clear.c' object='malloc/libgnu_la-dynarray_resize_clear.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
-
libgnu_la-error.lo: error.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-error.lo -MD -MP -MF $(DEPDIR)/libgnu_la-error.Tpo -c -o libgnu_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-error.Tpo $(DEPDIR)/libgnu_la-error.Plo
@@ -3301,6 +3330,62 @@ libgnu_la-gettimeofday.lo: gettimeofday.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gettimeofday.lo `test -f 'gettimeofday.c' || echo '$(srcdir)/'`gettimeofday.c
+malloc/libgnu_la-dynarray_at_failure.lo: malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_at_failure.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_at_failure.c' object='malloc/libgnu_la-dynarray_at_failure.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+
+malloc/libgnu_la-dynarray_emplace_enlarge.lo: malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_emplace_enlarge.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_emplace_enlarge.c' object='malloc/libgnu_la-dynarray_emplace_enlarge.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+
+malloc/libgnu_la-dynarray_finalize.lo: malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_finalize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_finalize.c' object='malloc/libgnu_la-dynarray_finalize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+
+malloc/libgnu_la-dynarray_resize.lo: malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize.c' object='malloc/libgnu_la-dynarray_resize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+
+malloc/libgnu_la-dynarray_resize_clear.lo: malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize_clear.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize_clear.c' object='malloc/libgnu_la-dynarray_resize_clear.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+
+malloc/libgnu_la-scratch_buffer_grow.lo: malloc/scratch_buffer_grow.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow.c' object='malloc/libgnu_la-scratch_buffer_grow.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
+
+malloc/libgnu_la-scratch_buffer_grow_preserve.lo: malloc/scratch_buffer_grow_preserve.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow_preserve.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow_preserve.c' object='malloc/libgnu_la-scratch_buffer_grow_preserve.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
+
+malloc/libgnu_la-scratch_buffer_set_array_size.lo: malloc/scratch_buffer_set_array_size.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_set_array_size.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_set_array_size.c' object='malloc/libgnu_la-scratch_buffer_set_array_size.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
+
libgnu_la-glob.lo: glob.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-glob.lo -MD -MP -MF $(DEPDIR)/libgnu_la-glob.Tpo -c -o libgnu_la-glob.lo `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-glob.Tpo $(DEPDIR)/libgnu_la-glob.Plo
@@ -3735,34 +3820,6 @@ libgnu_la-save-cwd.lo: save-cwd.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-save-cwd.lo `test -f 'save-cwd.c' || echo '$(srcdir)/'`save-cwd.c
-malloc/libgnu_la-scratch_buffer_dupfree.lo: malloc/scratch_buffer_dupfree.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_dupfree.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Tpo -c -o malloc/libgnu_la-scratch_buffer_dupfree.lo `test -f 'malloc/scratch_buffer_dupfree.c' || echo '$(srcdir)/'`malloc/scratch_buffer_dupfree.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_dupfree.c' object='malloc/libgnu_la-scratch_buffer_dupfree.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_dupfree.lo `test -f 'malloc/scratch_buffer_dupfree.c' || echo '$(srcdir)/'`malloc/scratch_buffer_dupfree.c
-
-malloc/libgnu_la-scratch_buffer_grow.lo: malloc/scratch_buffer_grow.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow.c' object='malloc/libgnu_la-scratch_buffer_grow.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
-
-malloc/libgnu_la-scratch_buffer_grow_preserve.lo: malloc/scratch_buffer_grow_preserve.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow_preserve.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow_preserve.c' object='malloc/libgnu_la-scratch_buffer_grow_preserve.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
-
-malloc/libgnu_la-scratch_buffer_set_array_size.lo: malloc/scratch_buffer_set_array_size.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_set_array_size.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_set_array_size.c' object='malloc/libgnu_la-scratch_buffer_set_array_size.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
-
libgnu_la-select.lo: select.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-select.lo -MD -MP -MF $(DEPDIR)/libgnu_la-select.Tpo -c -o libgnu_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-select.Tpo $(DEPDIR)/libgnu_la-select.Plo
@@ -4183,13 +4240,6 @@ libgnu_la-calloc.lo: calloc.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-calloc.lo `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c
-malloc/libgnu_la-dynarray-skeleton.lo: malloc/dynarray-skeleton.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray-skeleton.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray-skeleton.c' object='malloc/libgnu_la-dynarray-skeleton.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
-
libgnu_la-fnmatch.lo: fnmatch.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fnmatch.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fnmatch.Tpo -c -o libgnu_la-fnmatch.lo `test -f 'fnmatch.c' || echo '$(srcdir)/'`fnmatch.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fnmatch.Tpo $(DEPDIR)/libgnu_la-fnmatch.Plo
@@ -4218,6 +4268,13 @@ libgnu_la-at-func.lo: at-func.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-at-func.lo `test -f 'at-func.c' || echo '$(srcdir)/'`at-func.c
+malloc/libgnu_la-dynarray-skeleton.lo: malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray-skeleton.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray-skeleton.c' object='malloc/libgnu_la-dynarray-skeleton.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+
libgnu_la-malloc.lo: malloc.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-malloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-malloc.Tpo -c -o libgnu_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-malloc.Tpo $(DEPDIR)/libgnu_la-malloc.Plo
@@ -4770,7 +4827,6 @@ distclean: distclean-recursive
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
- -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
@@ -5028,7 +5084,6 @@ maintainer-clean: maintainer-clean-recursive
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
- -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
-rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
@@ -5083,6 +5138,25 @@ uninstall-am:
@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+# We need the following in order to create <assert.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ASSERT_H_TRUE@assert.h: assert.in.h verify.h $(top_builddir)/config.status
+@GL_GENERATE_ASSERT_H_TRUE@ $(gl_V_at){ $(SED_HEADER_STDOUT) \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''NEXT_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ < $(srcdir)/assert.in.h && \
+@GL_GENERATE_ASSERT_H_TRUE@ sed -e '/@assert.h omit start@/,/@assert.h omit end@/d' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_gl_verify|_gl_static_assert|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_GL\(_STATIC_ASSERT_H\)|_GL\1|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ < $(srcdir)/verify.h; \
+@GL_GENERATE_ASSERT_H_TRUE@ } > $@-t
+@GL_GENERATE_ASSERT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ASSERT_H_FALSE@assert.h: $(top_builddir)/config.status
+@GL_GENERATE_ASSERT_H_FALSE@ rm -f $@
+
# We need the following in order to create <ctype.h> when the system
# doesn't have one that works with the given compiler.
ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
@@ -5109,6 +5183,7 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''DIR_HAS_FD_MEMBER''@/$(DIR_HAS_FD_MEMBER)/g' \
-e 's/@''GNULIB_OPENDIR''@/$(GL_GNULIB_OPENDIR)/g' \
-e 's/@''GNULIB_READDIR''@/$(GL_GNULIB_READDIR)/g' \
-e 's/@''GNULIB_REWINDDIR''@/$(GL_GNULIB_REWINDDIR)/g' \
@@ -5127,6 +5202,8 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_READDIR''@|$(REPLACE_READDIR)|g' \
+ -e 's|@''REPLACE_REWINDDIR''@|$(REPLACE_REWINDDIR)|g' \
-e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
@@ -5136,25 +5213,6 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
$(srcdir)/dirent.in.h > $@-t
$(AM_V_at)mv $@-t $@
-malloc/dynarray.gl.h: malloc/dynarray.h
- $(AM_V_GEN)$(MKDIR_P) 'malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/dynarray.h > $@-t
- $(AM_V_at)mv $@-t $@
-
-malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
- $(AM_V_GEN)$(MKDIR_P) 'malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
- -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
- -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
- -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- $(srcdir)/malloc/dynarray-skeleton.c > $@-t
- $(AM_V_at)mv $@-t $@
-
# We need the following in order to create <errno.h> when the system
# doesn't have one that is POSIX compliant.
@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
@@ -5175,6 +5233,21 @@ malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@
+# We need the following in order to override <error.h>.
+error.h: error.in.h $(top_builddir)/config.status $(CXXDEFS_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_ERROR_H''@|$(HAVE_ERROR_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''NEXT_ERROR_H''@|$(NEXT_ERROR_H)|g' \
+ -e 's|@''HAVE_ERROR''@|$(HAVE_ERROR)|g' \
+ -e 's|@''HAVE_ERROR_AT_LINE''@|$(HAVE_ERROR_AT_LINE)|g' \
+ -e 's|@''REPLACE_ERROR''@|$(REPLACE_ERROR)|g' \
+ -e 's|@''REPLACE_ERROR_AT_LINE''@|$(REPLACE_ERROR_AT_LINE)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ $(srcdir)/error.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
# We need the following in order to create <fcntl.h> when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -5262,6 +5335,35 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
@GL_GENERATE_GETOPT_CDEFS_H_FALSE@getopt-cdefs.h: $(top_builddir)/config.status
@GL_GENERATE_GETOPT_CDEFS_H_FALSE@ rm -f $@
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/scratch_buffer.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
# We need the following in order to create <glob.h>.
@GL_GENERATE_GLOB_H_TRUE@glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@GL_GENERATE_GLOB_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
@@ -5317,6 +5419,8 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
-e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_IMAXABS''@/$(REPLACE_IMAXABS)/g' \
+ -e 's/@''REPLACE_IMAXDIV''@/$(REPLACE_IMAXDIV)/g' \
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
@@ -5397,16 +5501,6 @@ locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
$(srcdir)/locale.in.h > $@-t
$(AM_V_at)mv $@-t $@
-malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
- $(AM_V_GEN)$(MKDIR_P) 'malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/scratch_buffer.h > $@-t
- $(AM_V_at)mv $@-t $@
-
# We need the following in order to create <signal.h> when the system
# doesn't have a complete one.
signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -5438,14 +5532,6 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
$(srcdir)/signal.in.h > $@-t
$(AM_V_at)mv $@-t $@
-# We need the following in order to create <stdalign.h> when the system
-# doesn't have one that works.
-@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
-@GL_GENERATE_STDALIGN_H_TRUE@ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
-@GL_GENERATE_STDALIGN_H_TRUE@ $(AM_V_at)mv $@-t $@
-@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
-@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
-
# We need the following in order to create <stdarg.h> when the system
# doesn't have one that works with the given compiler.
@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status
@@ -5460,15 +5546,14 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
@GL_GENERATE_STDARG_H_FALSE@stdarg.h: $(top_builddir)/config.status
@GL_GENERATE_STDARG_H_FALSE@ rm -f $@
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
-@GL_GENERATE_STDBOOL_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
-@GL_GENERATE_STDBOOL_H_TRUE@ -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
-@GL_GENERATE_STDBOOL_H_TRUE@ $(srcdir)/stdbool.in.h > $@-t
-@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_at)mv $@-t $@
-@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status
-@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@
+# We need the following in order to create <stdckdint.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDCKDINT_H_TRUE@stdckdint.h: stdckdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(srcdir)/stdckdint.in.h > $@-t
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDCKDINT_H_FALSE@stdckdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDCKDINT_H_FALSE@ rm -f $@
# We need the following in order to create <stddef.h> when the system
# doesn't have one that works with the given compiler.
@@ -5592,14 +5677,17 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
-e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
-e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
- < $(srcdir)/stdio.in.h | \
- sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ < $(srcdir)/stdio.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
-e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_GETW''@|$(HAVE_DECL_GETW)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_PUTW''@|$(HAVE_DECL_PUTW)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
@@ -5610,6 +5698,8 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
@@ -5647,8 +5737,9 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
@@ -5668,10 +5759,12 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
-e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETPROGNAME''@/$(GL_GNULIB_GETPROGNAME)/g' \
-e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
-e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
-e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
-e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBSTOWCS''@/$(GL_GNULIB_MBSTOWCS)/g' \
-e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
-e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
@@ -5708,8 +5801,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
-e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
-e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
- < $(srcdir)/stdlib.in.h | \
- sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ < $(srcdir)/stdlib.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
@@ -5717,6 +5811,8 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
-e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_DECL_PROGRAM_INVOCATION_NAME''@|$(HAVE_DECL_PROGRAM_INVOCATION_NAME)|g' \
+ -e 's|@''HAVE_GETPROGNAME''@|$(HAVE_GETPROGNAME)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
-e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
@@ -5752,17 +5848,28 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE__EXIT''@|$(REPLACE__EXIT)|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' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_GETLOADAVG''@|$(REPLACE_GETLOADAVG)|g' \
+ -e 's|@''REPLACE_GETPROGNAME''@|$(REPLACE_GETPROGNAME)|g' \
+ -e 's|@''REPLACE_GETSUBOPT''@|$(REPLACE_GETSUBOPT)|g' \
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MB_CUR_MAX''@|$(REPLACE_MB_CUR_MAX)|g' \
+ -e 's|@''REPLACE_MBSTOWCS''@|$(REPLACE_MBSTOWCS)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKOSTEMP''@|$(REPLACE_MKOSTEMP)|g' \
+ -e 's|@''REPLACE_MKOSTEMPS''@|$(REPLACE_MKOSTEMPS)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_POSIX_OPENPT''@|$(REPLACE_POSIX_OPENPT)|g' \
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
@@ -5787,8 +5894,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(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)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
@@ -5820,6 +5928,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_MEMSET_EXPLICIT''@/$(GL_GNULIB_MEMSET_EXPLICIT)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
@@ -5843,14 +5952,16 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
-e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
- < $(srcdir)/string.in.h | \
- sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ < $(srcdir)/string.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
-e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_MEMSET_EXPLICIT''@|$(HAVE_MEMSET_EXPLICIT)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
@@ -5871,7 +5982,9 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
@@ -5889,8 +6002,9 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
+ < $@-t1 > $@-t2
+ $(AM_V_at)rm -f $@-t1
+ $(AM_V_at)mv $@-t2 $@
# We need the following in order to create <strings.h> when the system
# doesn't have one that works with the given compiler.
@@ -6192,6 +6306,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIME''@/$(GL_GNULIB_TIME)/g' \
-e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
-e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
-e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
@@ -6213,7 +6328,9 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -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_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' \
@@ -6260,6 +6377,8 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
-e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
-e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ < $(srcdir)/unistd.in.h > $@-t1
+ $(AM_V_at)sed \
-e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
@@ -6321,8 +6440,9 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
-e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
-e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
- < $(srcdir)/unistd.in.h | \
- sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
@@ -6369,13 +6489,15 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- | \
- sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ < $@-t2 > $@-t3
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
-e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_DUP3''@|$(REPLACE_DUP3)|g' \
-e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
-e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
-e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
@@ -6385,10 +6507,12 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
-e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FDATASYNC''@|$(REPLACE_FDATASYNC)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETENTROPY''@|$(REPLACE_GETENTROPY)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
@@ -6399,12 +6523,14 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PIPE2''@|$(REPLACE_PIPE2)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SETHOSTNAME''@|$(REPLACE_SETHOSTNAME)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
@@ -6420,8 +6546,9 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
+ < $@-t3 > $@-t4
+ $(AM_V_at)rm -f $@-t1 $@-t2 $@-t3
+ $(AM_V_at)mv $@-t4 $@
# We need the following in order to create <utime.h> when the system
# doesn't have one that works with the given compiler.
@@ -6499,8 +6626,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/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 | \
- sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ < $(srcdir)/wchar.in.h > $@-t1
+ $(AM_V_at)sed \
+ -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
-e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
-e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
@@ -6543,8 +6671,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
-e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- | \
- sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ < $@-t1 > $@-t2
+ $(AM_V_at)sed \
+ -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
-e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
-e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
@@ -6559,12 +6688,18 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
-e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSCMP''@|$(REPLACE_WCSCMP)|g' \
+ -e 's|@''REPLACE_WCSNCMP''@|$(REPLACE_WCSNCMP)|g' \
+ -e 's|@''REPLACE_WCSSTR''@|$(REPLACE_WCSSTR)|g' \
-e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e 's|@''REPLACE_WMEMCMP''@|$(REPLACE_WMEMCMP)|g' \
+ -e 's|@''REPLACE_WMEMPCPY''@|$(REPLACE_WMEMPCPY)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- > $@-t
- $(AM_V_at)mv $@-t $@
+ < $@-t2 > $@-t3
+ $(AM_V_at)rm -f $@-t1 $@-t2
+ $(AM_V_at)mv $@-t3 $@
# We need the following in order to create <wctype.h> when the system
# doesn't have one that works with the given compiler.
diff --git a/gl/lib/_Noreturn.h b/gl/lib/_Noreturn.h
index e914627a..6ecea98b 100644
--- a/gl/lib/_Noreturn.h
+++ b/gl/lib/_Noreturn.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that a function does not return.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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
@@ -26,6 +26,11 @@
AIX system header files and several gnulib header files use precisely
this syntax with 'extern'. */
# define _Noreturn [[noreturn]]
+# elif (defined __clang__ && __clang_major__ < 16 \
+ && defined _GL_WORK_AROUND_LLVM_BUG_59792)
+ /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+# define _Noreturn
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
diff --git a/gl/lib/alloca.in.h b/gl/lib/alloca.in.h
index e2b14613..a1bb3d75 100644
--- a/gl/lib/alloca.in.h
+++ b/gl/lib/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2022 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/arg-nonnull.h b/gl/lib/arg-nonnull.h
index e4513efe..9498ae1f 100644
--- a/gl/lib/arg-nonnull.h
+++ b/gl/lib/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/argp-ba.c b/gl/lib/argp-ba.c
index 5e43c75d..d0a9e98a 100644
--- a/gl/lib/argp-ba.c
+++ b/gl/lib/argp-ba.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-eexst.c b/gl/lib/argp-eexst.c
index 2f565d90..305b1294 100644
--- a/gl/lib/argp-eexst.c
+++ b/gl/lib/argp-eexst.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_ERR_EXIT_STATUS
- Copyright (C) 1997, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2009-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-fmtstream.c b/gl/lib/argp-fmtstream.c
index 78c29e38..7febb76c 100644
--- a/gl/lib/argp-fmtstream.c
+++ b/gl/lib/argp-fmtstream.c
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-fmtstream.h b/gl/lib/argp-fmtstream.h
index 0540b563..57385512 100644
--- a/gl/lib/argp-fmtstream.h
+++ b/gl/lib/argp-fmtstream.h
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams.
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -24,6 +24,12 @@
#ifndef _ARGP_FMTSTREAM_H
#define _ARGP_FMTSTREAM_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, __GL_INLINE, _GL_ATTRIBUTE_DEALLOC,
+ _GL_ATTRIBUTE_FORMAT. */
+#if !_LIBC && !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -187,9 +193,6 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
#define __argp_fmtstream_point argp_fmtstream_point
#define __argp_fmtstream_update _argp_fmtstream_update
#define __argp_fmtstream_ensure _argp_fmtstream_ensure
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef ARGP_FS_EI
# define ARGP_FS_EI _GL_INLINE
diff --git a/gl/lib/argp-fs-xinl.c b/gl/lib/argp-fs-xinl.c
index ea037f6d..afa331fc 100644
--- a/gl/lib/argp-fs-xinl.c
+++ b/gl/lib/argp-fs-xinl.c
@@ -1,5 +1,5 @@
/* Real definitions for extern inline functions in argp-fmtstream.h
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-help.c b/gl/lib/argp-help.c
index 397017fc..c509c0c7 100644
--- a/gl/lib/argp-help.c
+++ b/gl/lib/argp-help.c
@@ -1,5 +1,5 @@
/* Hierarchical argument parsing help output
- Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -26,7 +26,6 @@
#include <alloca.h>
#include <errno.h>
-#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
diff --git a/gl/lib/argp-namefrob.h b/gl/lib/argp-namefrob.h
index 9c82ac79..d6ec2951 100644
--- a/gl/lib/argp-namefrob.h
+++ b/gl/lib/argp-namefrob.h
@@ -1,5 +1,5 @@
/* Name frobnication for compiling argp outside of glibc
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-parse.c b/gl/lib/argp-parse.c
index 42027bc1..fb349b06 100644
--- a/gl/lib/argp-parse.c
+++ b/gl/lib/argp-parse.c
@@ -1,5 +1,5 @@
/* Hierarchical argument parsing, layered over getopt
- Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -21,7 +21,6 @@
#endif
#include <alloca.h>
-#include <stdalign.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@@ -261,7 +260,7 @@ struct parser
/* LONG_OPTS is the array of getop long option structures for the union of
all the groups of options. */
struct option *long_opts;
- /* OPT_DATA is the getopt data used for the re-entrant getopt. */
+ /* OPT_DATA is the getopt data used for the reentrant getopt. */
struct _getopt_data opt_data;
/* States of the various parsing groups. */
diff --git a/gl/lib/argp-pin.c b/gl/lib/argp-pin.c
index f9cb45a9..76006cb7 100644
--- a/gl/lib/argp-pin.c
+++ b/gl/lib/argp-pin.c
@@ -1,5 +1,5 @@
/* Full and short program names for argp module
- Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2023 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/gl/lib/argp-pv.c b/gl/lib/argp-pv.c
index 8363032b..1ed7f116 100644
--- a/gl/lib/argp-pv.c
+++ b/gl/lib/argp-pv.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_VERSION.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-pvh.c b/gl/lib/argp-pvh.c
index 70017123..8833d635 100644
--- a/gl/lib/argp-pvh.c
+++ b/gl/lib/argp-pvh.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp-xinl.c b/gl/lib/argp-xinl.c
index 90b7d17e..377f2636 100644
--- a/gl/lib/argp-xinl.c
+++ b/gl/lib/argp-xinl.c
@@ -1,5 +1,5 @@
/* Real definitions for extern inline functions in argp.h
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/gl/lib/argp.h b/gl/lib/argp.h
index 8a28488d..241f8802 100644
--- a/gl/lib/argp.h
+++ b/gl/lib/argp.h
@@ -1,5 +1,5 @@
/* Hierarchical argument parsing, layered over getopt.
- Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -19,6 +19,11 @@
#ifndef _ARGP_H
#define _ARGP_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_FORMAT. */
+#if !_LIBC && !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
@@ -402,7 +407,7 @@ struct argp_state
unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
routine returned a non-zero value, it is returned; otherwise 0 is
returned. This function may also call exit unless the ARGP_NO_HELP flag
- is set. INPUT is a pointer to a value to be passed in to the parser. */
+ is set. INPUT is a pointer to a value to be passed to the parser. */
extern error_t argp_parse (const struct argp *__restrict __argp,
int /*argc*/, char **__restrict /*argv*/,
unsigned __flags, int *__restrict __arg_index,
@@ -590,9 +595,6 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __argp_state_help argp_state_help
# define __option_is_short _option_is_short
# define __option_is_end _option_is_end
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
# ifndef ARGP_EI
# define ARGP_EI _GL_INLINE
diff --git a/gl/lib/asnprintf.c b/gl/lib/asnprintf.c
index 0c5c76ea..f4861bf8 100644
--- a/gl/lib/asnprintf.c
+++ b/gl/lib/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2023 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/gl/lib/asprintf.c b/gl/lib/asprintf.c
index 9c163f38..ba58e064 100644
--- a/gl/lib/asprintf.c
+++ b/gl/lib/asprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2007, 2009-2022 Free Software Foundation,
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/assert.in.h b/gl/lib/assert.in.h
new file mode 100644
index 00000000..b0ab99c7
--- /dev/null
+++ b/gl/lib/assert.in.h
@@ -0,0 +1,27 @@
+/* Substitute for and wrapper around <assert.h>
+ Copyright (C) 2011-2023 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/>. */
+
+/* Do not guard the include, since <assert.h> is supposed to define
+ the assert macro each time it is included. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#@INCLUDE_NEXT@ @NEXT_ASSERT_H@
+
+/* The definition of static_assert is copied here. */
diff --git a/gl/lib/assure.h b/gl/lib/assure.h
index 20e806aa..e31076d9 100644
--- a/gl/lib/assure.h
+++ b/gl/lib/assure.h
@@ -1,6 +1,6 @@
/* Run-time assert-like macros.
- Copyright (C) 2014-2022 Free Software Foundation, Inc.
+ Copyright (C) 2014-2023 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/gl/lib/at-func.c b/gl/lib/at-func.c
index afcc819b..13e3fb32 100644
--- a/gl/lib/at-func.c
+++ b/gl/lib/at-func.c
@@ -1,5 +1,5 @@
/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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/gl/lib/at-func2.c b/gl/lib/at-func2.c
index 8a0882e2..bea7ea6c 100644
--- a/gl/lib/at-func2.c
+++ b/gl/lib/at-func2.c
@@ -1,5 +1,5 @@
/* Define 2-FD at-style functions like linkat or renameat.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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/gl/lib/attribute.h b/gl/lib/attribute.h
index 378d4f0a..9464fde0 100644
--- a/gl/lib/attribute.h
+++ b/gl/lib/attribute.h
@@ -1,6 +1,6 @@
/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
- Copyright 2020-2022 Free Software Foundation, Inc.
+ Copyright 2020-2023 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 @@
/* This file defines two types of attributes:
- * C2x standard attributes. These have macro names that do not begin with
+ * C23 standard attributes. These have macro names that do not begin with
'ATTRIBUTE_'.
* Selected GCC attributes; see:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
@@ -41,6 +41,21 @@
These names begin with 'ATTRIBUTE_' to avoid name clashes. */
+/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_ALWAYS_INLINE,
+ _GL_ATTRIBUTE_ARTIFICIAL, _GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_CONST,
+ _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR,
+ _GL_ATTRIBUTE_WARNING, _GL_ATTRIBUTE_EXTERNALLY_VISIBLE,
+ _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF,
+ _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. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+
/* =============== Attributes for specific kinds of functions =============== */
/* Attributes for functions that should not be used. */
diff --git a/gl/lib/basename-lgpl.c b/gl/lib/basename-lgpl.c
index eb07e254..6de60aa6 100644
--- a/gl/lib/basename-lgpl.c
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -21,7 +21,6 @@
/* Specification. */
#include "basename-lgpl.h"
-#include <stdbool.h>
#include <string.h>
#include "filename.h"
diff --git a/gl/lib/basename-lgpl.h b/gl/lib/basename-lgpl.h
index 5569f219..c1982fa8 100644
--- a/gl/lib/basename-lgpl.h
+++ b/gl/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-2022 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
@@ -19,6 +19,11 @@
#ifndef _BASENAME_LGPL_H
#define _BASENAME_LGPL_H
+/* This file uses _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
diff --git a/gl/lib/basename.c b/gl/lib/basename.c
index 0e372ca5..21fab1ef 100644
--- a/gl/lib/basename.c
+++ b/gl/lib/basename.c
@@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name
- Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/bitrotate.c b/gl/lib/bitrotate.c
index 101be6df..180ab15d 100644
--- a/gl/lib/bitrotate.c
+++ b/gl/lib/bitrotate.c
@@ -1,6 +1,6 @@
/* Rotate bits in integers.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/bitrotate.h b/gl/lib/bitrotate.h
index ee6e61ed..6fb7b495 100644
--- a/gl/lib/bitrotate.h
+++ b/gl/lib/bitrotate.h
@@ -1,5 +1,5 @@
/* bitrotate.h - Rotate bits in integers
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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,13 +19,15 @@
#ifndef _GL_BITROTATE_H
#define _GL_BITROTATE_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <limits.h>
#include <stdint.h>
#include <sys/types.h>
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef BITROTATE_INLINE
# define BITROTATE_INLINE _GL_INLINE
diff --git a/gl/lib/btowc.c b/gl/lib/btowc.c
index 4af58bb0..4defbdda 100644
--- a/gl/lib/btowc.c
+++ b/gl/lib/btowc.c
@@ -1,5 +1,5 @@
/* Convert unibyte character to wide character.
- Copyright (C) 2008, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
wint_t
btowc (int c)
@@ -32,7 +33,14 @@ btowc (int c)
wchar_t wc;
buf[0] = c;
+#if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, 0, sizeof (mbstate_t));
+ size_t ret = mbrtowc (&wc, buf, 1, &state);
+ if (!(ret == (size_t)(-1) || ret == (size_t)(-2)))
+#else
if (mbtowc (&wc, buf, 1) >= 0)
+#endif
return wc;
}
return WEOF;
diff --git a/gl/lib/c++defs.h b/gl/lib/c++defs.h
index ad181558..458c014d 100644
--- a/gl/lib/c++defs.h
+++ b/gl/lib/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 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
@@ -99,6 +99,12 @@
Example:
_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
+ of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's
+ because
+ [[...]] extern "C" <declaration>;
+ is invalid syntax in C++.)
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
diff --git a/gl/lib/calloc.c b/gl/lib/calloc.c
index 0a934b30..08843acd 100644
--- a/gl/lib/calloc.c
+++ b/gl/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-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2007, 2009-2023 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/gl/lib/canonicalize-lgpl.c b/gl/lib/canonicalize-lgpl.c
index a7fa7feb..e701297d 100644
--- a/gl/lib/canonicalize-lgpl.c
+++ b/gl/lib/canonicalize-lgpl.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 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
@@ -30,7 +30,6 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -48,6 +47,7 @@
#else
# define __canonicalize_file_name canonicalize_file_name
# define __realpath realpath
+# define __strdup strdup
# include "pathmax.h"
# define __faccessat faccessat
# if defined _WIN32 && !defined __CYGWIN__
@@ -180,27 +180,16 @@ get_path_max (void)
return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX;
}
-/* Act like __realpath (see below), with an additional argument
- rname_buf that can be used as temporary storage.
-
- If GCC_LINT is defined, do not inline this function with GCC 10.1
- and later, to avoid creating a pointer to the stack that GCC
- -Wreturn-local-addr incorrectly complains about. See:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
- Although the noinline attribute can hurt performance a bit, no better way
- to pacify GCC is known; even an explicit #pragma does not pacify GCC.
- When the GCC bug is fixed this workaround should be limited to the
- broken GCC versions. */
-# if __GNUC_PREREQ (10, 1)
-# if defined GCC_LINT || defined lint
-__attribute__ ((__noinline__))
-# elif __OPTIMIZE__ && !__NO_INLINE__
-# define GCC_BOGUS_WRETURN_LOCAL_ADDR
-# endif
-# endif
+/* Scratch buffers used by realpath_stk and managed by __realpath. */
+struct realpath_bufs
+{
+ struct scratch_buffer rname;
+ struct scratch_buffer extra;
+ struct scratch_buffer link;
+};
+
static char *
-realpath_stk (const char *name, char *resolved,
- struct scratch_buffer *rname_buf)
+realpath_stk (const char *name, char *resolved, struct realpath_bufs *bufs)
{
char *dest;
char const *start;
@@ -225,12 +214,7 @@ realpath_stk (const char *name, char *resolved,
return NULL;
}
- struct scratch_buffer extra_buffer, link_buffer;
- scratch_buffer_init (&extra_buffer);
- scratch_buffer_init (&link_buffer);
- scratch_buffer_init (rname_buf);
- char *rname_on_stack = rname_buf->data;
- char *rname = rname_on_stack;
+ char *rname = bufs->rname.data;
bool end_in_extra_buffer = false;
bool failed = true;
@@ -240,16 +224,16 @@ realpath_stk (const char *name, char *resolved,
if (!IS_ABSOLUTE_FILE_NAME (name))
{
- while (!__getcwd (rname, rname_buf->length))
+ while (!__getcwd (bufs->rname.data, bufs->rname.length))
{
if (errno != ERANGE)
{
dest = rname;
goto error;
}
- if (!scratch_buffer_grow (rname_buf))
- goto error_nomem;
- rname = rname_buf->data;
+ if (!scratch_buffer_grow (&bufs->rname))
+ return NULL;
+ rname = bufs->rname.data;
}
dest = __rawmemchr (rname, '\0');
start = name;
@@ -303,13 +287,13 @@ realpath_stk (const char *name, char *resolved,
if (!ISSLASH (dest[-1]))
*dest++ = '/';
- while (rname + rname_buf->length - dest
+ while (rname + bufs->rname.length - dest
< startlen + sizeof dir_suffix)
{
idx_t dest_offset = dest - rname;
- if (!scratch_buffer_grow_preserve (rname_buf))
- goto error_nomem;
- rname = rname_buf->data;
+ if (!scratch_buffer_grow_preserve (&bufs->rname))
+ return NULL;
+ rname = bufs->rname.data;
dest = rname + dest_offset;
}
@@ -320,13 +304,13 @@ realpath_stk (const char *name, char *resolved,
ssize_t n;
while (true)
{
- buf = link_buffer.data;
- idx_t bufsize = link_buffer.length;
+ buf = bufs->link.data;
+ idx_t bufsize = bufs->link.length;
n = __readlink (rname, buf, bufsize - 1);
if (n < bufsize - 1)
break;
- if (!scratch_buffer_grow (&link_buffer))
- goto error_nomem;
+ if (!scratch_buffer_grow (&bufs->link))
+ return NULL;
}
if (0 <= n)
{
@@ -338,7 +322,7 @@ realpath_stk (const char *name, char *resolved,
buf[n] = '\0';
- char *extra_buf = extra_buffer.data;
+ char *extra_buf = bufs->extra.data;
idx_t end_idx IF_LINT (= 0);
if (end_in_extra_buffer)
end_idx = end - extra_buf;
@@ -346,13 +330,13 @@ realpath_stk (const char *name, char *resolved,
if (INT_ADD_OVERFLOW (len, n))
{
__set_errno (ENOMEM);
- goto error_nomem;
+ return NULL;
}
- while (extra_buffer.length <= len + n)
+ while (bufs->extra.length <= len + n)
{
- if (!scratch_buffer_grow_preserve (&extra_buffer))
- goto error_nomem;
- extra_buf = extra_buffer.data;
+ if (!scratch_buffer_grow_preserve (&bufs->extra))
+ return NULL;
+ extra_buf = bufs->extra.data;
}
if (end_in_extra_buffer)
end = extra_buf + end_idx;
@@ -404,20 +388,30 @@ realpath_stk (const char *name, char *resolved,
error:
*dest++ = '\0';
- if (resolved != NULL && dest - rname <= get_path_max ())
- rname = strcpy (resolved, rname);
-
-error_nomem:
- scratch_buffer_free (&extra_buffer);
- scratch_buffer_free (&link_buffer);
-
- if (failed || rname == resolved)
+ if (resolved != NULL)
+ {
+ /* Copy the full result on success or partial result if failure was due
+ to the path not existing or not being accessible. */
+ if ((!failed || errno == ENOENT || errno == EACCES)
+ && dest - rname <= get_path_max ())
+ {
+ strcpy (resolved, rname);
+ if (failed)
+ return NULL;
+ else
+ return resolved;
+ }
+ if (!failed)
+ __set_errno (ENAMETOOLONG);
+ return NULL;
+ }
+ else
{
- scratch_buffer_free (rname_buf);
- return failed ? NULL : resolved;
+ if (failed)
+ return NULL;
+ else
+ return __strdup (bufs->rname.data);
}
-
- return scratch_buffer_dupfree (rname_buf, dest - rname);
}
/* Return the canonical absolute name of file NAME. A canonical name
@@ -434,12 +428,15 @@ error_nomem:
char *
__realpath (const char *name, char *resolved)
{
- #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
- #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
- #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
- #endif
- struct scratch_buffer rname_buffer;
- return realpath_stk (name, resolved, &rname_buffer);
+ struct realpath_bufs bufs;
+ scratch_buffer_init (&bufs.rname);
+ scratch_buffer_init (&bufs.extra);
+ scratch_buffer_init (&bufs.link);
+ char *result = realpath_stk (name, resolved, &bufs);
+ scratch_buffer_free (&bufs.link);
+ scratch_buffer_free (&bufs.extra);
+ scratch_buffer_free (&bufs.rname);
+ return result;
}
libc_hidden_def (__realpath)
versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
diff --git a/gl/lib/canonicalize.c b/gl/lib/canonicalize.c
index eaf18c6d..d73ee2c8 100644
--- a/gl/lib/canonicalize.c
+++ b/gl/lib/canonicalize.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 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
@@ -20,7 +20,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -35,13 +34,6 @@
#include "hash-triple.h"
#include "xalloc.h"
-/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */
-#if defined GCC_LINT || defined lint
-# define IF_LINT(Code) Code
-#else
-# define IF_LINT(Code) /* empty */
-#endif
-
#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
#endif
@@ -52,6 +44,11 @@
# define SLASHES "/"
#endif
+/* Avoid false GCC warning "'end_idx' may be used uninitialized". */
+#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+
/* Return true if FILE's existence can be shown, false (setting errno)
otherwise. Follow symbolic links. */
static bool
@@ -163,28 +160,18 @@ seen_triple (Hash_table **ht, char const *filename, struct stat const *st)
return false;
}
+/* Scratch buffers used by canonicalize_filename_mode_stk and managed
+ by __realpath. */
+struct realpath_bufs
+{
+ struct scratch_buffer rname;
+ struct scratch_buffer extra;
+ struct scratch_buffer link;
+};
-/* Act like canonicalize_filename_mode (see below), with an additional argument
- rname_buf that can be used as temporary storage.
-
- If GCC_LINT is defined, do not inline this function with GCC 10.1
- and later, to avoid creating a pointer to the stack that GCC
- -Wreturn-local-addr incorrectly complains about. See:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
- Although the noinline attribute can hurt performance a bit, no better way
- to pacify GCC is known; even an explicit #pragma does not pacify GCC.
- When the GCC bug is fixed this workaround should be limited to the
- broken GCC versions. */
-#if _GL_GNUC_PREREQ (10, 1)
-# if defined GCC_LINT || defined lint
-__attribute__ ((__noinline__))
-# elif __OPTIMIZE__ && !__NO_INLINE__
-# define GCC_BOGUS_WRETURN_LOCAL_ADDR
-# endif
-#endif
static char *
canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
- struct scratch_buffer *rname_buf)
+ struct realpath_bufs *bufs)
{
char *dest;
char const *start;
@@ -212,12 +199,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
return NULL;
}
- struct scratch_buffer extra_buffer, link_buffer;
- scratch_buffer_init (&extra_buffer);
- scratch_buffer_init (&link_buffer);
- scratch_buffer_init (rname_buf);
- char *rname_on_stack = rname_buf->data;
- char *rname = rname_on_stack;
+ char *rname = bufs->rname.data;
bool end_in_extra_buffer = false;
bool failed = true;
@@ -227,12 +209,12 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
if (!IS_ABSOLUTE_FILE_NAME (name))
{
- while (!getcwd (rname, rname_buf->length))
+ while (!getcwd (bufs->rname.data, bufs->rname.length))
{
switch (errno)
{
case ERANGE:
- if (scratch_buffer_grow (rname_buf))
+ if (scratch_buffer_grow (&bufs->rname))
break;
FALLTHROUGH;
case ENOMEM:
@@ -242,7 +224,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
dest = rname;
goto error;
}
- rname = rname_buf->data;
+ rname = bufs->rname.data;
}
dest = rawmemchr (rname, '\0');
start = name;
@@ -266,7 +248,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
for (i = 2; name[i] != '\0' && !ISSLASH (name[i]); )
i++;
if (name[i] != '\0' /* implies ISSLASH (name[i]) */
- && i + 1 < rname_buf->length)
+ && i + 1 < bufs->rname.length)
{
prefix_len = i;
memcpy (dest, name + 2, i - 2 + 1);
@@ -276,7 +258,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
{
/* Either name = '\\server'; this is an invalid file name.
Or name = '\\server\...' and server is more than
- rname_buf->length - 4 bytes long. In either
+ bufs->rname.length - 4 bytes long. In either
case, stop the UNC processing. */
}
}
@@ -321,13 +303,13 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
if (!ISSLASH (dest[-1]))
*dest++ = '/';
- while (rname + rname_buf->length - dest
+ while (rname + bufs->rname.length - dest
< startlen + sizeof dir_suffix)
{
idx_t dest_offset = dest - rname;
- if (!scratch_buffer_grow_preserve (rname_buf))
+ if (!scratch_buffer_grow_preserve (&bufs->rname))
xalloc_die ();
- rname = rname_buf->data;
+ rname = bufs->rname.data;
dest = rname + dest_offset;
}
@@ -340,12 +322,12 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
{
while (true)
{
- buf = link_buffer.data;
- idx_t bufsize = link_buffer.length;
+ buf = bufs->link.data;
+ idx_t bufsize = bufs->link.length;
n = readlink (rname, buf, bufsize - 1);
if (n < bufsize - 1)
break;
- if (!scratch_buffer_grow (&link_buffer))
+ if (!scratch_buffer_grow (&bufs->link))
xalloc_die ();
}
}
@@ -384,18 +366,18 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
buf[n] = '\0';
- char *extra_buf = extra_buffer.data;
- idx_t end_idx IF_LINT (= 0);
+ char *extra_buf = bufs->extra.data;
+ idx_t end_idx;
if (end_in_extra_buffer)
end_idx = end - extra_buf;
size_t len = strlen (end);
if (INT_ADD_OVERFLOW (len, n))
xalloc_die ();
- while (extra_buffer.length <= len + n)
+ while (bufs->extra.length <= len + n)
{
- if (!scratch_buffer_grow_preserve (&extra_buffer))
+ if (!scratch_buffer_grow_preserve (&bufs->extra))
xalloc_die ();
- extra_buf = extra_buffer.data;
+ extra_buf = bufs->extra.data;
}
if (end_in_extra_buffer)
end = extra_buf + end_idx;
@@ -454,20 +436,15 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
error:
if (ht)
hash_free (ht);
- scratch_buffer_free (&extra_buffer);
- scratch_buffer_free (&link_buffer);
if (failed)
- {
- scratch_buffer_free (rname_buf);
- return NULL;
- }
+ return NULL;
*dest++ = '\0';
- char *result = scratch_buffer_dupfree (rname_buf, dest - rname);
+ char *result = malloc (dest - rname);
if (!result)
xalloc_die ();
- return result;
+ return memcpy (result, rname, dest - rname);
}
/* Return the canonical absolute name of file NAME, while treating
@@ -480,10 +457,13 @@ error:
char *
canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
{
- #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
- #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
- #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
- #endif
- struct scratch_buffer rname_buffer;
- return canonicalize_filename_mode_stk (name, can_mode, &rname_buffer);
+ struct realpath_bufs bufs;
+ scratch_buffer_init (&bufs.rname);
+ scratch_buffer_init (&bufs.extra);
+ scratch_buffer_init (&bufs.link);
+ char *result = canonicalize_filename_mode_stk (name, can_mode, &bufs);
+ scratch_buffer_free (&bufs.link);
+ scratch_buffer_free (&bufs.extra);
+ scratch_buffer_free (&bufs.rname);
+ return result;
}
diff --git a/gl/lib/canonicalize.h b/gl/lib/canonicalize.h
index 817da1fd..ea09c666 100644
--- a/gl/lib/canonicalize.h
+++ b/gl/lib/canonicalize.h
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009-2023 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
@@ -17,6 +17,11 @@
#ifndef CANONICALIZE_H_
# define CANONICALIZE_H_
+/* This file uses _GL_ATTRIBUTE_MALLOC. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdlib.h> /* for canonicalize_file_name */
#define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING)
diff --git a/gl/lib/cdefs.h b/gl/lib/cdefs.h
index 7b8ed5b3..412f036c 100644
--- a/gl/lib/cdefs.h
+++ b/gl/lib/cdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
Copyright The GNU Toolchain Authors.
This file is part of the GNU C Library.
@@ -140,32 +140,37 @@
#endif
+/* Gnulib avoids these definitions, as they don't work on non-glibc platforms.
+ In particular, __bos and __bos0 are defined differently in the Android libc.
+ */
+#ifndef __GNULIB_CDEFS
+
/* Fortify support. */
-#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
-#define __bos0(ptr) __builtin_object_size (ptr, 0)
+# define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+# define __bos0(ptr) __builtin_object_size (ptr, 0)
/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
-#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
- || __GNUC_PREREQ (12, 0))
-# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
-# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
-#else
-# define __glibc_objsize0(__o) __bos0 (__o)
-# define __glibc_objsize(__o) __bos (__o)
-#endif
+# if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
+ || __GNUC_PREREQ (12, 0))
+# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
+# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
+# else
+# define __glibc_objsize0(__o) __bos0 (__o)
+# define __glibc_objsize(__o) __bos (__o)
+# endif
/* Compile time conditions to choose between the regular, _chk and _chk_warn
variants. These conditions should get evaluated to constant and optimized
away. */
-#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
-#define __glibc_unsigned_or_positive(__l) \
+# define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
+# define __glibc_unsigned_or_positive(__l) \
((__typeof (__l)) 0 < (__typeof (__l)) -1 \
|| (__builtin_constant_p (__l) && (__l) > 0))
/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
condition can be folded to a constant and if it is true, or unknown (-1) */
-#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
+# define __glibc_safe_or_unknown_len(__l, __s, __osz) \
((__osz) == (__SIZE_TYPE__) -1 \
|| (__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
@@ -175,7 +180,7 @@
/* Conversely, we know at compile time that the length is unsafe if the
__L * __S <= __OBJSZ condition can be folded to a constant and if it is
false. */
-#define __glibc_unsafe_len(__l, __s, __osz) \
+# define __glibc_unsafe_len(__l, __s, __osz) \
(__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
__s, __osz)) \
@@ -184,7 +189,7 @@
/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
declared. */
-#define __glibc_fortify(f, __l, __s, __osz, ...) \
+# define __glibc_fortify(f, __l, __s, __osz, ...) \
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
? __ ## f ## _alias (__VA_ARGS__) \
: (__glibc_unsafe_len (__l, __s, __osz) \
@@ -194,13 +199,16 @@
/* Fortify function f, where object size argument passed to f is the number of
elements and not total size. */
-#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
+# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
? __ ## f ## _alias (__VA_ARGS__) \
: (__glibc_unsafe_len (__l, __s, __osz) \
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
+#endif
+
+
#if __GNUC_PREREQ (4,3)
# define __warnattr(msg) __attribute__((__warning__ (msg)))
# define __errordecl(name, msg) \
diff --git a/gl/lib/chdir-long.c b/gl/lib/chdir-long.c
index f4efb209..8a25538b 100644
--- a/gl/lib/chdir-long.c
+++ b/gl/lib/chdir-long.c
@@ -1,5 +1,5 @@
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2023 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
@@ -23,7 +23,6 @@
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
#include <stdio.h>
diff --git a/gl/lib/chdir-long.h b/gl/lib/chdir-long.h
index 84a72989..6f81fadf 100644
--- a/gl/lib/chdir-long.h
+++ b/gl/lib/chdir-long.h
@@ -1,5 +1,5 @@
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
- Copyright (C) 2004-2005, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2005, 2009-2023 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/gl/lib/chown.c b/gl/lib/chown.c
index 705ca858..d735818a 100644
--- a/gl/lib/chown.c
+++ b/gl/lib/chown.c
@@ -1,7 +1,7 @@
/* provide consistent interface to chown for systems that don't interpret
an ID of -1 as meaning "don't change the corresponding ID".
- Copyright (C) 1997, 2004-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004-2007, 2009-2023 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,7 +25,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
diff --git a/gl/lib/cloexec.c b/gl/lib/cloexec.c
index 812be01a..e4cecbd2 100644
--- a/gl/lib/cloexec.c
+++ b/gl/lib/cloexec.c
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 1991, 2004-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2004-2006, 2009-2023 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/gl/lib/cloexec.h b/gl/lib/cloexec.h
index 7a22d775..057fd668 100644
--- a/gl/lib/cloexec.h
+++ b/gl/lib/cloexec.h
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 2004, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2009-2023 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,8 +15,6 @@
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/>. */
-#include <stdbool.h>
-
/* 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.
diff --git a/gl/lib/close.c b/gl/lib/close.c
index 44990ba7..3c1b09ea 100644
--- a/gl/lib/close.c
+++ b/gl/lib/close.c
@@ -1,5 +1,5 @@
/* close replacement.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/closedir.c b/gl/lib/closedir.c
index a2731220..3777e9f7 100644
--- a/gl/lib/closedir.c
+++ b/gl/lib/closedir.c
@@ -1,5 +1,5 @@
/* Stop reading the entries of a directory.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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,31 +23,37 @@
# include <unistd.h>
#endif
+#include <stdlib.h>
+
#if HAVE_CLOSEDIR
/* Override closedir(), to keep track of the open file descriptors.
Needed because there is a function dirfd(). */
-#else
-
-# include <stdlib.h>
+#endif
+#if GNULIB_defined_DIR
# include "dirent-private.h"
-
#endif
int
closedir (DIR *dirp)
+#undef closedir
{
-# if REPLACE_FCHDIR || REPLACE_DIRFD
+#if GNULIB_defined_DIR || REPLACE_FCHDIR || defined __KLIBC__
int fd = dirfd (dirp);
-# endif
+#endif
int retval;
-#if HAVE_CLOSEDIR
-# undef closedir
+#if HAVE_DIRENT_H /* equivalent to HAVE_CLOSEDIR */
+# if GNULIB_defined_DIR
+ retval = closedir (dirp->real_dirp);
+ if (retval >= 0)
+ free (dirp);
+# else
retval = closedir (dirp);
+# endif
# ifdef __KLIBC__
if (!retval)
@@ -63,9 +69,13 @@ closedir (DIR *dirp)
#endif
-#if REPLACE_FCHDIR
+#if GNULIB_defined_DIR
+ if (retval >= 0)
+ close (fd);
+#elif REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif
+
return retval;
}
diff --git a/gl/lib/ctype.in.h b/gl/lib/ctype.in.h
index dc81170d..ec43126d 100644
--- a/gl/lib/ctype.in.h
+++ b/gl/lib/ctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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
@@ -36,6 +36,11 @@
#ifndef _@GUARD_PREFIX@_CTYPE_H
#define _@GUARD_PREFIX@_CTYPE_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
diff --git a/gl/lib/dirent-private.h b/gl/lib/dirent-private.h
index 30cf5d90..012b6837 100644
--- a/gl/lib/dirent-private.h
+++ b/gl/lib/dirent-private.h
@@ -1,5 +1,5 @@
/* Private details of the DIR type.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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
@@ -17,15 +17,36 @@
#ifndef _DIRENT_PRIVATE_H
#define _DIRENT_PRIVATE_H 1
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#if HAVE_DIRENT_H /* mingw */
+
+# undef DIR
+
+struct gl_directory
+{
+ /* File descriptor to close during closedir().
+ Needed for implementing fdopendir(). */
+ int fd_to_close;
+ /* Pointer to the real DIR. */
+ DIR *real_dirp;
+};
+
+/* Restore definition from dirent.h. */
+# define DIR struct gl_directory
+
+#else /* MSVC */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
/* Don't assume that UNICODE is not defined. */
-#undef WIN32_FIND_DATA
-#define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
struct gl_directory
{
+ /* File descriptor to close during closedir().
+ Needed for implementing fdopendir(). */
+ int fd_to_close;
/* Status, or error code to produce in next readdir() call.
-2 means the end of the directory is already reached,
-1 means the entry was already filled by FindFirstFile,
@@ -41,4 +62,6 @@ struct gl_directory
char dir_name_mask[1];
};
+#endif
+
#endif /* _DIRENT_PRIVATE_H */
diff --git a/gl/lib/dirent.in.h b/gl/lib/dirent.in.h
index f28288d1..d409a031 100644
--- a/gl/lib/dirent.in.h
+++ b/gl/lib/dirent.in.h
@@ -1,5 +1,5 @@
/* A GNU-like <dirent.h>.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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,12 @@
#ifndef _@GUARD_PREFIX@_DIRENT_H
#define _@GUARD_PREFIX@_DIRENT_H
+/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
+ _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get ino_t. Needed on some systems, including glibc 2.8. */
#include <sys/types.h>
@@ -50,11 +56,24 @@ struct dirent
# define DT_LNK 10 /* symbolic link */
# define DT_SOCK 12 /* socket */
# define DT_WHT 14 /* whiteout */
-typedef struct gl_directory DIR;
# define GNULIB_defined_struct_dirent 1
# endif
#endif
+#if !@DIR_HAS_FD_MEMBER@
+# if !GNULIB_defined_DIR
+/* struct gl_directory is a type with a field 'int fd_to_close'.
+ It is needed for implementing fdopendir(). */
+struct gl_directory;
+# if @HAVE_DIRENT_H@
+# define DIR struct gl_directory
+# else
+typedef struct gl_directory DIR;
+# endif
+# define GNULIB_defined_DIR 1
+# endif
+#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. */
@@ -143,7 +162,7 @@ _GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
# endif
_GL_CXXALIASWARN (opendir);
#else
-# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined opendir
+# if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR && __GNUC__ >= 11 && !defined opendir
/* For -Wmismatched-dealloc: Associate opendir with closedir or
rpl_closedir. */
_GL_FUNCDECL_SYS (opendir, DIR *,
@@ -161,10 +180,19 @@ _GL_WARN_ON_USE (opendir, "opendir is not portable - "
#endif
#if @GNULIB_READDIR@
-# if !@HAVE_READDIR@
+# if @REPLACE_READDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef readdir
+# define readdir rpl_readdir
+# endif
+_GL_FUNCDECL_RPL (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (readdir, struct dirent *, (DIR *dirp));
+# else
+# if !@HAVE_READDIR@
_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
+# endif
_GL_CXXALIASWARN (readdir);
#elif defined GNULIB_POSIXCHECK
# undef readdir
@@ -175,10 +203,19 @@ _GL_WARN_ON_USE (readdir, "readdir is not portable - "
#endif
#if @GNULIB_REWINDDIR@
-# if !@HAVE_REWINDDIR@
+# if @REPLACE_REWINDDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rewinddir
+# define rewinddir rpl_rewinddir
+# endif
+_GL_FUNCDECL_RPL (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (rewinddir, void, (DIR *dirp));
+# else
+# if !@HAVE_REWINDDIR@
_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
+# endif
_GL_CXXALIASWARN (rewinddir);
#elif defined GNULIB_POSIXCHECK
# undef rewinddir
diff --git a/gl/lib/dirfd.c b/gl/lib/dirfd.c
index 4104683f..75b2163c 100644
--- a/gl/lib/dirfd.c
+++ b/gl/lib/dirfd.c
@@ -1,6 +1,6 @@
/* dirfd.c -- return the file descriptor associated with an open DIR*
- Copyright (C) 2001, 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2006, 2008-2023 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
@@ -22,6 +22,10 @@
#include <dirent.h>
#include <errno.h>
+#if GNULIB_defined_DIR
+# include "dirent-private.h"
+#endif
+
#ifdef __KLIBC__
# include <stdlib.h>
# include <io.h>
@@ -78,11 +82,17 @@ _gl_unregister_dirp_fd (int fd)
int
dirfd (DIR *dir_p)
{
+#if GNULIB_defined_DIR
+ int fd = dir_p->fd_to_close;
+ if (fd == -1)
+ errno = EINVAL;
+ return fd;
+#else
int fd = DIR_TO_FD (dir_p);
if (fd == -1)
-#ifndef __KLIBC__
+# ifndef __KLIBC__
errno = ENOTSUP;
-#else
+# else
{
struct dirp_fd_list *dirp_fd;
@@ -92,7 +102,8 @@ dirfd (DIR *dir_p)
errno = EINVAL;
}
-#endif
+# endif
return fd;
+#endif
}
diff --git a/gl/lib/dirname-lgpl.c b/gl/lib/dirname-lgpl.c
index d54f6a91..e9454af3 100644
--- a/gl/lib/dirname-lgpl.c
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/dirname.c b/gl/lib/dirname.c
index 3d2aaf1e..e72f7130 100644
--- a/gl/lib/dirname.c
+++ b/gl/lib/dirname.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-2022 Free Software
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/dirname.h b/gl/lib/dirname.h
index e18a97ea..0344f1c4 100644
--- a/gl/lib/dirname.h
+++ b/gl/lib/dirname.h
@@ -1,6 +1,6 @@
/* Take file names apart into directory and base names.
- Copyright (C) 1998, 2001, 2003-2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
@@ -19,7 +19,12 @@
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1
-# include <stdbool.h>
+/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_PURE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
# include <stdlib.h>
# include "filename.h"
# include "basename-lgpl.h"
diff --git a/gl/lib/dup-safer-flag.c b/gl/lib/dup-safer-flag.c
index f87792a3..be1762b2 100644
--- a/gl/lib/dup-safer-flag.c
+++ b/gl/lib/dup-safer-flag.c
@@ -1,7 +1,7 @@
/* Duplicate a file descriptor result, avoiding clobbering
STD{IN,OUT,ERR}_FILENO, with specific flags.
- Copyright (C) 2001, 2004-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004-2006, 2009-2023 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/gl/lib/dup-safer.c b/gl/lib/dup-safer.c
index 38ff74cc..bb86a2e4 100644
--- a/gl/lib/dup-safer.c
+++ b/gl/lib/dup-safer.c
@@ -1,6 +1,6 @@
/* Invoke dup, but avoid some glitches.
- Copyright (C) 2001, 2004-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004-2006, 2009-2023 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/gl/lib/dup.c b/gl/lib/dup.c
index 17a9c582..21e9f1f0 100644
--- a/gl/lib/dup.c
+++ b/gl/lib/dup.c
@@ -1,6 +1,6 @@
/* Duplicate an open file descriptor.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/dup2.c b/gl/lib/dup2.c
index 1c766ab3..7d197ca3 100644
--- a/gl/lib/dup2.c
+++ b/gl/lib/dup2.c
@@ -1,6 +1,6 @@
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004-2007, 2009-2023 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/gl/lib/dynarray.h b/gl/lib/dynarray.h
index ca6439d3..91559109 100644
--- a/gl/lib/dynarray.h
+++ b/gl/lib/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright 2021-2022 Free Software Foundation, Inc.
+ Copyright 2021-2023 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/gl/lib/eloop-threshold.h b/gl/lib/eloop-threshold.h
index 8b314571..d9b154e4 100644
--- a/gl/lib/eloop-threshold.h
+++ b/gl/lib/eloop-threshold.h
@@ -1,5 +1,5 @@
/* Threshold at which to diagnose ELOOP. Generic version.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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
@@ -19,6 +19,11 @@
#ifndef _ELOOP_THRESHOLD_H
#define _ELOOP_THRESHOLD_H 1
+/* This file uses _GL_ATTRIBUTE_CONST. */
+#if !_LIBC && !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <limits.h>
#ifdef _LIBC
# include <sys/param.h>
diff --git a/gl/lib/errno.in.h b/gl/lib/errno.in.h
index 3ec18456..3dda9c26 100644
--- a/gl/lib/errno.in.h
+++ b/gl/lib/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/error.c b/gl/lib/error.c
index 272d45e4..9e26391e 100644
--- a/gl/lib/error.c
+++ b/gl/lib/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-2007, 2009-2023 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
@@ -19,6 +19,7 @@
#if !_LIBC
# include <config.h>
+# define _GL_NO_INLINE_ERROR
#endif
#include "error.h"
@@ -42,8 +43,6 @@
# define USE_UNLOCKED_IO 0
# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b)
# define _GL_ARG_NONNULL(a)
-#else
-# include "getprogname.h"
#endif
#if USE_UNLOCKED_IO
diff --git a/gl/lib/error.h b/gl/lib/error.h
deleted file mode 100644
index 45ec2a5e..00000000
--- a/gl/lib/error.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Declaration for error-reporting function
- Copyright (C) 1995-1997, 2003, 2006, 2008-2022 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.
-
- 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 _ERROR_H
-#define _ERROR_H 1
-
-/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Print a message with 'fprintf (stderr, FORMAT, ...)';
- if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
- If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
-
-extern void error (int __status, int __errnum, const char *__format, ...)
-#if GNULIB_VFPRINTF_POSIX
- _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4))
-#else
- _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4))
-#endif
- ;
-
-extern void error_at_line (int __status, int __errnum, const char *__fname,
- unsigned int __lineno, const char *__format, ...)
-#if GNULIB_VFPRINTF_POSIX
- _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6))
-#else
- _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6))
-#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. */
-extern void (*error_print_progname) (void);
-
-/* This variable is incremented each time 'error' is called. */
-extern unsigned int error_message_count;
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-extern int error_one_per_line;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* error.h */
diff --git a/gl/lib/error.in.h b/gl/lib/error.in.h
new file mode 100644
index 00000000..94477fde
--- /dev/null
+++ b/gl/lib/error.in.h
@@ -0,0 +1,215 @@
+/* Declarations for error-reporting functions.
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2023 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.
+
+ 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@_ERROR_H
+
+/* No @PRAGMA_SYSTEM_HEADER@ here, because it would prevent
+ -Wimplicit-fallthrough warnings for missing FALLTHROUGH after error(...)
+ or error_at_line(...) invocations. */
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_ERROR_H@
+# @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. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+/* Get 'unreachable'. */
+#include <stddef.h>
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */
+#include <stdio.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+#if GNULIB_VFPRINTF_POSIX
+# define _GL_ATTRIBUTE_SPEC_PRINTF_ERROR _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_ERROR _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM
+#endif
+
+/* Helper macro for supporting the compiler's control flow analysis better.
+ It evaluates its arguments only once.
+ Test case: Compile copy-file.c with "gcc -Wimplicit-fallthrough". */
+#ifdef __GNUC__
+/* Use 'unreachable' to tell the compiler when the function call does not
+ return. */
+# define __gl_error_call1(function, status, ...) \
+ ((function) (status, __VA_ARGS__), \
+ (status) != 0 ? unreachable () : (void) 0)
+/* If STATUS is a not a constant, the function call may or may not return;
+ therefore -Wimplicit-fallthrough will produce a warning. Use a compound
+ statement in order to evaluate STATUS only once.
+ If STATUS is a constant, we don't use a compound statement, because that
+ would trigger a -Wimplicit-fallthrough warning even when STATUS is != 0,
+ when not optimizing. This causes STATUS to be evaluated twice, but
+ that's OK since it does not have side effects. */
+# define __gl_error_call(function, status, ...) \
+ (__builtin_constant_p (status) \
+ ? __gl_error_call1 (function, status, __VA_ARGS__) \
+ : ({ \
+ int const __errstatus = status; \
+ __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
+ }))
+#else
+# define __gl_error_call(function, status, ...) \
+ (function) (status, __VA_ARGS__)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Print a message with 'fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
+#if @REPLACE_ERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef error
+# define error rpl_error
+# endif
+_GL_FUNCDECL_RPL (error, void,
+ (int __status, int __errnum, const char *__format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
+_GL_CXXALIAS_RPL (error, void,
+ (int __status, int __errnum, const char *__format, ...));
+# ifndef _GL_NO_INLINE_ERROR
+# undef error
+# define error(status, ...) \
+ __gl_error_call (rpl_error, status, __VA_ARGS__)
+# endif
+#else
+# if ! @HAVE_ERROR@
+_GL_FUNCDECL_SYS (error, void,
+ (int __status, int __errnum, const char *__format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
+# endif
+_GL_CXXALIAS_SYS (error, void,
+ (int __status, int __errnum, const char *__format, ...));
+# ifndef _GL_NO_INLINE_ERROR
+# ifdef error
+/* Only gcc ≥ 4.7 has __builtin_va_arg_pack. */
+# if _GL_GNUC_PREREQ (4, 7)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wattributes"
+_GL_ATTRIBUTE_MAYBE_UNUSED
+static void
+_GL_ATTRIBUTE_ALWAYS_INLINE
+_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4))
+_gl_inline_error (int __status, int __errnum, const char *__format, ...)
+{
+ return error (__status, __errnum, __format, __builtin_va_arg_pack ());
+}
+# pragma GCC diagnostic pop
+# undef error
+# define error(status, ...) \
+ __gl_error_call (_gl_inline_error, status, __VA_ARGS__)
+# endif
+# else
+# define error(status, ...) \
+ __gl_error_call (error, status, __VA_ARGS__)
+# endif
+# endif
+#endif
+#if __GLIBC__ >= 2
+_GL_CXXALIASWARN (error);
+#endif
+
+/* Likewise. If FILENAME is non-NULL, include FILENAME:LINENO: in the
+ message. */
+#if @REPLACE_ERROR_AT_LINE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef error_at_line
+# define error_at_line rpl_error_at_line
+# endif
+_GL_FUNCDECL_RPL (error_at_line, void,
+ (int __status, int __errnum, const char *__filename,
+ unsigned int __lineno, const char *__format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
+_GL_CXXALIAS_RPL (error_at_line, void,
+ (int __status, int __errnum, const char *__filename,
+ unsigned int __lineno, const char *__format, ...));
+# ifndef _GL_NO_INLINE_ERROR
+# undef error_at_line
+# define error_at_line(status, ...) \
+ __gl_error_call (rpl_error_at_line, status, __VA_ARGS__)
+# endif
+#else
+# 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, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
+# endif
+_GL_CXXALIAS_SYS (error_at_line, void,
+ (int __status, int __errnum, const char *__filename,
+ unsigned int __lineno, const char *__format, ...));
+# ifndef _GL_NO_INLINE_ERROR
+# ifdef error_at_line
+/* Only gcc ≥ 4.7 has __builtin_va_arg_pack. */
+# if _GL_GNUC_PREREQ (4, 7)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wattributes"
+_GL_ATTRIBUTE_MAYBE_UNUSED
+static void
+_GL_ATTRIBUTE_ALWAYS_INLINE
+_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, ...)
+{
+ return error_at_line (__status, __errnum, __filename, __lineno, __format,
+ __builtin_va_arg_pack ());
+}
+# pragma GCC diagnostic pop
+# undef error_at_line
+# define error_at_line(status, ...) \
+ __gl_error_call (_gl_inline_error_at_line, status, __VA_ARGS__)
+# endif
+# else
+# define error_at_line(status, ...) \
+ __gl_error_call (error_at_line, status, __VA_ARGS__)
+# endif
+# endif
+#endif
+_GL_CXXALIASWARN (error_at_line);
+
+/* 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. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _@GUARD_PREFIX@_ERROR_H */
+#endif /* _@GUARD_PREFIX@_ERROR_H */
diff --git a/gl/lib/exitfail.c b/gl/lib/exitfail.c
index 84fb0eff..d67a130c 100644
--- a/gl/lib/exitfail.c
+++ b/gl/lib/exitfail.c
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2007, 2009-2023 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/gl/lib/exitfail.h b/gl/lib/exitfail.h
index 865f096a..85a6af64 100644
--- a/gl/lib/exitfail.h
+++ b/gl/lib/exitfail.h
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2023 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/gl/lib/fchdir.c b/gl/lib/fchdir.c
index 99e4aa85..880b137e 100644
--- a/gl/lib/fchdir.c
+++ b/gl/lib/fchdir.c
@@ -1,5 +1,5 @@
/* fchdir replacement.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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
@@ -22,7 +22,6 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -49,7 +48,6 @@
typedef struct
{
char *name; /* Absolute name of the directory, or NULL. */
- /* FIXME - add a DIR* member to make dirfd possible on mingw? */
} dir_info_t;
static dir_info_t *dirs;
static size_t dirs_allocated;
diff --git a/gl/lib/fchown-stub.c b/gl/lib/fchown-stub.c
index 74df86ae..05bfa428 100644
--- a/gl/lib/fchown-stub.c
+++ b/gl/lib/fchown-stub.c
@@ -1,5 +1,5 @@
/* Change ownership of a file.
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2023 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/gl/lib/fcntl.c b/gl/lib/fcntl.c
index f9753c40..e2208008 100644
--- a/gl/lib/fcntl.c
+++ b/gl/lib/fcntl.c
@@ -1,6 +1,6 @@
/* Provide file descriptor control.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/fcntl.in.h b/gl/lib/fcntl.in.h
index 9270ced8..d0bb85f3 100644
--- a/gl/lib/fcntl.in.h
+++ b/gl/lib/fcntl.in.h
@@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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
@@ -74,6 +74,11 @@
#ifndef _@GUARD_PREFIX@_FCNTL_H
#define _@GUARD_PREFIX@_FCNTL_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
# include <unistd.h>
#endif
diff --git a/gl/lib/fd-hook.c b/gl/lib/fd-hook.c
index 64a7a80c..36261150 100644
--- a/gl/lib/fd-hook.c
+++ b/gl/lib/fd-hook.c
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/fd-hook.h b/gl/lib/fd-hook.h
index d6c4964d..6bf3c24d 100644
--- a/gl/lib/fd-hook.h
+++ b/gl/lib/fd-hook.h
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/fd-safer-flag.c b/gl/lib/fd-safer-flag.c
index 2e07cb9b..9aef2710 100644
--- a/gl/lib/fd-safer-flag.c
+++ b/gl/lib/fd-safer-flag.c
@@ -1,7 +1,7 @@
/* Adjust a file descriptor result so that it avoids clobbering
STD{IN,OUT,ERR}_FILENO, with specific flags.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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/gl/lib/fd-safer.c b/gl/lib/fd-safer.c
index e37b7b3a..9c40a5ae 100644
--- a/gl/lib/fd-safer.c
+++ b/gl/lib/fd-safer.c
@@ -1,6 +1,6 @@
/* Return a safer copy of a file descriptor.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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/gl/lib/fdopendir.c b/gl/lib/fdopendir.c
index c2b0e1ed..0f43d6ff 100644
--- a/gl/lib/fdopendir.c
+++ b/gl/lib/fdopendir.c
@@ -1,5 +1,5 @@
/* provide a replacement fdopendir function
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2023 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
@@ -25,44 +25,27 @@
#if !HAVE_FDOPENDIR
-# include "openat.h"
-# include "openat-priv.h"
-# include "save-cwd.h"
+# if GNULIB_defined_DIR
+/* We are in control of the file descriptor of a DIR. */
-# if GNULIB_DIRENT_SAFER
-# include "dirent--.h"
-# endif
-
-# ifndef REPLACE_FCHDIR
-# define REPLACE_FCHDIR 0
-# endif
-
-static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
-static DIR *fd_clone_opendir (int, struct saved_cwd const *);
-
-/* Replacement for POSIX fdopendir.
+# include "dirent-private.h"
- First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
- that, simulate it by using fchdir metadata, or by doing
- save_cwd/fchdir/opendir(".")/restore_cwd.
- If either the save_cwd or the restore_cwd fails (relatively unlikely),
- then give a diagnostic and exit nonzero.
-
- If successful, the resulting stream is based on FD in
- implementations where streams are based on file descriptors and in
- applications where no other thread or signal handler allocates or
- frees file descriptors. In other cases, consult dirfd on the result
- to find out whether FD is still being used.
+# if !REPLACE_FCHDIR
+# error "unexpected configuration: GNULIB_defined_DIR but fchdir not replaced"
+# endif
- Otherwise, this function works just like POSIX fdopendir.
+DIR *
+fdopendir (int fd)
+{
+ char const *name = _gl_directory_name (fd);
+ DIR *dirp = name ? opendir (name) : NULL;
+ if (dirp != NULL)
+ dirp->fd_to_close = fd;
+ return dirp;
+}
- W A R N I N G:
+# elif defined __KLIBC__
- Unlike other fd-related functions, this one places constraints on FD.
- If this function returns successfully, FD is under control of the
- dirent.h system, and the caller should not close or modify the state of
- FD other than by the dirent.h functions. */
-# ifdef __KLIBC__
# include <InnoTekLIBC/backend.h>
DIR *
@@ -96,7 +79,48 @@ fdopendir (int fd)
return dirp;
}
+
# else
+/* We are not in control of the file descriptor of a DIR, and therefore have to
+ play tricks with file descriptors before and after a call to opendir(). */
+
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+# if GNULIB_DIRENT_SAFER
+# include "dirent--.h"
+# endif
+
+# ifndef REPLACE_FCHDIR
+# define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+ First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
+ that, simulate it by using fchdir metadata, or by doing
+ save_cwd/fchdir/opendir(".")/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+
+ If successful, the resulting stream is based on FD in
+ implementations where streams are based on file descriptors and in
+ applications where no other thread or signal handler allocates or
+ frees file descriptors. In other cases, consult dirfd on the result
+ to find out whether FD is still being used.
+
+ Otherwise, this function works just like POSIX fdopendir.
+
+ W A R N I N G:
+
+ Unlike other fd-related functions, this one places constraints on FD.
+ If this function returns successfully, FD is under control of the
+ dirent.h system, and the caller should not close or modify the state of
+ FD other than by the dirent.h functions. */
DIR *
fdopendir (int fd)
{
@@ -119,7 +143,6 @@ fdopendir (int fd)
return dir;
}
-# endif
/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
to be a dup of FD which is less than FD - 1 and which will be
@@ -188,7 +211,7 @@ fd_clone_opendir (int fd, struct saved_cwd const *cwd)
if (proc_file != buf)
free (proc_file);
}
-# if REPLACE_FCHDIR
+# if REPLACE_FCHDIR
if (! dir && EXPECTED_ERRNO (saved_errno))
{
char const *name = _gl_directory_name (fd);
@@ -203,7 +226,7 @@ fd_clone_opendir (int fd, struct saved_cwd const *cwd)
return dp;
}
-# endif
+# endif
errno = saved_errno;
return dir;
}
@@ -223,6 +246,8 @@ fd_clone_opendir (int fd, struct saved_cwd const *cwd)
}
}
+# endif
+
#else /* HAVE_FDOPENDIR */
# include <errno.h>
diff --git a/gl/lib/file-set.c b/gl/lib/file-set.c
index 3270551b..44cf6430 100644
--- a/gl/lib/file-set.c
+++ b/gl/lib/file-set.c
@@ -1,5 +1,5 @@
/* Specialized functions to manipulate a set of files.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 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/gl/lib/file-set.h b/gl/lib/file-set.h
index dc9d0ae5..c2508b01 100644
--- a/gl/lib/file-set.h
+++ b/gl/lib/file-set.h
@@ -1,5 +1,5 @@
/* Very specialized set-of-files code.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -18,7 +18,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdbool.h>
#include "hash.h"
diff --git a/gl/lib/filename.h b/gl/lib/filename.h
index ab77ca2d..a2400a9d 100644
--- a/gl/lib/filename.h
+++ b/gl/lib/filename.h
@@ -1,5 +1,5 @@
/* Basic filename support macros.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 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/gl/lib/filenamecat-lgpl.c b/gl/lib/filenamecat-lgpl.c
index 56981aac..6d7ed848 100644
--- a/gl/lib/filenamecat-lgpl.c
+++ b/gl/lib/filenamecat-lgpl.c
@@ -1,6 +1,6 @@
/* Concatenate two arbitrary file names.
- Copyright (C) 1996-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009-2023 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/gl/lib/filenamecat.h b/gl/lib/filenamecat.h
index f11bd289..29a4daaf 100644
--- a/gl/lib/filenamecat.h
+++ b/gl/lib/filenamecat.h
@@ -1,6 +1,6 @@
/* Concatenate two arbitrary file names.
- Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2022 Free Software
+ Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -18,6 +18,11 @@
/* Written by Jim Meyering. */
+/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdlib.h>
#if GNULIB_FILENAMECAT
diff --git a/gl/lib/flexmember.h b/gl/lib/flexmember.h
index 1545639f..8df44195 100644
--- a/gl/lib/flexmember.h
+++ b/gl/lib/flexmember.h
@@ -1,6 +1,6 @@
/* Sizes of structs with flexible array members.
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,6 +20,11 @@
Written by Paul Eggert. */
+/* This file uses _Alignof. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
@@ -38,7 +43,7 @@
followed by N bytes of other data. The result is suitable as an
argument to malloc. For example:
- struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; };
+ struct s { int a; char d[FLEXIBLE_ARRAY_MEMBER]; };
struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char)));
FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N),
@@ -58,3 +63,14 @@
#define FLEXSIZEOF(type, member, n) \
((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
& ~ (FLEXALIGNOF (type) - 1))
+
+/* Yield a properly aligned upper bound on the size of a struct of
+ type TYPE with a flexible array member named MEMBER that has N
+ elements. The result is suitable as an argument to malloc.
+ For example:
+
+ struct s { int a; double d[FLEXIBLE_ARRAY_MEMBER]; };
+ struct s *p = malloc (FLEXNSIZEOF (struct s, d, n));
+ */
+#define FLEXNSIZEOF(type, member, n) \
+ FLEXSIZEOF (type, member, (n) * sizeof (((type *) 0)->member[0]))
diff --git a/gl/lib/float+.h b/gl/lib/float+.h
index 9ab45208..e7531e46 100644
--- a/gl/lib/float+.h
+++ b/gl/lib/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 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/gl/lib/float.c b/gl/lib/float.c
index de850645..f81ff33d 100644
--- a/gl/lib/float.c
+++ b/gl/lib/float.c
@@ -1,5 +1,5 @@
/* Auxiliary definitions for <float.h>.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/float.in.h b/gl/lib/float.in.h
index a4183765..bf2c502c 100644
--- a/gl/lib/float.in.h
+++ b/gl/lib/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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/gl/lib/flock.c b/gl/lib/flock.c
index 28773d5c..85433e72 100644
--- a/gl/lib/flock.c
+++ b/gl/lib/flock.c
@@ -6,7 +6,7 @@
Written by Richard W.M. Jones <rjones.at.redhat.com>
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/gl/lib/fnmatch.c b/gl/lib/fnmatch.c
index b33a127d..32cfb48d 100644
--- a/gl/lib/fnmatch.c
+++ b/gl/lib/fnmatch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -30,6 +30,7 @@
#include <errno.h>
#include <ctype.h>
#include <string.h>
+#include <stdckdint.h>
#include <stdlib.h>
#if defined _LIBC || HAVE_ALLOCA
# include <alloca.h>
@@ -37,7 +38,6 @@
#include <wchar.h>
#include <wctype.h>
#include <stddef.h>
-#include <stdbool.h>
/* We need some of the locale data (the collation sequence information)
but there is no interface to get this information in general. Therefore
@@ -64,7 +64,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
#endif
#ifdef _LIBC
-# if __GNUC__ >= 7
+# if __glibc_has_attribute (__fallthrough__)
# define FALLTHROUGH __attribute__ ((__fallthrough__))
# else
# define FALLTHROUGH ((void) 0)
@@ -73,7 +73,6 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
# include "attribute.h"
#endif
-#include <intprops.h>
#include <flexmember.h>
#ifdef _LIBC
diff --git a/gl/lib/fnmatch.in.h b/gl/lib/fnmatch.in.h
index a282c09f..144143b7 100644
--- a/gl/lib/fnmatch.in.h
+++ b/gl/lib/fnmatch.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <fnmatch.h>.
- Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2022 Free
+ Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2023 Free
Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -32,6 +32,11 @@
#ifndef _@GUARD_PREFIX@_FNMATCH_H
#define _@GUARD_PREFIX@_FNMATCH_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
diff --git a/gl/lib/fnmatch_loop.c b/gl/lib/fnmatch_loop.c
index e6359537..68a3b7a5 100644
--- a/gl/lib/fnmatch_loop.c
+++ b/gl/lib/fnmatch_loop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -1039,8 +1039,8 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
idx_t slen = FLEXSIZEOF (struct patternlist, str, 0); \
idx_t new_used = alloca_used + slen; \
idx_t plensize; \
- if (INT_MULTIPLY_WRAPV (plen, sizeof (CHAR), &plensize) \
- || INT_ADD_WRAPV (new_used, plensize, &new_used)) \
+ if (ckd_mul (&plensize, plen, sizeof (CHAR)) \
+ || ckd_add (&new_used, new_used, plensize)) \
{ \
retval = -2; \
goto out; \
diff --git a/gl/lib/free.c b/gl/lib/free.c
index 86ebe6c6..372a6b0f 100644
--- a/gl/lib/free.c
+++ b/gl/lib/free.c
@@ -1,6 +1,6 @@
/* Make free() preserve errno.
- Copyright (C) 2003, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009-2023 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/gl/lib/fstat.c b/gl/lib/fstat.c
index 3928c860..6a235002 100644
--- a/gl/lib/fstat.c
+++ b/gl/lib/fstat.c
@@ -1,5 +1,5 @@
/* fstat() replacement.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/fstatat.c b/gl/lib/fstatat.c
index 6e834496..372965ef 100644
--- a/gl/lib/fstatat.c
+++ b/gl/lib/fstatat.c
@@ -1,6 +1,6 @@
/* Work around an fstatat bug on Solaris 9.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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/gl/lib/getcwd-lgpl.c b/gl/lib/getcwd-lgpl.c
index f449ac85..8a5bde99 100644
--- a/gl/lib/getcwd-lgpl.c
+++ b/gl/lib/getcwd-lgpl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is part of gnulib.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/getcwd.c b/gl/lib/getcwd.c
index 113332f1..28f69133 100644
--- a/gl/lib/getcwd.c
+++ b/gl/lib/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -16,6 +16,7 @@
#if !_LIBC
# include <config.h>
+# include <stdio.h>
# include <unistd.h>
# include "pathmax.h"
#else
@@ -28,7 +29,6 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdbool.h>
#include <stddef.h>
#include <fcntl.h> /* For AT_FDCWD on Solaris 9. */
@@ -114,13 +114,21 @@
FIXME - if the kernel ever adds support for multi-thread safety for
avoiding standard fds, then we should use opendir_safer and
openat_safer. */
-#ifdef GNULIB_defined_opendir
+#ifdef GNULIB_defined_DIR
+# undef DIR
# undef opendir
-#endif
-#ifdef GNULIB_defined_closedir
# undef closedir
+# undef readdir
+# undef rewinddir
+#else
+# ifdef GNULIB_defined_opendir
+# undef opendir
+# endif
+# ifdef GNULIB_defined_closedir
+# undef closedir
+# endif
#endif
-
+
#if defined _WIN32 && !defined __CYGWIN__
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static char *
@@ -173,6 +181,9 @@ __getcwd_generic (char *buf, size_t size)
#if HAVE_OPENAT_SUPPORT
int fd = AT_FDCWD;
bool fd_needs_closing = false;
+# if defined __linux__
+ bool proc_fs_not_mounted = false;
+# endif
#else
char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1];
char *dotlist = dots;
@@ -438,6 +449,67 @@ __getcwd_generic (char *buf, size_t size)
thisdev = dotdev;
thisino = dotino;
+
+#if HAVE_OPENAT_SUPPORT
+ /* On some platforms, a system call returns the directory that FD points
+ to. This is useful if some of the ancestor directories of the
+ directory are unreadable, because in this situation the loop that
+ climbs up the ancestor hierarchy runs into an EACCES error.
+ For example, in some Android app, /data/data/com.termux is readable,
+ but /data/data and /data are not. */
+# if defined __linux__
+ /* On Linux, in particular, if /proc is mounted,
+ readlink ("/proc/self/fd/<fd>")
+ returns the directory, if its length is < 4096. (If the length is
+ >= 4096, it fails with error ENAMETOOLONG, even if the buffer that we
+ pass to the readlink function would be large enough.) */
+ if (!proc_fs_not_mounted)
+ {
+ char namebuf[14 + 10 + 1];
+ sprintf (namebuf, "/proc/self/fd/%u", (unsigned int) fd);
+ char linkbuf[4096];
+ ssize_t linklen = readlink (namebuf, linkbuf, sizeof linkbuf);
+ if (linklen < 0)
+ {
+ if (errno != ENAMETOOLONG)
+ /* If this call was not successful, the next one will likely be
+ not successful either. */
+ proc_fs_not_mounted = true;
+ }
+ else
+ {
+ dirroom = dirp - dir;
+ if (dirroom < linklen)
+ {
+ if (size != 0)
+ {
+ __set_errno (ERANGE);
+ goto lose;
+ }
+ else
+ {
+ char *tmp;
+ size_t oldsize = allocated;
+
+ allocated += linklen - dirroom;
+ if (allocated < oldsize
+ || ! (tmp = realloc (dir, allocated)))
+ goto memory_exhausted;
+
+ /* Move current contents up to the end of the buffer. */
+ dirp = memmove (tmp + dirroom + (allocated - oldsize),
+ tmp + dirroom,
+ oldsize - dirroom);
+ dir = tmp;
+ }
+ }
+ dirp -= linklen;
+ memcpy (dirp, linkbuf, linklen);
+ break;
+ }
+ }
+# endif
+#endif
}
if (dirstream && __closedir (dirstream) != 0)
diff --git a/gl/lib/getdelim.c b/gl/lib/getdelim.c
index 9eb0483c..e414df64 100644
--- a/gl/lib/getdelim.c
+++ b/gl/lib/getdelim.c
@@ -1,5 +1,5 @@
/* getdelim.c --- Implementation of replacement getdelim function.
- Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2022 Free Software
+ Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -30,10 +30,6 @@
#include <stdlib.h>
#include <errno.h>
-#ifndef SSIZE_MAX
-# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
-#endif
-
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
# define getc_maybe_unlocked(fp) getc(fp)
diff --git a/gl/lib/getdtablesize.c b/gl/lib/getdtablesize.c
index 793e0f88..ac2d1753 100644
--- a/gl/lib/getdtablesize.c
+++ b/gl/lib/getdtablesize.c
@@ -1,5 +1,5 @@
/* getdtablesize() function: Return maximum possible file descriptor value + 1.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/getline.c b/gl/lib/getline.c
index 34b91177..85f16ab8 100644
--- a/gl/lib/getline.c
+++ b/gl/lib/getline.c
@@ -1,5 +1,5 @@
/* getline.c --- Implementation of replacement getline function.
- Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2023 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/gl/lib/getlogin_r.c b/gl/lib/getlogin_r.c
index 6bdf0585..06170106 100644
--- a/gl/lib/getlogin_r.c
+++ b/gl/lib/getlogin_r.c
@@ -1,6 +1,6 @@
/* Provide a working getlogin_r for systems which lack it.
- Copyright (C) 2005-2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2010-2023 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/gl/lib/getopt-cdefs.in.h b/gl/lib/getopt-cdefs.in.h
index b6dd913c..e76c78cb 100644
--- a/gl/lib/getopt-cdefs.in.h
+++ b/gl/lib/getopt-cdefs.in.h
@@ -1,5 +1,5 @@
/* getopt-on-non-glibc compatibility macros.
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getopt-core.h b/gl/lib/getopt-core.h
index 1c40ecc8..c5dd4936 100644
--- a/gl/lib/getopt-core.h
+++ b/gl/lib/getopt-core.h
@@ -1,5 +1,5 @@
/* Declarations for getopt (basic, portable features only).
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getopt-ext.h b/gl/lib/getopt-ext.h
index d661fcc5..d37c2932 100644
--- a/gl/lib/getopt-ext.h
+++ b/gl/lib/getopt-ext.h
@@ -1,5 +1,5 @@
/* Declarations for getopt (GNU extensions).
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getopt-pfx-core.h b/gl/lib/getopt-pfx-core.h
index 3eead0e0..095e3930 100644
--- a/gl/lib/getopt-pfx-core.h
+++ b/gl/lib/getopt-pfx-core.h
@@ -1,5 +1,5 @@
/* getopt (basic, portable features) gnulib wrapper header.
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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.
@@ -47,7 +47,7 @@
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
-/* Work around a a problem on macOS, which declares getopt with a
+/* Work around a problem on macOS, which declares getopt with a
trailing __DARWIN_ALIAS(getopt) that would expand to something like
__asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
diff --git a/gl/lib/getopt-pfx-ext.h b/gl/lib/getopt-pfx-ext.h
index 85a6cb5d..8578d725 100644
--- a/gl/lib/getopt-pfx-ext.h
+++ b/gl/lib/getopt-pfx-ext.h
@@ -1,5 +1,5 @@
/* getopt (GNU extensions) gnulib wrapper header.
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getopt.c b/gl/lib/getopt.c
index 128dc7fc..1e2441c4 100644
--- a/gl/lib/getopt.c
+++ b/gl/lib/getopt.c
@@ -1,5 +1,5 @@
/* Getopt for GNU.
- Copyright (C) 1987-2022 Free Software Foundation, Inc.
+ Copyright (C) 1987-2023 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/gl/lib/getopt.in.h b/gl/lib/getopt.in.h
index 9bc50ee2..0867d365 100644
--- a/gl/lib/getopt.in.h
+++ b/gl/lib/getopt.in.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getopt1.c b/gl/lib/getopt1.c
index 990eee1b..49323aa8 100644
--- a/gl/lib/getopt1.c
+++ b/gl/lib/getopt1.c
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987-2022 Free Software Foundation, Inc.
+ Copyright (C) 1987-2023 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/gl/lib/getopt_int.h b/gl/lib/getopt_int.h
index ccdbb973..4d9e24be 100644
--- a/gl/lib/getopt_int.h
+++ b/gl/lib/getopt_int.h
@@ -1,5 +1,5 @@
/* Internal declarations for getopt.
- Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1989-2023 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/gl/lib/getprogname.c b/gl/lib/getprogname.c
index 62a48004..204855a4 100644
--- a/gl/lib/getprogname.c
+++ b/gl/lib/getprogname.c
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2016-2022 Free Software Foundation, Inc.
+ Copyright (C) 2016-2023 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
@@ -16,11 +16,10 @@
#include <config.h>
-/* Specification. */
-#include "getprogname.h"
+/* Specification. Also get __argv declaration. */
+#include <stdlib.h>
#include <errno.h> /* get program_invocation_name declaration */
-#include <stdlib.h> /* get __argv declaration */
#ifdef _AIX
# include <unistd.h>
@@ -53,13 +52,12 @@
#if defined __SCO_VERSION__ || defined __sysv5__
# include <fcntl.h>
-# include <stdlib.h>
# include <string.h>
#endif
#include "basename-lgpl.h"
-#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
+#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Solaris >= 11, Cygwin, Android API level >= 21 */
char const *
getprogname (void)
{
@@ -214,7 +212,19 @@ getprogname (void)
{
char *s = strdup (last_component (buf.ps_pathptr));
if (s)
- p = s;
+ {
+# if defined __XPLINK__ && __CHARSET_LIB == 1
+ /* The compiler option -qascii is in use.
+ https://makingdeveloperslivesbetter.wordpress.com/2022/01/07/is-z-os-ascii-or-ebcdic-yes/
+ https://www.ibm.com/docs/en/zos/2.5.0?topic=features-macros-related-compiler-option-settings
+ So, convert the result from EBCDIC to ASCII.
+ https://www.ibm.com/docs/en/zos/2.5.0?topic=functions-e2a-s-convert-string-from-ebcdic-ascii */
+ if (__e2a_s (s) == (size_t)-1)
+ free (s);
+ else
+# endif
+ p = s;
+ }
break;
}
}
diff --git a/gl/lib/getprogname.h b/gl/lib/getprogname.h
index 9a35e584..13314f21 100644
--- a/gl/lib/getprogname.h
+++ b/gl/lib/getprogname.h
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2016-2022 Free Software Foundation, Inc.
+ Copyright (C) 2016-2023 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
@@ -19,22 +19,8 @@
#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Return the base name of the executing program.
- On native Windows this will usually end in ".exe" or ".EXE". */
-#ifndef HAVE_GETPROGNAME
-extern char const *getprogname (void)
-# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
- _GL_ATTRIBUTE_PURE
-# endif
- ;
-#endif
-
-#ifdef __cplusplus
-}
+#if __GNUC__ || (__clang_major__ >= 4)
+# warning "The include file getprogname.h is deprecated. Use <stdlib.h> instead."
#endif
#endif
diff --git a/gl/lib/getrandom.c b/gl/lib/getrandom.c
index e1468730..19bb3429 100644
--- a/gl/lib/getrandom.c
+++ b/gl/lib/getrandom.c
@@ -1,6 +1,6 @@
/* Obtain a series of random bytes.
- Copyright 2020-2022 Free Software Foundation, Inc.
+ Copyright 2020-2023 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,7 +23,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <unistd.h>
#if defined _WIN32 && ! defined __CYGWIN__
diff --git a/gl/lib/gettext.h b/gl/lib/gettext.h
index b3577a04..d0462c47 100644
--- a/gl/lib/gettext.h
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gettime.c b/gl/lib/gettime.c
index 541af18b..ec40ff90 100644
--- a/gl/lib/gettime.c
+++ b/gl/lib/gettime.c
@@ -1,6 +1,6 @@
/* gettime -- get the system clock
- Copyright (C) 2002, 2004-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004-2007, 2009-2023 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,8 +35,8 @@ gettime (struct timespec *ts)
#else
struct timeval tv;
gettimeofday (&tv, NULL);
- ts->tv_sec = tv.tv_sec;
- ts->tv_nsec = tv.tv_usec * 1000;
+ *ts = (struct timespec) { .tv_sec = tv.tv_sec,
+ .tv_nsec = tv.tv_usec * 1000 };
#endif
}
diff --git a/gl/lib/gettimeofday.c b/gl/lib/gettimeofday.c
index 36c7920a..c71629cb 100644
--- a/gl/lib/gettimeofday.c
+++ b/gl/lib/gettimeofday.c
@@ -1,6 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
- Copyright (C) 2001-2003, 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2007, 2009-2023 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
@@ -113,8 +113,10 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
ULONGLONG since_1970 =
since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000;
ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10;
- tv->tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000;
- tv->tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000;
+ *tv = (struct timeval) {
+ .tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000,
+ .tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000
+ };
return 0;
@@ -127,10 +129,7 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
struct timeval otv;
int result = gettimeofday (&otv, (struct timezone *) tz);
if (result == 0)
- {
- tv->tv_sec = otv.tv_sec;
- tv->tv_usec = otv.tv_usec;
- }
+ *tv = otv;
# else
int result = gettimeofday (tv, (struct timezone *) tz);
# endif
@@ -143,8 +142,7 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
# error "Only 1-second nominal clock resolution found. Is that intended?" \
"If so, compile with the -DOK_TO_USE_1S_CLOCK option."
# endif
- tv->tv_sec = time (NULL);
- tv->tv_usec = 0;
+ *tv = (struct timeval) { .tv_sec = time (NULL), .tv_usec = 0 };
return 0;
diff --git a/gl/lib/gl_anyhash1.h b/gl/lib/gl_anyhash1.h
index c6c046ee..0e28fddc 100644
--- a/gl/lib/gl_anyhash1.h
+++ b/gl/lib/gl_anyhash1.h
@@ -1,5 +1,5 @@
/* Hash table for sequential list, set, and map data type.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anyhash2.h b/gl/lib/gl_anyhash2.h
index 5ceba987..c1911512 100644
--- a/gl/lib/gl_anyhash2.h
+++ b/gl/lib/gl_anyhash2.h
@@ -1,5 +1,5 @@
/* Hash table for sequential list, set, and map data type.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anyhash_primes.h b/gl/lib/gl_anyhash_primes.h
index b00a6062..7be9c3c6 100644
--- a/gl/lib/gl_anyhash_primes.h
+++ b/gl/lib/gl_anyhash_primes.h
@@ -1,5 +1,5 @@
/* Table of primes, for use by hash tables.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anylinked_list1.h b/gl/lib/gl_anylinked_list1.h
index 709106a3..51dda533 100644
--- a/gl/lib/gl_anylinked_list1.h
+++ b/gl/lib/gl_anylinked_list1.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a linked list.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anylinked_list2.h b/gl/lib/gl_anylinked_list2.h
index af83f0d3..e8219ef7 100644
--- a/gl/lib/gl_anylinked_list2.h
+++ b/gl/lib/gl_anylinked_list2.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a linked list.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anyrbtree_list1.h b/gl/lib/gl_anyrbtree_list1.h
index 750fd364..ba42ab8d 100644
--- a/gl/lib/gl_anyrbtree_list1.h
+++ b/gl/lib/gl_anyrbtree_list1.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anyrbtree_list2.h b/gl/lib/gl_anyrbtree_list2.h
index 95d193cd..cd4205a8 100644
--- a/gl/lib/gl_anyrbtree_list2.h
+++ b/gl/lib/gl_anyrbtree_list2.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anytree_list1.h b/gl/lib/gl_anytree_list1.h
index 1f05430d..47076fd4 100644
--- a/gl/lib/gl_anytree_list1.h
+++ b/gl/lib/gl_anytree_list1.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_anytree_list2.h b/gl/lib/gl_anytree_list2.h
index 165b7153..5105760e 100644
--- a/gl/lib/gl_anytree_list2.h
+++ b/gl/lib/gl_anytree_list2.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_array_list.c b/gl/lib/gl_array_list.c
index 30186326..ca5527fe 100644
--- a/gl/lib/gl_array_list.c
+++ b/gl/lib/gl_array_list.c
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by an array.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_array_list.h b/gl/lib/gl_array_list.h
index 3d5b9f94..1e9afd48 100644
--- a/gl/lib/gl_array_list.h
+++ b/gl/lib/gl_array_list.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by an array.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_hash_map.c b/gl/lib/gl_hash_map.c
index 6042b60e..a79815ab 100644
--- a/gl/lib/gl_hash_map.c
+++ b/gl/lib/gl_hash_map.c
@@ -1,5 +1,5 @@
/* Map data type implemented by a hash table.
- Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_hash_map.h b/gl/lib/gl_hash_map.h
index 66927760..edcd9a24 100644
--- a/gl/lib/gl_hash_map.h
+++ b/gl/lib/gl_hash_map.h
@@ -1,5 +1,5 @@
/* Map data type implemented by a hash table.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_hash_set.c b/gl/lib/gl_hash_set.c
index 75b2e997..025d1e17 100644
--- a/gl/lib/gl_hash_set.c
+++ b/gl/lib/gl_hash_set.c
@@ -1,5 +1,5 @@
/* Set data type implemented by a hash table.
- Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_hash_set.h b/gl/lib/gl_hash_set.h
index ea61eb46..507820df 100644
--- a/gl/lib/gl_hash_set.h
+++ b/gl/lib/gl_hash_set.h
@@ -1,5 +1,5 @@
/* Set data type implemented by a hash table.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_linkedhash_list.c b/gl/lib/gl_linkedhash_list.c
index dbf43de7..dd755b10 100644
--- a/gl/lib/gl_linkedhash_list.c
+++ b/gl/lib/gl_linkedhash_list.c
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a hash table with a linked list.
- Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_linkedhash_list.h b/gl/lib/gl_linkedhash_list.h
index 77ef8f46..589b7675 100644
--- a/gl/lib/gl_linkedhash_list.h
+++ b/gl/lib/gl_linkedhash_list.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a hash table with a linked list.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_list.c b/gl/lib/gl_list.c
index cccb39cc..6fd757c7 100644
--- a/gl/lib/gl_list.c
+++ b/gl/lib/gl_list.c
@@ -1,6 +1,6 @@
/* Abstract sequential list data type.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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/gl/lib/gl_list.h b/gl/lib/gl_list.h
index bf6a2ba4..b550db06 100644
--- a/gl/lib/gl_list.h
+++ b/gl/lib/gl_list.h
@@ -1,5 +1,5 @@
/* Abstract sequential list data type. -*- coding: utf-8 -*-
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
@@ -18,12 +18,14 @@
#ifndef _GL_LIST_H
#define _GL_LIST_H
-#include <stdbool.h>
-#include <stddef.h>
-
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_NODISCARD. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
+#include <stddef.h>
+
_GL_INLINE_HEADER_BEGIN
#ifndef GL_LIST_INLINE
# define GL_LIST_INLINE _GL_INLINE
diff --git a/gl/lib/gl_map.c b/gl/lib/gl_map.c
index 56043541..75e06747 100644
--- a/gl/lib/gl_map.c
+++ b/gl/lib/gl_map.c
@@ -1,6 +1,6 @@
/* Abstract map data type.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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
diff --git a/gl/lib/gl_map.h b/gl/lib/gl_map.h
index a7a37643..12846f44 100644
--- a/gl/lib/gl_map.h
+++ b/gl/lib/gl_map.h
@@ -1,5 +1,5 @@
/* Abstract map data type.
- Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,14 @@
#ifndef _GL_MAP_H
#define _GL_MAP_H
-#include <stdbool.h>
-#include <stddef.h>
-
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_NODISCARD. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
+#include <stddef.h>
+
_GL_INLINE_HEADER_BEGIN
#ifndef GL_MAP_INLINE
# define GL_MAP_INLINE _GL_INLINE
diff --git a/gl/lib/gl_rbtree_list.c b/gl/lib/gl_rbtree_list.c
index a7c35158..d395d684 100644
--- a/gl/lib/gl_rbtree_list.c
+++ b/gl/lib/gl_rbtree_list.c
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
@@ -37,8 +37,6 @@
#include "gl_anytree_list2.h"
/* For debugging. */
-extern void gl_rbtree_list_check_invariants (gl_list_t list);
-
static unsigned int
check_invariants (gl_list_node_t node, gl_list_node_t parent)
{
@@ -62,6 +60,7 @@ check_invariants (gl_list_node_t node, gl_list_node_t parent)
return left_blackheight + (node->color == BLACK ? 1 : 0);
}
+extern void gl_rbtree_list_check_invariants (gl_list_t list);
void
gl_rbtree_list_check_invariants (gl_list_t list)
{
diff --git a/gl/lib/gl_rbtree_list.h b/gl/lib/gl_rbtree_list.h
index 4ff4f1e9..4896644c 100644
--- a/gl/lib/gl_rbtree_list.h
+++ b/gl/lib/gl_rbtree_list.h
@@ -1,5 +1,5 @@
/* Sequential list data type implemented by a binary tree.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/gl_set.c b/gl/lib/gl_set.c
index d8e53d64..233da73a 100644
--- a/gl/lib/gl_set.c
+++ b/gl/lib/gl_set.c
@@ -1,6 +1,6 @@
/* Abstract set data type.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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
diff --git a/gl/lib/gl_set.h b/gl/lib/gl_set.h
index 14b3053e..e88e2552 100644
--- a/gl/lib/gl_set.h
+++ b/gl/lib/gl_set.h
@@ -1,5 +1,5 @@
/* Abstract set data type.
- Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,14 @@
#ifndef _GL_SET_H
#define _GL_SET_H
-#include <stdbool.h>
-#include <stddef.h>
-
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_NODISCARD. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
+#include <stddef.h>
+
_GL_INLINE_HEADER_BEGIN
#ifndef GL_SET_INLINE
# define GL_SET_INLINE _GL_INLINE
diff --git a/gl/lib/gl_xlist.c b/gl/lib/gl_xlist.c
index 204698e7..5ca5a78b 100644
--- a/gl/lib/gl_xlist.c
+++ b/gl/lib/gl_xlist.c
@@ -1,6 +1,6 @@
/* Abstract sequential list data type, with out-of-memory checking.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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
diff --git a/gl/lib/gl_xlist.h b/gl/lib/gl_xlist.h
index abef3838..91ed804b 100644
--- a/gl/lib/gl_xlist.h
+++ b/gl/lib/gl_xlist.h
@@ -1,5 +1,5 @@
/* Abstract sequential list data type, with out-of-memory checking.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,15 @@
#ifndef _GL_XLIST_H
#define _GL_XLIST_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include "gl_list.h"
#include "xalloc.h"
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef GL_XLIST_INLINE
# define GL_XLIST_INLINE _GL_INLINE
diff --git a/gl/lib/gl_xmap.c b/gl/lib/gl_xmap.c
index 3a9e886a..0787f6f2 100644
--- a/gl/lib/gl_xmap.c
+++ b/gl/lib/gl_xmap.c
@@ -1,6 +1,6 @@
/* Abstract map data type, with out-of-memory checking.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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
diff --git a/gl/lib/gl_xmap.h b/gl/lib/gl_xmap.h
index 85dc1539..ad1edbfb 100644
--- a/gl/lib/gl_xmap.h
+++ b/gl/lib/gl_xmap.h
@@ -1,5 +1,5 @@
/* Abstract map data type, with out-of-memory checking.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2018.
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,15 @@
#ifndef _GL_XMAP_H
#define _GL_XMAP_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include "gl_map.h"
#include "xalloc.h"
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef GL_XMAP_INLINE
# define GL_XMAP_INLINE _GL_INLINE
diff --git a/gl/lib/gl_xset.c b/gl/lib/gl_xset.c
index fb7c1462..23589bd2 100644
--- a/gl/lib/gl_xset.c
+++ b/gl/lib/gl_xset.c
@@ -1,6 +1,6 @@
/* Abstract set data type, with out-of-memory checking.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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
diff --git a/gl/lib/gl_xset.h b/gl/lib/gl_xset.h
index ad80a8c2..921e1f38 100644
--- a/gl/lib/gl_xset.h
+++ b/gl/lib/gl_xset.h
@@ -1,5 +1,5 @@
/* Abstract set data type, with out-of-memory checking.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,15 @@
#ifndef _GL_XSET_H
#define _GL_XSET_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include "gl_set.h"
#include "xalloc.h"
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef GL_XSET_INLINE
# define GL_XSET_INLINE _GL_INLINE
diff --git a/gl/lib/glob-libc.h b/gl/lib/glob-libc.h
index efef63d3..09b251e5 100644
--- a/gl/lib/glob-libc.h
+++ b/gl/lib/glob-libc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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/gl/lib/glob.c b/gl/lib/glob.c
index 57cb3bd1..af0694ee 100644
--- a/gl/lib/glob.c
+++ b/gl/lib/glob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -31,7 +31,6 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <assert.h>
@@ -183,16 +182,17 @@ convert_dirent64 (const struct dirent64 *source)
#endif
#ifndef _LIBC
-/* The results of opendir() in this file are not used with dirfd and fchdir,
- and we do not leak fds to any single-threaded code that could use stdio,
- therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
- FIXME - if the kernel ever adds support for multi-thread safety for
- avoiding standard fds, then we should use opendir_safer. */
-# ifdef GNULIB_defined_opendir
-# undef opendir
-# endif
-# ifdef GNULIB_defined_closedir
-# undef closedir
+/* The results of opendir() in this file are used with dirfd. But they are
+ not used with fchdir, and we do not leak fds to any single-threaded code
+ that could use stdio, therefore save some unnecessary recursion in
+ fchdir.c and opendir_safer.c. */
+# ifndef GNULIB_defined_DIR
+# ifdef GNULIB_defined_opendir
+# undef opendir
+# endif
+# ifdef GNULIB_defined_closedir
+# undef closedir
+# endif
# endif
/* Just use malloc. */
diff --git a/gl/lib/glob.in.h b/gl/lib/glob.in.h
index a0a3156c..4a311f81 100644
--- a/gl/lib/glob.in.h
+++ b/gl/lib/glob.in.h
@@ -1,6 +1,6 @@
/* glob.h -- Find a path matching a pattern.
- Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
@@ -32,6 +32,11 @@
#ifndef _@GUARD_PREFIX@_GLOB_H
#define _@GUARD_PREFIX@_GLOB_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
@@ -120,7 +125,9 @@ _GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
_gl_glob_errfunc_fn __errfunc,
glob_t *_Restrict_ __pglob));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (glob);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef glob
# if HAVE_RAW_DECL_GLOB
diff --git a/gl/lib/glob_internal.h b/gl/lib/glob_internal.h
index bd023927..b85fa4ff 100644
--- a/gl/lib/glob_internal.h
+++ b/gl/lib/glob_internal.h
@@ -1,5 +1,5 @@
/* Shared definition for glob and glob_pattern_p.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/glob_pattern_p.c b/gl/lib/glob_pattern_p.c
index 4044a508..8ac0bc60 100644
--- a/gl/lib/glob_pattern_p.c
+++ b/gl/lib/glob_pattern_p.c
@@ -1,5 +1,5 @@
/* Return nonzero if PATTERN contains any metacharacters.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/globfree.c b/gl/lib/globfree.c
index f034becf..853f3bef 100644
--- a/gl/lib/globfree.c
+++ b/gl/lib/globfree.c
@@ -1,5 +1,5 @@
/* Frees the dynamically allocated storage from an earlier call to glob.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/glthread/lock.c b/gl/lib/glthread/lock.c
index b650c219..82fb7553 100644
--- a/gl/lib/glthread/lock.c
+++ b/gl/lib/glthread/lock.c
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/glthread/lock.h b/gl/lib/glthread/lock.h
index 47eed8fe..805cd1cf 100644
--- a/gl/lib/glthread/lock.h
+++ b/gl/lib/glthread/lock.h
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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
@@ -77,6 +77,14 @@
#ifndef _LOCK_H
#define _LOCK_H
+/* This file uses HAVE_THREADS_H, HAVE_PTHREAD_RWLOCK,
+ HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER,
+ PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
+ HAVE_PTHREAD_MUTEX_RECURSIVE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <errno.h>
#include <stdlib.h>
diff --git a/gl/lib/glthread/threadlib.c b/gl/lib/glthread/threadlib.c
index 88a76bad..5ecf827f 100644
--- a/gl/lib/glthread/threadlib.c
+++ b/gl/lib/glthread/threadlib.c
@@ -1,5 +1,5 @@
/* Multithreading primitives.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/hard-locale.c b/gl/lib/hard-locale.c
index f7fbc470..c01fce53 100644
--- a/gl/lib/hard-locale.c
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#include "hard-locale.h"
#include <locale.h>
+#include <stdlib.h>
#include <string.h>
bool
@@ -31,5 +32,16 @@ hard_locale (int category)
if (setlocale_null_r (category, locale, sizeof (locale)))
return false;
- return !(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0);
+ if (!(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0))
+ return true;
+
+#if defined __ANDROID__
+ /* On Android 5.0 or newer, it is possible to set a locale that has the same
+ name as the "C" locale but in fact uses UTF-8 encoding. Cf. test case 2 in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00141.html>. */
+ if (MB_CUR_MAX > 1)
+ return true;
+#endif
+
+ return false;
}
diff --git a/gl/lib/hard-locale.h b/gl/lib/hard-locale.h
index 6066f4ed..5123d71d 100644
--- a/gl/lib/hard-locale.h
+++ b/gl/lib/hard-locale.h
@@ -1,6 +1,6 @@
/* Determine whether a locale is hard.
- Copyright (C) 1999, 2003-2004, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003-2004, 2009-2023 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,11 +18,11 @@
#ifndef HARD_LOCALE_H_
# define HARD_LOCALE_H_ 1
-# include <stdbool.h>
-
/* 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.
- CATEGORY must be one of the LC_* values, but not LC_ALL. */
+ CATEGORY must be one of the LC_* values, but not LC_ALL.
+ Note: This function uses the current global locale; it ignores the
+ per-thread locale. */
extern bool hard_locale (int category);
#endif /* HARD_LOCALE_H_ */
diff --git a/gl/lib/hash-pjw-bare.c b/gl/lib/hash-pjw-bare.c
index 31944a1d..e3ca5832 100644
--- a/gl/lib/hash-pjw-bare.c
+++ b/gl/lib/hash-pjw-bare.c
@@ -1,6 +1,6 @@
/* hash-pjw-bare.c -- compute a hash value from a provided buffer.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/hash-pjw-bare.h b/gl/lib/hash-pjw-bare.h
index a18c7f1b..7498ca20 100644
--- a/gl/lib/hash-pjw-bare.h
+++ b/gl/lib/hash-pjw-bare.h
@@ -1,5 +1,5 @@
/* hash-pjw-bare.h -- declaration for a simple hash function
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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
@@ -14,6 +14,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/>. */
+/* This file uses _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
/* Compute a hash code for a buffer starting at X and of size N,
diff --git a/gl/lib/hash-pjw.c b/gl/lib/hash-pjw.c
index 8ba139d5..74afac76 100644
--- a/gl/lib/hash-pjw.c
+++ b/gl/lib/hash-pjw.c
@@ -1,6 +1,6 @@
/* hash-pjw.c -- compute a hash value from a NUL-terminated string.
- Copyright (C) 2001, 2003, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006, 2009-2023 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/gl/lib/hash-pjw.h b/gl/lib/hash-pjw.h
index cdf4da27..69af02f2 100644
--- a/gl/lib/hash-pjw.h
+++ b/gl/lib/hash-pjw.h
@@ -1,5 +1,5 @@
/* hash-pjw.h -- declaration for a simple hash function
- Copyright (C) 2001, 2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2009-2023 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
@@ -14,6 +14,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/>. */
+/* This file uses _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
/* Compute a hash code for a NUL-terminated string starting at X,
diff --git a/gl/lib/hash-triple-simple.c b/gl/lib/hash-triple-simple.c
index b021f348..b0fd31dc 100644
--- a/gl/lib/hash-triple-simple.c
+++ b/gl/lib/hash-triple-simple.c
@@ -1,5 +1,5 @@
/* Hash functions for file-related triples: name, device, inode.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 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/gl/lib/hash-triple.h b/gl/lib/hash-triple.h
index 929995f2..f2cf38b1 100644
--- a/gl/lib/hash-triple.h
+++ b/gl/lib/hash-triple.h
@@ -1,5 +1,5 @@
/* Hash functions for file-related (name, device, inode) triples.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -19,9 +19,13 @@
#ifndef HASH_TRIPLE_H
#define HASH_TRIPLE_H
+/* This file uses _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdbool.h>
/* Describe a just-created or just-renamed destination file. */
struct F_triple
diff --git a/gl/lib/hash.c b/gl/lib/hash.c
index eb723416..918aa0d1 100644
--- a/gl/lib/hash.c
+++ b/gl/lib/hash.c
@@ -1,6 +1,6 @@
/* hash - hashing table processing.
- Copyright (C) 1998-2004, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1998-2004, 2006-2007, 2009-2023 Free Software Foundation, Inc.
Written by Jim Meyering, 1992.
diff --git a/gl/lib/hash.h b/gl/lib/hash.h
index ebfc7407..54d3f22f 100644
--- a/gl/lib/hash.h
+++ b/gl/lib/hash.h
@@ -1,5 +1,5 @@
/* hash - hashing table processing.
- Copyright (C) 1998-1999, 2001, 2003, 2009-2022 Free Software Foundation,
+ Copyright (C) 1998-1999, 2001, 2003, 2009-2023 Free Software Foundation,
Inc.
Written by Jim Meyering <meyering@ascend.com>, 1998.
@@ -24,8 +24,14 @@
#ifndef HASH_H_
# define HASH_H_
+/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEPRECATED,
+ _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_PURE,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
# include <stdio.h>
-# include <stdbool.h>
# ifdef __cplusplus
extern "C" {
@@ -198,7 +204,7 @@ extern Hash_table *hash_xinitialize (size_t candidate,
_GL_ATTRIBUTE_RETURNS_NONNULL;
/* Make all buckets empty, placing any chained entries on the free list.
- Apply the user-specified function data_freer (if any) to the datas of any
+ Apply the user-specified function data_freer (if any) to the data of any
affected entries. */
extern void hash_clear (Hash_table *table);
diff --git a/gl/lib/ialloc.c b/gl/lib/ialloc.c
index 43c10433..cd44d8ca 100644
--- a/gl/lib/ialloc.c
+++ b/gl/lib/ialloc.c
@@ -1,6 +1,6 @@
/* malloc with idx_t rather than size_t
- Copyright 2021-2022 Free Software Foundation, Inc.
+ Copyright 2021-2023 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/gl/lib/ialloc.h b/gl/lib/ialloc.h
index 37cf4bfb..22f57a47 100644
--- a/gl/lib/ialloc.h
+++ b/gl/lib/ialloc.h
@@ -1,6 +1,6 @@
/* ialloc.h -- malloc with idx_t rather than size_t
- Copyright 2021-2022 Free Software Foundation, Inc.
+ Copyright 2021-2023 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,15 +18,18 @@
#ifndef IALLOC_H_
#define IALLOC_H_
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_COLD,
+ _GL_ATTRIBUTE_MALLOC. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include "idx.h"
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef IALLOC_INLINE
# define IALLOC_INLINE _GL_INLINE
@@ -43,6 +46,9 @@ _gl_alloc_nomem (void)
return NULL;
}
+/* imalloc (size) is like malloc (size).
+ It returns a non-NULL pointer to size bytes of memory.
+ Upon failure, it returns NULL with errno set. */
IALLOC_INLINE
_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
void *
@@ -51,6 +57,9 @@ imalloc (idx_t s)
return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem ();
}
+/* irealloc (ptr, size) is like realloc (ptr, size).
+ It returns a non-NULL pointer to size bytes of memory.
+ Upon failure, it returns NULL with errno set. */
IALLOC_INLINE
/*_GL_ATTRIBUTE_DEALLOC_FREE*/
void *
@@ -61,6 +70,9 @@ irealloc (void *p, idx_t s)
return s <= SIZE_MAX ? realloc (p, s | !s) : _gl_alloc_nomem ();
}
+/* icalloc (num, size) is like calloc (num, size).
+ It returns a non-NULL pointer to num * size bytes of memory.
+ Upon failure, it returns NULL with errno set. */
IALLOC_INLINE
_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
void *
@@ -81,6 +93,9 @@ icalloc (idx_t n, idx_t s)
return calloc (n, s);
}
+/* ireallocarray (ptr, num, size) is like reallocarray (ptr, num, size).
+ It returns a non-NULL pointer to num * size bytes of memory.
+ Upon failure, it returns NULL with errno set. */
IALLOC_INLINE void *
ireallocarray (void *p, idx_t n, idx_t s)
{
@@ -97,4 +112,6 @@ ireallocarray (void *p, idx_t n, idx_t s)
}
#endif
+_GL_INLINE_HEADER_END
+
#endif
diff --git a/gl/lib/idpriv-drop.c b/gl/lib/idpriv-drop.c
index e122cb08..b0599447 100644
--- a/gl/lib/idpriv-drop.c
+++ b/gl/lib/idpriv-drop.c
@@ -1,5 +1,5 @@
/* Dropping uid/gid privileges of the current process permanently.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/idpriv-droptemp.c b/gl/lib/idpriv-droptemp.c
index f3272365..2a85431a 100644
--- a/gl/lib/idpriv-droptemp.c
+++ b/gl/lib/idpriv-droptemp.c
@@ -1,5 +1,5 @@
/* Dropping uid/gid privileges of the current process temporarily.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/idpriv.h b/gl/lib/idpriv.h
index b97d1922..99f87c08 100644
--- a/gl/lib/idpriv.h
+++ b/gl/lib/idpriv.h
@@ -1,5 +1,5 @@
/* Dropping uid/gid privileges of the current process.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/idx.h b/gl/lib/idx.h
index c3669dda..23020b7e 100644
--- a/gl/lib/idx.h
+++ b/gl/lib/idx.h
@@ -1,5 +1,5 @@
/* A type for indices and sizes.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 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/gl/lib/intprops-internal.h b/gl/lib/intprops-internal.h
new file mode 100644
index 00000000..0467a9ca
--- /dev/null
+++ b/gl/lib/intprops-internal.h
@@ -0,0 +1,392 @@
+/* intprops-internal.h -- properties of integer types not visible to users
+
+ Copyright (C) 2001-2023 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 the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program 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 _GL_INTPROPS_INTERNAL_H
+#define _GL_INTPROPS_INTERNAL_H
+
+#include <limits.h>
+
+/* Return a value with the common real type of E and V and the value of V.
+ Do not evaluate E. */
+#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
+#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
+
+/* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+
+/* True if the real type T is signed. */
+#define _GL_TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Return 1 if the real expression E, after promotion, has a
+ signed or floating type. Do not evaluate E. */
+#define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions. */
+
+/* The width in bits of the integer type or expression T.
+ Do not evaluate T. T must not be a bit-field expression.
+ Padding bits are not supported; this is checked at compile-time below. */
+#define _GL_TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+
+/* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E is not evaluated. */
+#define _GL_INT_MINIMUM(e) \
+ (_GL_EXPR_SIGNED (e) \
+ ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e) \
+ (_GL_EXPR_SIGNED (e) \
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e) \
+ (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
+
+/* Work around OpenVMS incompatibility with C99. */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
+
+/* This include file assumes that signed types are two's complement without
+ padding bits; the above macros have undefined behavior otherwise.
+ If this is a problem for you, please let us know how to fix it for your host.
+ This assumption is tested by the intprops-tests module. */
+
+/* Does the __typeof__ keyword work? This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+#if (2 <= __GNUC__ \
+ || (4 <= __clang_major__) \
+ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#endif
+
+/* Return 1 if the integer type or expression T might be signed. Return 0
+ if it is definitely unsigned. T must not be a bit-field expression.
+ This macro does not evaluate its argument, and expands to an
+ integer constant expression. */
+#if _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) _GL_TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+ A should not have side effects, and A's type should be an
+ integer with minimum value MIN and maximum MAX. */
+#define _GL_INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
+ ((min) < 0 ? (a) < - (max) : 0 < (a))
+
+/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
+ (A, B, P) work when P is non-null. */
+#ifdef __EDG__
+/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
+ <https://bugs.gnu.org/53256>. */
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
+/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
+ see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
+#elif 7 <= __GNUC__
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
+#else
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#endif
+
+/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
+#if defined __clang_major__ && __clang_major__ < 14
+/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
+#else
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
+#endif
+
+/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
+ __builtin_sub_overflow_p and __builtin_mul_overflow_p. */
+#ifdef __EDG__
+/* In EDG-based compilers like ICC 2021.3 and earlier,
+ __builtin_add_overflow_p etc. are not treated as integral constant
+ expressions even when all arguments are. */
+# define _GL_HAS_BUILTIN_OVERFLOW_P 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#endif
+
+#if (!defined _GL_STDCKDINT_H && 202311 <= __STDC_VERSION__ \
+ && ! (_GL_HAS_BUILTIN_ADD_OVERFLOW && _GL_HAS_BUILTIN_MUL_OVERFLOW))
+# include <stdckdint.h>
+#endif
+
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
+ Return 1 if the result overflows. Arguments should not have side
+ effects and A, B and *R can be of any integer type other than char,
+ bool, a bit-precise integer type, or an enumeration type. */
+#if _GL_HAS_BUILTIN_ADD_OVERFLOW
+# define _GL_INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
+#elif defined ckd_add && defined ckd_sub && !defined _GL_STDCKDINT_H
+# define _GL_INT_ADD_WRAPV(a, b, r) ckd_add (r, + (a), + (b))
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) ckd_sub (r, + (a), + (b))
+#else
+# define _GL_INT_ADD_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
+#endif
+#if _GL_HAS_BUILTIN_MUL_OVERFLOW
+# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+ || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
+ && !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)) \
+ ? ((void) __builtin_mul_overflow (a, b, r), 1) \
+ : __builtin_mul_overflow (a, b, r))
+# endif
+#elif defined ckd_mul && !defined _GL_STDCKDINT_H
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) ckd_mul (r, + (a), + (b))
+#else
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
+#endif
+
+/* 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
+ warnings for _Generic. This matters only for compilers that
+ lack relevant builtins. */
+#if __GNUC__ || defined __clang__
+# define _GL__GENERIC_BOGUS 1
+#else
+# define _GL__GENERIC_BOGUS 0
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. Return 1 if the
+ result overflows. Arguments should not have side effects,
+ and A, B and *R can be of any integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type. */
+#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (_Generic \
+ (*(r), \
+ signed char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ signed char, SCHAR_MIN, SCHAR_MAX), \
+ unsigned char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned char, 0, UCHAR_MAX), \
+ short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ short int, SHRT_MIN, SHRT_MAX), \
+ unsigned short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned short int, 0, USHRT_MAX), \
+ int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX), \
+ unsigned int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX), \
+ long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX), \
+ unsigned long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX), \
+ long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX), \
+ unsigned long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+#else
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. If *R is
+ signed, its type is ST with bounds SMIN..SMAX; otherwise its type
+ is UT with bounds U..UMAX. ST and UT are narrower than int.
+ Return 1 if the result overflows. Arguments should not have side
+ effects, and A, B and *R can be of any integer type other than
+ char, bool, a bit-precise integer type, or an enumeration type. */
+# if _GL_HAVE___TYPEOF__
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (_GL_TYPE_SIGNED (__typeof__ (*(r))) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
+# else
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (overflow (a, b, smin, smax) \
+ ? (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
+ : (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
+# endif
+
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (signed char) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ signed char, SCHAR_MIN, SCHAR_MAX, \
+ unsigned char, UCHAR_MAX) \
+ : sizeof *(r) == sizeof (short int) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ short int, SHRT_MIN, SHRT_MAX, \
+ unsigned short int, USHRT_MAX) \
+ : sizeof *(r) == sizeof (int) \
+ ? (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX)) \
+ : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
+# ifdef LLONG_MAX
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (long int) \
+ ? (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX)) \
+ : (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+# else
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX))
+# endif
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where the operation
+ is given by OP. Use the unsigned type UT for calculation to avoid
+ overflow problems. *R's type is T, with extrema TMIN and TMAX.
+ T can be any signed integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+ Return 1 if the result overflows. */
+#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
+ (overflow (a, b, tmin, tmax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return 1 if the integer expressions A - B and -A would overflow,
+ respectively. Arguments should not have side effects,
+ and can be any signed integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+ These macros are tuned for their last input argument being a constant. */
+
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_INT_NEGATE_OVERFLOW(a) \
+ __builtin_sub_overflow_p (0, a, (__typeof__ (- (a))) 0)
+#else
+# define _GL_INT_NEGATE_OVERFLOW(a) \
+ _GL_INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
+
+/* Return the low-order bits of A <op> B, where the operation is given
+ by OP. Use the unsigned type UT for calculation to avoid undefined
+ behavior on signed integer overflow, and convert the result to type T.
+ UT is at least as wide as T and is no narrower than unsigned int,
+ T is two's complement, and there is no padding or trap representations.
+ Assume that converting UT to T yields the low-order bits, as is
+ done in all known two's-complement C compilers. E.g., see:
+ https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+ According to the C standard, converting UT to T yields an
+ implementation-defined result or signal for values outside T's
+ range. However, code that works around this theoretical problem
+ runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
+ https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
+ As the compiler bug is real, don't try to work around the
+ theoretical problem. */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+ ((t) ((ut) (a) op (ut) (b)))
+
+/* Return true if the numeric values A + B, A - B, A * B fall outside
+ the range TMIN..TMAX. Arguments should not have side effects
+ and can be any integer type other than char, bool,
+ a bit-precise integer type, or an enumeration type.
+ TMIN should be signed and nonpositive.
+ TMAX should be positive, and should be signed unless TMIN is zero. */
+#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? (((tmin) \
+ ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
+ && (a) < (tmin) - (b)) \
+ : (a) <= -1 - (b)) \
+ || ((_GL_EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
+ : (a) < 0 \
+ ? (((tmin) \
+ ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
+ && (b) < (tmin) - (a)) \
+ : (b) <= -1 - (a)) \
+ || ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
+ && (tmax) < (a) + (b))) \
+ : (tmax) < (b) || (tmax) - (b) < (a))
+#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ (((a) < 0) == ((b) < 0) \
+ ? ((a) < (b) \
+ ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
+ : (tmax) < (a) - (b)) \
+ : (a) < 0 \
+ ? ((!_GL_EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
+ || (a) - (tmin) < (b)) \
+ : ((! (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ && _GL_EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
+ && (tmax) <= -1 - (b)) \
+ || (tmax) + (b) < (a)))
+#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ ? (a) < (tmax) / (b) \
+ : ((_GL_INT_NEGATE_OVERFLOW (b) \
+ ? _GL_INT_CONVERT (b, tmax) >> (_GL_TYPE_WIDTH (+ (b)) - 1) \
+ : (tmax) / -(b)) \
+ <= -1 - (a))) \
+ : _GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
+ ? (_GL_EXPR_SIGNED (a) \
+ ? 0 < (a) + (tmin) \
+ : 0 < (a) && -1 - (tmin) < (a) - 1) \
+ : (tmin) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (_GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
+ ? (_GL_EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
+ : (tmin) / (a) < (b)) \
+ : (tmax) / (b) < (a)))
+
+#endif /* _GL_INTPROPS_INTERNAL_H */
diff --git a/gl/lib/intprops.h b/gl/lib/intprops.h
index d4a917f7..44b5e60f 100644
--- a/gl/lib/intprops.h
+++ b/gl/lib/intprops.h
@@ -1,6 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 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
@@ -15,19 +15,10 @@
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 _GL_INTPROPS_H
#define _GL_INTPROPS_H
-#include <limits.h>
-
-/* Return a value with the common real type of E and V and the value of V.
- Do not evaluate E. */
-#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
-
-/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
- <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
-#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
+#include "intprops-internal.h"
/* The extra casts in the following macros work around compiler bugs,
e.g., in Cray C 5.0.3.0. */
@@ -37,11 +28,11 @@
#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
/* True if the real type T is signed. */
-#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+#define TYPE_SIGNED(t) _GL_TYPE_SIGNED (t)
/* Return 1 if the real expression E, after promotion, has a
signed or floating type. Do not evaluate E. */
-#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+#define EXPR_SIGNED(e) _GL_EXPR_SIGNED (e)
/* Minimum and maximum values for integer types and expressions. */
@@ -49,7 +40,7 @@
/* The width in bits of the integer type or expression T.
Do not evaluate T. T must not be a bit-field expression.
Padding bits are not supported; this is checked at compile-time below. */
-#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+#define TYPE_WIDTH(t) _GL_TYPE_WIDTH (t)
/* The maximum and minimum values for the integer type T. */
#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
@@ -58,51 +49,6 @@
? (t) -1 \
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
-/* The maximum and minimum values for the type of the expression E,
- after integer promotion. E is not evaluated. */
-#define _GL_INT_MINIMUM(e) \
- (EXPR_SIGNED (e) \
- ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
- : _GL_INT_CONVERT (e, 0))
-#define _GL_INT_MAXIMUM(e) \
- (EXPR_SIGNED (e) \
- ? _GL_SIGNED_INT_MAXIMUM (e) \
- : _GL_INT_NEGATE_CONVERT (e, 1))
-#define _GL_SIGNED_INT_MAXIMUM(e) \
- (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
-
-/* Work around OpenVMS incompatibility with C99. */
-#if !defined LLONG_MAX && defined __INT64_MAX
-# define LLONG_MAX __INT64_MAX
-# define LLONG_MIN __INT64_MIN
-#endif
-
-/* This include file assumes that signed types are two's complement without
- padding bits; the above macros have undefined behavior otherwise.
- If this is a problem for you, please let us know how to fix it for your host.
- This assumption is tested by the intprops-tests module. */
-
-/* Does the __typeof__ keyword work? This could be done by
- 'configure', but for now it's easier to do it by hand. */
-#if (2 <= __GNUC__ \
- || (4 <= __clang_major__) \
- || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
- || (0x5110 <= __SUNPRO_C && !__STDC__))
-# define _GL_HAVE___TYPEOF__ 1
-#else
-# define _GL_HAVE___TYPEOF__ 0
-#endif
-
-/* Return 1 if the integer type or expression T might be signed. Return 0
- if it is definitely unsigned. T must not be a bit-field expression.
- This macro does not evaluate its argument, and expands to an
- integer constant expression. */
-#if _GL_HAVE___TYPEOF__
-# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
-#else
-# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
-#endif
-
/* Bound on length of the string representing an unsigned integer
value representable in B bits. log10 (2.0) < 146/485. The
smallest value of B where this bound is not tight is 2621. */
@@ -129,12 +75,11 @@
/* Range overflow checks.
The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
- operators might not yield numerically correct answers due to
- arithmetic overflow. They do not rely on undefined or
- implementation-defined behavior. Their implementations are simple
- and straightforward, but they are harder to use and may be less
- efficient than the INT_<op>_WRAPV, INT_<op>_OK, and
- INT_<op>_OVERFLOW macros described below.
+ operators overflow arithmetically when given the same arguments.
+ These macros do not rely on undefined or implementation-defined behavior.
+ Although their implementations are simple and straightforward,
+ they are harder to use and may be less efficient than the
+ INT_<op>_WRAPV, INT_<op>_OK, and INT_<op>_OVERFLOW macros described below.
Example usage:
@@ -181,9 +126,7 @@
/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
See above for restrictions. */
#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
- ((min) < 0 \
- ? (a) < - (max) \
- : 0 < (a))
+ _GL_INT_NEGATE_RANGE_OVERFLOW (a, min, max)
/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
See above for restrictions. Avoid && and || as they tickle
@@ -227,43 +170,6 @@
? (a) < (min) >> (b) \
: (max) >> (b) < (a))
-/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
- (A, B, P) work when P is non-null. */
-#ifdef __EDG__
-/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
- <https://bugs.gnu.org/53256>. */
-# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
-#elif defined __has_builtin
-# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
-/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
- see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
-#elif 7 <= __GNUC__
-# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#else
-# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
-#endif
-
-/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
-#if defined __clang_major__ && __clang_major__ < 14
-/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
-# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
-#else
-# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
-#endif
-
-/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
- __builtin_sub_overflow_p and __builtin_mul_overflow_p. */
-#ifdef __EDG__
-/* In EDG-based compilers like ICC 2021.3 and earlier,
- __builtin_add_overflow_p etc. are not treated as integral constant
- expressions even when all arguments are. */
-# define _GL_HAS_BUILTIN_OVERFLOW_P 0
-#elif defined __has_builtin
-# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
-#else
-# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
-#endif
-
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
(e.g., A and B) have the same type as MIN and MAX. Instead, they assume
@@ -350,13 +256,18 @@
Because the WRAPV macros convert the result, they report overflow
in different circumstances than the OVERFLOW macros do. For
example, in the typical case with 16-bit 'short' and 32-bit 'int',
- if A, B and R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
+ if A, B and *R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
returns false because the addition cannot overflow after A and B
- are converted to 'int', whereas INT_ADD_WRAPV (A, B, &R) returns
+ are converted to 'int', whereas INT_ADD_WRAPV (A, B, R) returns
true or false depending on whether the sum fits into 'short'.
These macros are tuned for their last input argument being a constant.
+ A, B, and *R should be integers; they need not be the same type,
+ and they need not be all signed or all unsigned.
+ However, none of the integer types should be bit-precise,
+ and *R's type should not be char, bool, or an enumeration type.
+
Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
A % B, and A << B would overflow, respectively. */
@@ -364,12 +275,7 @@
_GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
#define INT_SUBTRACT_OVERFLOW(a, b) \
_GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#if _GL_HAS_BUILTIN_OVERFLOW_P
-# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
-#else
-# define INT_NEGATE_OVERFLOW(a) \
- INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
-#endif
+#define INT_NEGATE_OVERFLOW(a) _GL_INT_NEGATE_OVERFLOW (a)
#define INT_MULTIPLY_OVERFLOW(a, b) \
_GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
#define INT_DIVIDE_OVERFLOW(a, b) \
@@ -391,224 +297,9 @@
/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
Return 1 if the result overflows. See above for restrictions. */
-#if _GL_HAS_BUILTIN_ADD_OVERFLOW
-# define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
-# define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
-#else
-# define INT_ADD_WRAPV(a, b, r) \
- _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
-# define INT_SUBTRACT_WRAPV(a, b, r) \
- _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
-#endif
-#if _GL_HAS_BUILTIN_MUL_OVERFLOW
-# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
- || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
- && !defined __EDG__)
-# define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
-# else
- /* Work around GCC bug 91450. */
-# define INT_MULTIPLY_WRAPV(a, b, r) \
- ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
- && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
- ? ((void) __builtin_mul_overflow (a, b, r), 1) \
- : __builtin_mul_overflow (a, b, r))
-# endif
-#else
-# define INT_MULTIPLY_WRAPV(a, b, r) \
- _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
-#endif
-
-/* 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
- warnings for _Generic. This matters only for compilers that
- lack relevant builtins. */
-#if __GNUC__ || defined __clang__
-# define _GL__GENERIC_BOGUS 1
-#else
-# define _GL__GENERIC_BOGUS 0
-#endif
-
-/* Store the low-order bits of A <op> B into *R, where OP specifies
- the operation and OVERFLOW the overflow predicate. Return 1 if the
- result overflows. See above for restrictions. */
-#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
-# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
- (_Generic \
- (*(r), \
- signed char: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- signed char, SCHAR_MIN, SCHAR_MAX), \
- unsigned char: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- unsigned char, 0, UCHAR_MAX), \
- short int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- short int, SHRT_MIN, SHRT_MAX), \
- unsigned short int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- unsigned short int, 0, USHRT_MAX), \
- int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- int, INT_MIN, INT_MAX), \
- unsigned int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- unsigned int, 0, UINT_MAX), \
- long int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- long int, LONG_MIN, LONG_MAX), \
- unsigned long int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- unsigned long int, 0, ULONG_MAX), \
- long long int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
- long long int, LLONG_MIN, LLONG_MAX), \
- unsigned long long int: \
- _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
- unsigned long long int, 0, ULLONG_MAX)))
-#else
-/* Store the low-order bits of A <op> B into *R, where OP specifies
- the operation and OVERFLOW the overflow predicate. If *R is
- signed, its type is ST with bounds SMIN..SMAX; otherwise its type
- is UT with bounds U..UMAX. ST and UT are narrower than int.
- Return 1 if the result overflows. See above for restrictions. */
-# if _GL_HAVE___TYPEOF__
-# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
- (TYPE_SIGNED (__typeof__ (*(r))) \
- ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
- : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
-# else
-# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
- (overflow (a, b, smin, smax) \
- ? (overflow (a, b, 0, umax) \
- ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
- : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
- : (overflow (a, b, 0, umax) \
- ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
- : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
-# endif
-
-# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
- (sizeof *(r) == sizeof (signed char) \
- ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
- signed char, SCHAR_MIN, SCHAR_MAX, \
- unsigned char, UCHAR_MAX) \
- : sizeof *(r) == sizeof (short int) \
- ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
- short int, SHRT_MIN, SHRT_MAX, \
- unsigned short int, USHRT_MAX) \
- : sizeof *(r) == sizeof (int) \
- ? (EXPR_SIGNED (*(r)) \
- ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- int, INT_MIN, INT_MAX) \
- : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
- unsigned int, 0, UINT_MAX)) \
- : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
-# ifdef LLONG_MAX
-# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
- (sizeof *(r) == sizeof (long int) \
- ? (EXPR_SIGNED (*(r)) \
- ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- long int, LONG_MIN, LONG_MAX) \
- : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- unsigned long int, 0, ULONG_MAX)) \
- : (EXPR_SIGNED (*(r)) \
- ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
- long long int, LLONG_MIN, LLONG_MAX) \
- : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
- unsigned long long int, 0, ULLONG_MAX)))
-# else
-# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
- (EXPR_SIGNED (*(r)) \
- ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- long int, LONG_MIN, LONG_MAX) \
- : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
- unsigned long int, 0, ULONG_MAX))
-# endif
-#endif
-
-/* Store the low-order bits of A <op> B into *R, where the operation
- is given by OP. Use the unsigned type UT for calculation to avoid
- overflow problems. *R's type is T, with extrema TMIN and TMAX.
- T must be a signed integer type. Return 1 if the result overflows. */
-#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
- (overflow (a, b, tmin, tmax) \
- ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
- : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
-
-/* Return the low-order bits of A <op> B, where the operation is given
- by OP. Use the unsigned type UT for calculation to avoid undefined
- behavior on signed integer overflow, and convert the result to type T.
- UT is at least as wide as T and is no narrower than unsigned int,
- T is two's complement, and there is no padding or trap representations.
- Assume that converting UT to T yields the low-order bits, as is
- done in all known two's-complement C compilers. E.g., see:
- https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
-
- According to the C standard, converting UT to T yields an
- implementation-defined result or signal for values outside T's
- range. However, code that works around this theoretical problem
- runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
- https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
- As the compiler bug is real, don't try to work around the
- theoretical problem. */
-
-#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
- ((t) ((ut) (a) op (ut) (b)))
-
-/* Return true if the numeric values A + B, A - B, A * B fall outside
- the range TMIN..TMAX. Arguments should be integer expressions
- without side effects. TMIN should be signed and nonpositive.
- TMAX should be positive, and should be signed unless TMIN is zero. */
-#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
- ((b) < 0 \
- ? (((tmin) \
- ? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
- && (a) < (tmin) - (b)) \
- : (a) <= -1 - (b)) \
- || ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
- : (a) < 0 \
- ? (((tmin) \
- ? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
- && (b) < (tmin) - (a)) \
- : (b) <= -1 - (a)) \
- || ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
- && (tmax) < (a) + (b))) \
- : (tmax) < (b) || (tmax) - (b) < (a))
-#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
- (((a) < 0) == ((b) < 0) \
- ? ((a) < (b) \
- ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
- : (tmax) < (a) - (b)) \
- : (a) < 0 \
- ? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
- || (a) - (tmin) < (b)) \
- : ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
- && EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
- && (tmax) <= -1 - (b)) \
- || (tmax) + (b) < (a)))
-#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
- ((b) < 0 \
- ? ((a) < 0 \
- ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
- ? (a) < (tmax) / (b) \
- : ((INT_NEGATE_OVERFLOW (b) \
- ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \
- : (tmax) / -(b)) \
- <= -1 - (a))) \
- : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
- ? (EXPR_SIGNED (a) \
- ? 0 < (a) + (tmin) \
- : 0 < (a) && -1 - (tmin) < (a) - 1) \
- : (tmin) / (b) < (a)) \
- : (b) == 0 \
- ? 0 \
- : ((a) < 0 \
- ? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
- ? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
- : (tmin) / (a) < (b)) \
- : (tmax) / (b) < (a)))
+#define INT_ADD_WRAPV(a, b, r) _GL_INT_ADD_WRAPV (a, b, r)
+#define INT_SUBTRACT_WRAPV(a, b, r) _GL_INT_SUBTRACT_WRAPV (a, b, r)
+#define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
/* The following macros compute A + B, A - B, and A * B, respectively.
If no overflow occurs, they set *R to the result and return 1;
@@ -624,6 +315,8 @@
A, B, and *R should be integers; they need not be the same type,
and they need not be all signed or all unsigned.
+ However, none of the integer types should be bit-precise,
+ and *R's type should not be char, bool, or an enumeration type.
These macros work correctly on all known practical hosts, and do not rely
on undefined behavior due to signed arithmetic overflow.
@@ -635,8 +328,8 @@
These macros are tuned for B being a constant. */
-#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
-#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
-#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
+#define INT_ADD_OK(a, b, r) (! INT_ADD_WRAPV (a, b, r))
+#define INT_SUBTRACT_OK(a, b, r) (! INT_SUBTRACT_WRAPV (a, b, r))
+#define INT_MULTIPLY_OK(a, b, r) (! INT_MULTIPLY_WRAPV (a, b, r))
#endif /* _GL_INTPROPS_H */
diff --git a/gl/lib/inttypes.in.h b/gl/lib/inttypes.in.h
index 853eca08..22643876 100644
--- a/gl/lib/inttypes.in.h
+++ b/gl/lib/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
@@ -46,6 +46,11 @@
#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
#define INTTYPES_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Include <stdint.h> or the gnulib replacement.
But avoid namespace pollution on glibc systems. */
#ifndef __GLIBC__
@@ -903,8 +908,21 @@ extern "C" {
#endif
#if @GNULIB_IMAXABS@
-# if !@HAVE_DECL_IMAXABS@
-extern intmax_t imaxabs (intmax_t);
+# if @REPLACE_IMAXABS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef imaxabs
+# define imaxabs rpl_imaxabs
+# endif
+_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x));
+_GL_CXXALIAS_RPL (imaxabs, intmax_t, (intmax_t x));
+# else
+# if !@HAVE_DECL_IMAXABS@
+_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x));
+# endif
+_GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (imaxabs);
# endif
#elif defined GNULIB_POSIXCHECK
# undef imaxabs
@@ -921,8 +939,21 @@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# define GNULIB_defined_imaxdiv_t 1
# endif
# endif
-# if !@HAVE_DECL_IMAXDIV@
-extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# if @REPLACE_IMAXDIV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef imaxdiv
+# define imaxdiv rpl_imaxdiv
+# endif
+_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+_GL_CXXALIAS_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+# else
+# if !@HAVE_DECL_IMAXDIV@
+_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+# endif
+_GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (imaxdiv);
# endif
#elif defined GNULIB_POSIXCHECK
# undef imaxdiv
diff --git a/gl/lib/ioctl.c b/gl/lib/ioctl.c
index b1c7b2ee..65cce137 100644
--- a/gl/lib/ioctl.c
+++ b/gl/lib/ioctl.c
@@ -1,6 +1,6 @@
/* ioctl.c --- wrappers for Windows ioctl function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/isblank.c b/gl/lib/isblank.c
index e3545593..8aad6aff 100644
--- a/gl/lib/isblank.c
+++ b/gl/lib/isblank.c
@@ -1,6 +1,6 @@
/* Test whether a character is a blank.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/itold.c b/gl/lib/itold.c
index fe4a3842..0ef4464e 100644
--- a/gl/lib/itold.c
+++ b/gl/lib/itold.c
@@ -1,5 +1,5 @@
/* Replacement for 'int' to 'long double' conversion routine.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/langinfo.in.h b/gl/lib/langinfo.in.h
index 98aea6a8..4cf712eb 100644
--- a/gl/lib/langinfo.in.h
+++ b/gl/lib/langinfo.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <langinfo.h>.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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,6 +34,11 @@
#ifndef _@GUARD_PREFIX@_LANGINFO_H
#define _@GUARD_PREFIX@_LANGINFO_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if !@HAVE_LANGINFO_H@
@@ -208,7 +213,9 @@ _GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
# endif
_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (nl_langinfo);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef nl_langinfo
# if HAVE_RAW_DECL_NL_LANGINFO
diff --git a/gl/lib/lc-charset-dispatch.c b/gl/lib/lc-charset-dispatch.c
index 66d78fd3..cd74466b 100644
--- a/gl/lib/lc-charset-dispatch.c
+++ b/gl/lib/lc-charset-dispatch.c
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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/gl/lib/lc-charset-dispatch.h b/gl/lib/lc-charset-dispatch.h
index 3867c323..c82b6a60 100644
--- a/gl/lib/lc-charset-dispatch.h
+++ b/gl/lib/lc-charset-dispatch.h
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 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/gl/lib/lchown.c b/gl/lib/lchown.c
index 8b0d871a..19a68c05 100644
--- a/gl/lib/lchown.c
+++ b/gl/lib/lchown.c
@@ -1,6 +1,6 @@
/* Provide a stub lchown function for systems that lack it.
- Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2022 Free Software
+ Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <errno.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
diff --git a/gl/lib/libc-config.h b/gl/lib/libc-config.h
index a56665b1..5f5ad010 100644
--- a/gl/lib/libc-config.h
+++ b/gl/lib/libc-config.h
@@ -1,6 +1,6 @@
/* System definitions for code taken from the GNU C Library
- Copyright 2017-2022 Free Software Foundation, Inc.
+ Copyright 2017-2023 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
@@ -137,8 +137,6 @@
# undef __attribute_returns_twice__
# undef __attribute_used__
# undef __attribute_warn_unused_result__
-# undef __bos
-# undef __bos0
# undef __errordecl
# undef __extension__
# undef __extern_always_inline
@@ -147,21 +145,13 @@
# undef __fortified_attr_access
# undef __fortify_function
# undef __glibc_c99_flexarr_available
-# undef __glibc_fortify
-# undef __glibc_fortify_n
# undef __glibc_has_attribute
# undef __glibc_has_builtin
# undef __glibc_has_extension
# undef __glibc_likely
# undef __glibc_macro_warning
# undef __glibc_macro_warning1
-# undef __glibc_objsize
-# undef __glibc_objsize0
-# undef __glibc_safe_len_cond
-# undef __glibc_safe_or_unknown_len
# undef __glibc_unlikely
-# undef __glibc_unsafe_len
-# undef __glibc_unsigned_or_positive
# undef __inline
# undef __ptr_t
# undef __restrict
@@ -170,6 +160,18 @@
# undef __va_arg_pack_len
# undef __warnattr
# undef __wur
+# ifndef __GNULIB_CDEFS
+# undef __bos
+# undef __bos0
+# undef __glibc_fortify
+# undef __glibc_fortify_n
+# undef __glibc_objsize
+# undef __glibc_objsize0
+# undef __glibc_safe_len_cond
+# undef __glibc_safe_or_unknown_len
+# undef __glibc_unsafe_len
+# undef __glibc_unsigned_or_positive
+# endif
/* Include our copy of glibc <sys/cdefs.h>. */
# include <cdefs.h>
diff --git a/gl/lib/limits.in.h b/gl/lib/limits.in.h
index b77bf75c..e2e173eb 100644
--- a/gl/lib/limits.in.h
+++ b/gl/lib/limits.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <limits.h>.
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 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
@@ -99,7 +99,12 @@
# endif
#endif
-/* Macros specified by C2x and by ISO/IEC TS 18661-1:2014. */
+/* Assume no multibyte character is longer than 16 bytes. */
+#ifndef MB_LEN_MAX
+# define MB_LEN_MAX 16
+#endif
+
+/* Macros specified by C23 and by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \
@@ -117,13 +122,28 @@
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
#endif
-/* Macros specified by C2x. */
+/* Macros specified by C23. */
-#if (! defined BOOL_WIDTH \
- && (defined _GNU_SOURCE \
- || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
-# define BOOL_MAX 1
-# define BOOL_WIDTH 1
+#if (defined _GNU_SOURCE \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__))
+# if ! defined BOOL_WIDTH
+# define BOOL_WIDTH 1
+# define BOOL_MAX 1
+# elif ! defined BOOL_MAX
+# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1)
+# endif
+#endif
+
+/* Macro specified by POSIX. */
+
+/* The maximum ssize_t value. Although it might not be of ssize_t type
+ as it should be, it's too much trouble to fix this minor detail. */
+#ifndef SSIZE_MAX
+# ifdef _WIN64
+# define SSIZE_MAX LLONG_MAX
+# else
+# define SSIZE_MAX LONG_MAX
+# endif
#endif
#endif /* _@GUARD_PREFIX@_LIMITS_H */
diff --git a/gl/lib/localcharset.c b/gl/lib/localcharset.c
index 17a4a1ef..7ed9c957 100644
--- a/gl/lib/localcharset.c
+++ b/gl/lib/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2023 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/gl/lib/localcharset.h b/gl/lib/localcharset.h
index 62efbf32..29ee8dc0 100644
--- a/gl/lib/localcharset.h
+++ b/gl/lib/localcharset.h
@@ -1,5 +1,5 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2009-2023 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/gl/lib/locale.in.h b/gl/lib/locale.in.h
index 4aef74d4..41a93c1d 100644
--- a/gl/lib/locale.in.h
+++ b/gl/lib/locale.in.h
@@ -1,5 +1,5 @@
/* A POSIX <locale.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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,11 @@
#ifndef _@GUARD_PREFIX@_LOCALE_H
#define _@GUARD_PREFIX@_LOCALE_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
@@ -229,7 +234,7 @@ _GL_CXXALIAS_SYS (newlocale, locale_t,
(int category_mask, const char *name, locale_t base));
# endif
# endif
-# if @HAVE_NEWLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_NEWLOCALE@
_GL_CXXALIASWARN (newlocale);
# endif
# if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
@@ -245,23 +250,23 @@ _GL_WARN_ON_USE (newlocale, "newlocale is not portable");
#endif
#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
-# if @REPLACE_DUPLOCALE@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef duplocale
-# define duplocale rpl_duplocale
-# define GNULIB_defined_duplocale 1
-# endif
+# if @HAVE_DUPLOCALE@ /* locale_t may be undefined if !@HAVE_DUPLOCALE@. */
+# if @REPLACE_DUPLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef duplocale
+# define duplocale rpl_duplocale
+# define GNULIB_defined_duplocale 1
+# endif
_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
-# else
-# if @HAVE_DUPLOCALE@
+# else
_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
# endif
# endif
-# if @HAVE_DUPLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_DUPLOCALE@
_GL_CXXALIASWARN (duplocale);
# endif
-# if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
+# if @HAVE_DUPLOCALE@
# ifndef HAVE_WORKING_DUPLOCALE
# define HAVE_WORKING_DUPLOCALE 1
# endif
@@ -290,7 +295,7 @@ _GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
# endif
# endif
-# if @HAVE_FREELOCALE@
+# if __GLIBC__ >= 2 && @HAVE_FREELOCALE@
_GL_CXXALIASWARN (freelocale);
# endif
#elif defined GNULIB_POSIXCHECK
diff --git a/gl/lib/localeconv.c b/gl/lib/localeconv.c
index ef261205..c1a34baa 100644
--- a/gl/lib/localeconv.c
+++ b/gl/lib/localeconv.c
@@ -1,5 +1,5 @@
/* Query locale dependent information for formatting numbers.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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,10 +19,14 @@
/* Specification. */
#include <locale.h>
+#include <limits.h>
+
#if HAVE_STRUCT_LCONV_DECIMAL_POINT
+# define FIX_CHAR_VALUE(x) ((x) >= 0 ? (x) : CHAR_MAX)
+
/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
- members. */
+ members or where fields of type 'char' are set to -1 instead of CHAR_MAX. */
struct lconv *
localeconv (void)
@@ -41,21 +45,30 @@ localeconv (void)
result.positive_sign = sys_result->positive_sign;
result.negative_sign = sys_result->negative_sign;
result.currency_symbol = sys_result->currency_symbol;
- result.frac_digits = sys_result->frac_digits;
- result.p_cs_precedes = sys_result->p_cs_precedes;
- result.p_sign_posn = sys_result->p_sign_posn;
- result.p_sep_by_space = sys_result->p_sep_by_space;
- result.n_cs_precedes = sys_result->n_cs_precedes;
- result.n_sign_posn = sys_result->n_sign_posn;
- result.n_sep_by_space = sys_result->n_sep_by_space;
+ result.frac_digits = FIX_CHAR_VALUE (sys_result->frac_digits);
+ result.p_cs_precedes = FIX_CHAR_VALUE (sys_result->p_cs_precedes);
+ result.p_sign_posn = FIX_CHAR_VALUE (sys_result->p_sign_posn);
+ result.p_sep_by_space = FIX_CHAR_VALUE (sys_result->p_sep_by_space);
+ result.n_cs_precedes = FIX_CHAR_VALUE (sys_result->n_cs_precedes);
+ result.n_sign_posn = FIX_CHAR_VALUE (sys_result->n_sign_posn);
+ result.n_sep_by_space = FIX_CHAR_VALUE (sys_result->n_sep_by_space);
result.int_curr_symbol = sys_result->int_curr_symbol;
- result.int_frac_digits = sys_result->int_frac_digits;
- result.int_p_cs_precedes = sys_result->p_cs_precedes;
- result.int_p_sign_posn = sys_result->p_sign_posn;
- result.int_p_sep_by_space = sys_result->p_sep_by_space;
- result.int_n_cs_precedes = sys_result->n_cs_precedes;
- result.int_n_sign_posn = sys_result->n_sign_posn;
- result.int_n_sep_by_space = sys_result->n_sep_by_space;
+ result.int_frac_digits = FIX_CHAR_VALUE (sys_result->int_frac_digits);
+# if HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES
+ result.int_p_cs_precedes = FIX_CHAR_VALUE (sys_result->int_p_cs_precedes);
+ result.int_p_sign_posn = FIX_CHAR_VALUE (sys_result->int_p_sign_posn);
+ result.int_p_sep_by_space = FIX_CHAR_VALUE (sys_result->int_p_sep_by_space);
+ result.int_n_cs_precedes = FIX_CHAR_VALUE (sys_result->int_n_cs_precedes);
+ result.int_n_sign_posn = FIX_CHAR_VALUE (sys_result->int_n_sign_posn);
+ result.int_n_sep_by_space = FIX_CHAR_VALUE (sys_result->int_n_sep_by_space);
+# else
+ result.int_p_cs_precedes = FIX_CHAR_VALUE (sys_result->p_cs_precedes);
+ result.int_p_sign_posn = FIX_CHAR_VALUE (sys_result->p_sign_posn);
+ result.int_p_sep_by_space = FIX_CHAR_VALUE (sys_result->p_sep_by_space);
+ result.int_n_cs_precedes = FIX_CHAR_VALUE (sys_result->n_cs_precedes);
+ result.int_n_sign_posn = FIX_CHAR_VALUE (sys_result->n_sign_posn);
+ result.int_n_sep_by_space = FIX_CHAR_VALUE (sys_result->n_sep_by_space);
+# endif
return &result;
}
@@ -64,8 +77,6 @@ localeconv (void)
/* Override for platforms where 'struct lconv' is a dummy. */
-# include <limits.h>
-
struct lconv *
localeconv (void)
{
diff --git a/gl/lib/lstat.c b/gl/lib/lstat.c
index 472bfbce..00a4ce2a 100644
--- a/gl/lib/lstat.c
+++ b/gl/lib/lstat.c
@@ -1,6 +1,6 @@
/* Work around a bug of lstat on some systems
- Copyright (C) 1997-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2006, 2008-2023 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/gl/lib/malloc.c b/gl/lib/malloc.c
index f334dd6e..3ade35cb 100644
--- a/gl/lib/malloc.c
+++ b/gl/lib/malloc.c
@@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible.
- Copyright (C) 1997-1998, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2006-2007, 2009-2023 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/gl/lib/malloc/dynarray-skeleton.c b/gl/lib/malloc/dynarray-skeleton.c
index bad548a4..580c278b 100644
--- a/gl/lib/malloc/dynarray-skeleton.c
+++ b/gl/lib/malloc/dynarray-skeleton.c
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/malloc/dynarray.h b/gl/lib/malloc/dynarray.h
index f16fd950..a9a3b085 100644
--- a/gl/lib/malloc/dynarray.h
+++ b/gl/lib/malloc/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically. Shared definitions.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -94,7 +94,6 @@
#ifndef _DYNARRAY_H
#define _DYNARRAY_H
-#include <stdbool.h>
#include <stddef.h>
#include <string.h>
diff --git a/gl/lib/malloc/dynarray_at_failure.c b/gl/lib/malloc/dynarray_at_failure.c
index 062ab706..ebc93109 100644
--- a/gl/lib/malloc/dynarray_at_failure.c
+++ b/gl/lib/malloc/dynarray_at_failure.c
@@ -1,5 +1,5 @@
/* Report an dynamic array index out of bounds condition.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/malloc/dynarray_emplace_enlarge.c b/gl/lib/malloc/dynarray_emplace_enlarge.c
index 0cff2e70..65aabb1e 100644
--- a/gl/lib/malloc/dynarray_emplace_enlarge.c
+++ b/gl/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-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -22,7 +22,7 @@
#include <dynarray.h>
#include <errno.h>
-#include <intprops.h>
+#include <stdckdint.h>
#include <stdlib.h>
#include <string.h>
@@ -56,7 +56,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
}
size_t new_size;
- if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
+ if (ckd_mul (&new_size, new_allocated, element_size))
return false;
void *new_array;
if (list->array == scratch)
diff --git a/gl/lib/malloc/dynarray_finalize.c b/gl/lib/malloc/dynarray_finalize.c
index 3f360c3a..673595a5 100644
--- a/gl/lib/malloc/dynarray_finalize.c
+++ b/gl/lib/malloc/dynarray_finalize.c
@@ -1,5 +1,5 @@
/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/malloc/dynarray_resize.c b/gl/lib/malloc/dynarray_resize.c
index 8d1922e5..014f98c3 100644
--- a/gl/lib/malloc/dynarray_resize.c
+++ b/gl/lib/malloc/dynarray_resize.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -22,7 +22,7 @@
#include <dynarray.h>
#include <errno.h>
-#include <intprops.h>
+#include <stdckdint.h>
#include <stdlib.h>
#include <string.h>
@@ -42,7 +42,7 @@ __libc_dynarray_resize (struct dynarray_header *list, size_t size,
over-allocation here. */
size_t new_size_bytes;
- if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
+ if (ckd_mul (&new_size_bytes, size, element_size))
{
/* Overflow. */
__set_errno (ENOMEM);
diff --git a/gl/lib/malloc/dynarray_resize_clear.c b/gl/lib/malloc/dynarray_resize_clear.c
index 8cf1b0d0..bb23c522 100644
--- a/gl/lib/malloc/dynarray_resize_clear.c
+++ b/gl/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-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/malloc/scratch_buffer.h b/gl/lib/malloc/scratch_buffer.h
index e4c5c8a8..33fd2b29 100644
--- a/gl/lib/malloc/scratch_buffer.h
+++ b/gl/lib/malloc/scratch_buffer.h
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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
@@ -132,20 +132,4 @@ scratch_buffer_set_array_size (struct scratch_buffer *buffer,
(buffer, nelem, size));
}
-/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
- deallocating *BUFFER if it was heap-allocated. SIZE must be at
- most *BUFFER's size. Return NULL (setting errno) on memory
- exhaustion. */
-void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
- size_t size);
-libc_hidden_proto (__libc_scratch_buffer_dupfree)
-
-/* Alias for __libc_scratch_dupfree. */
-static __always_inline void *
-scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
-{
- void *r = __libc_scratch_buffer_dupfree (buffer, size);
- return __glibc_likely (r != NULL) ? r : NULL;
-}
-
#endif /* _SCRATCH_BUFFER_H */
diff --git a/gl/lib/malloc/scratch_buffer_dupfree.c b/gl/lib/malloc/scratch_buffer_dupfree.c
deleted file mode 100644
index eb3b95c1..00000000
--- a/gl/lib/malloc/scratch_buffer_dupfree.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2020-2022 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
- 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 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 the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _LIBC
-# include <libc-config.h>
-#endif
-
-#include <scratch_buffer.h>
-#include <string.h>
-
-void *
-__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
-{
- void *data = buffer->data;
- if (data == buffer->__space.__c)
- {
- void *copy = malloc (size);
- return copy != NULL ? memcpy (copy, data, size) : NULL;
- }
- else
- {
- void *copy = realloc (data, size);
- return copy != NULL ? copy : data;
- }
-}
-libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/gl/lib/malloc/scratch_buffer_grow.c b/gl/lib/malloc/scratch_buffer_grow.c
index 9a5e4dbb..a5e8f2f7 100644
--- a/gl/lib/malloc/scratch_buffer_grow.c
+++ b/gl/lib/malloc/scratch_buffer_grow.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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/gl/lib/malloc/scratch_buffer_grow_preserve.c b/gl/lib/malloc/scratch_buffer_grow_preserve.c
index 3fe5a072..c0b5d87b 100644
--- a/gl/lib/malloc/scratch_buffer_grow_preserve.c
+++ b/gl/lib/malloc/scratch_buffer_grow_preserve.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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/gl/lib/malloc/scratch_buffer_set_array_size.c b/gl/lib/malloc/scratch_buffer_set_array_size.c
index 89c37a95..24c39350 100644
--- a/gl/lib/malloc/scratch_buffer_set_array_size.c
+++ b/gl/lib/malloc/scratch_buffer_set_array_size.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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/gl/lib/malloca.c b/gl/lib/malloca.c
index e7beaaf0..f055b1e5 100644
--- a/gl/lib/malloca.c
+++ b/gl/lib/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2023 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
@@ -21,9 +21,9 @@
/* Specification. */
#include "malloca.h"
+#include <stdckdint.h>
+
#include "idx.h"
-#include "intprops.h"
-#include "verify.h"
/* The speed critical point in this file is freea() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
@@ -39,7 +39,7 @@
/* Type for holding very small pointer differences. */
typedef unsigned char small_t;
/* Verify that it is wide enough. */
-verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
void *
mmalloca (size_t n)
@@ -50,17 +50,16 @@ mmalloca (size_t n)
uintptr_t alignment2_mask = 2 * sa_alignment_max - 1;
int plus = sizeof (small_t) + alignment2_mask;
idx_t nplus;
- if (!INT_ADD_WRAPV (n, plus, &nplus) && !xalloc_oversized (nplus, 1))
+ if (!ckd_add (&nplus, n, plus) && !xalloc_oversized (nplus, 1))
{
char *mem = (char *) malloc (nplus);
if (mem != NULL)
{
uintptr_t umem = (uintptr_t)mem, umemplus;
- /* The INT_ADD_WRAPV avoids signed integer overflow on
+ /* The ckd_add avoids signed integer overflow on
theoretical platforms where UINTPTR_MAX <= INT_MAX. */
- INT_ADD_WRAPV (umem, sizeof (small_t) + sa_alignment_max - 1,
- &umemplus);
+ ckd_add (&umemplus, umem, sizeof (small_t) + sa_alignment_max - 1);
idx_t offset = ((umemplus & ~alignment2_mask)
+ sa_alignment_max - umem);
void *vp = mem + offset;
diff --git a/gl/lib/malloca.h b/gl/lib/malloca.h
index 7ec235f3..f68ddfe0 100644
--- a/gl/lib/malloca.h
+++ b/gl/lib/malloca.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
@@ -18,6 +18,12 @@
#ifndef _MALLOCA_H
#define _MALLOCA_H
+/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC,
+ _GL_ATTRIBUTE_MALLOC, HAVE_ALLOCA. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <alloca.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/gl/lib/mbrtowc-impl-utf8.h b/gl/lib/mbrtowc-impl-utf8.h
index 8e5ac14e..4fdd65d8 100644
--- a/gl/lib/mbrtowc-impl-utf8.h
+++ b/gl/lib/mbrtowc-impl-utf8.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 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/gl/lib/mbrtowc-impl.h b/gl/lib/mbrtowc-impl.h
index 65538e74..e9c04ed7 100644
--- a/gl/lib/mbrtowc-impl.h
+++ b/gl/lib/mbrtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 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/gl/lib/mbrtowc.c b/gl/lib/mbrtowc.c
index 4b164edd..c1a689a2 100644
--- a/gl/lib/mbrtowc.c
+++ b/gl/lib/mbrtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -51,11 +51,10 @@
# endif
# include "attribute.h"
-# include "verify.h"
# include "lc-charset-dispatch.h"
# include "mbtowc-lock.h"
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
static char internal_state[4];
size_t
diff --git a/gl/lib/mbsinit.c b/gl/lib/mbsinit.c
index 9621defc..6e600798 100644
--- a/gl/lib/mbsinit.c
+++ b/gl/lib/mbsinit.c
@@ -1,5 +1,5 @@
/* Test for initial conversion state.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -20,7 +20,6 @@
/* Specification. */
#include <wchar.h>
-#include "verify.h"
#if GNULIB_defined_mbstate_t
@@ -39,7 +38,7 @@
- In wc -> mb direction, mbstate_t contains no information. In other
words, it is always in the initial state. */
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
int
mbsinit (const mbstate_t *ps)
diff --git a/gl/lib/mbsrtowcs-impl.h b/gl/lib/mbsrtowcs-impl.h
index 55dafe38..bcf729dc 100644
--- a/gl/lib/mbsrtowcs-impl.h
+++ b/gl/lib/mbsrtowcs-impl.h
@@ -1,5 +1,5 @@
/* Convert string to wide string.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/mbsrtowcs-state.c b/gl/lib/mbsrtowcs-state.c
index 55160a20..0949a370 100644
--- a/gl/lib/mbsrtowcs-state.c
+++ b/gl/lib/mbsrtowcs-state.c
@@ -1,5 +1,5 @@
/* Convert string to wide string.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/mbsrtowcs.c b/gl/lib/mbsrtowcs.c
index 66019b04..c20fc416 100644
--- a/gl/lib/mbsrtowcs.c
+++ b/gl/lib/mbsrtowcs.c
@@ -1,5 +1,5 @@
/* Convert string to wide string.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/mbtowc-impl.h b/gl/lib/mbtowc-impl.h
index 2b27bafd..39b977be 100644
--- a/gl/lib/mbtowc-impl.h
+++ b/gl/lib/mbtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/mbtowc-lock.c b/gl/lib/mbtowc-lock.c
index 06d32246..6ca6e10f 100644
--- a/gl/lib/mbtowc-lock.c
+++ b/gl/lib/mbtowc-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/mbtowc-lock.h b/gl/lib/mbtowc-lock.h
index ecfd44e8..2dc22ace 100644
--- a/gl/lib/mbtowc-lock.h
+++ b/gl/lib/mbtowc-lock.h
@@ -1,5 +1,5 @@
/* Use the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/mbtowc.c b/gl/lib/mbtowc.c
index a9a79951..8d9b06d2 100644
--- a/gl/lib/mbtowc.c
+++ b/gl/lib/mbtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/memchr.c b/gl/lib/memchr.c
index 0ca7b30a..8e955793 100644
--- a/gl/lib/memchr.c
+++ b/gl/lib/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2022
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2023
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/gl/lib/memchr.valgrind b/gl/lib/memchr.valgrind
index cb0f351c..97690f2c 100644
--- a/gl/lib/memchr.valgrind
+++ b/gl/lib/memchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in memchr().
-# Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2009-2023 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/gl/lib/memmem.c b/gl/lib/memmem.c
index 5701052d..c0b48c1b 100644
--- a/gl/lib/memmem.c
+++ b/gl/lib/memmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2022 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gl/lib/mempcpy.c b/gl/lib/mempcpy.c
index 9aae418e..24a31359 100644
--- a/gl/lib/mempcpy.c
+++ b/gl/lib/mempcpy.c
@@ -1,5 +1,5 @@
/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007, 2009-2023 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/gl/lib/memrchr.c b/gl/lib/memrchr.c
index 90fdb86f..c5b1fe8b 100644
--- a/gl/lib/memrchr.c
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2023 Free Software
Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/gl/lib/minmax.h b/gl/lib/minmax.h
index b4b1345b..0ac40198 100644
--- a/gl/lib/minmax.h
+++ b/gl/lib/minmax.h
@@ -1,5 +1,5 @@
/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2022 Free Software
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -23,6 +23,11 @@
MIN, MAX macro redefinitions on some systems; the workaround is to
#include this file as the last one among the #include list. */
+/* This file uses HAVE_MINMAX_IN_LIMITS_H, HAVE_MINMAX_IN_SYS_PARAM_H. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Before we define the following symbols we get the <limits.h> file
since otherwise we get redefinitions on some systems if <limits.h> is
included after this file. Likewise for <sys/param.h>.
diff --git a/gl/lib/mkdir.c b/gl/lib/mkdir.c
index 49017018..f94aba17 100644
--- a/gl/lib/mkdir.c
+++ b/gl/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-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006, 2008-2023 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/gl/lib/mkdtemp.c b/gl/lib/mkdtemp.c
index 0577870d..115bb6bf 100644
--- a/gl/lib/mkdtemp.c
+++ b/gl/lib/mkdtemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2022 Free Software
+/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gl/lib/mkstemp.c b/gl/lib/mkstemp.c
index 7e0a214f..77aadbbd 100644
--- a/gl/lib/mkstemp.c
+++ b/gl/lib/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2022 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
This file is derived from the one in the GNU C Library.
diff --git a/gl/lib/msvc-inval.c b/gl/lib/msvc-inval.c
index d6651caa..c5149a8f 100644
--- a/gl/lib/msvc-inval.c
+++ b/gl/lib/msvc-inval.c
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/msvc-inval.h b/gl/lib/msvc-inval.h
index 1230b899..c16d8801 100644
--- a/gl/lib/msvc-inval.h
+++ b/gl/lib/msvc-inval.h
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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,6 +52,11 @@
AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
*/
+/* This file uses HAVE_MSVC_INVALID_PARAMETER_HANDLER. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#define DEFAULT_HANDLING 0
#define HAIRY_LIBRARY_HANDLING 1
#define SANE_LIBRARY_HANDLING 2
diff --git a/gl/lib/msvc-nothrow.c b/gl/lib/msvc-nothrow.c
index aa069643..f729fe66 100644
--- a/gl/lib/msvc-nothrow.c
+++ b/gl/lib/msvc-nothrow.c
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/msvc-nothrow.h b/gl/lib/msvc-nothrow.h
index 53451557..0dd229fd 100644
--- a/gl/lib/msvc-nothrow.h
+++ b/gl/lib/msvc-nothrow.h
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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,11 @@
This file defines wrappers that turn such an invalid parameter notification
into an error code. */
+/* This file uses HAVE_MSVC_INVALID_PARAMETER_HANDLER. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if defined _WIN32 && ! defined __CYGWIN__
/* Get original declaration of _get_osfhandle. */
diff --git a/gl/lib/nanosleep.c b/gl/lib/nanosleep.c
index 446794ed..10974df4 100644
--- a/gl/lib/nanosleep.c
+++ b/gl/lib/nanosleep.c
@@ -1,6 +1,6 @@
/* Provide a replacement for the POSIX nanosleep function.
- Copyright (C) 1999-2000, 2002, 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002, 2004-2023 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,9 +23,7 @@
#include <time.h>
#include "intprops.h"
-#include "verify.h"
-#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/select.h>
@@ -59,11 +57,10 @@ nanosleep (const struct timespec *requested_delay,
{
/* Verify that time_t is large enough. */
- verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
+ static_assert (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
const time_t limit = 24 * 24 * 60 * 60;
time_t seconds = requested_delay->tv_sec;
- struct timespec intermediate;
- intermediate.tv_nsec = requested_delay->tv_nsec;
+ struct timespec intermediate = *requested_delay;
while (limit < seconds)
{
diff --git a/gl/lib/nl_langinfo-lock.c b/gl/lib/nl_langinfo-lock.c
index c36882d5..e5cdcd3e 100644
--- a/gl/lib/nl_langinfo-lock.c
+++ b/gl/lib/nl_langinfo-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by nl_langinfo.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/nl_langinfo.c b/gl/lib/nl_langinfo.c
index 3fa47822..f872c6d5 100644
--- a/gl/lib/nl_langinfo.c
+++ b/gl/lib/nl_langinfo.c
@@ -1,6 +1,6 @@
/* nl_langinfo() replacement: query locale dependent information.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -70,6 +70,8 @@
static char *
ctype_codeset (void)
{
+ /* This function is only used on platforms which don't have uselocale().
+ Therefore we don't need to look at the per-thread locale first, here. */
static char result[2 + 10 + 1];
char buf[2 + 10 + 1];
char locale[SETLOCALE_NULL_MAX];
diff --git a/gl/lib/nonblocking.c b/gl/lib/nonblocking.c
index 9ea31f7d..3a8bb2aa 100644
--- a/gl/lib/nonblocking.c
+++ b/gl/lib/nonblocking.c
@@ -1,5 +1,5 @@
/* Non-blocking I/O for pipe or socket descriptors.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/nonblocking.h b/gl/lib/nonblocking.h
index 8e00fd74..2bb2c27f 100644
--- a/gl/lib/nonblocking.h
+++ b/gl/lib/nonblocking.h
@@ -1,5 +1,5 @@
/* Non-blocking I/O for pipe or socket descriptors.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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
@@ -17,8 +17,6 @@
#ifndef _NONBLOCKING_H
#define _NONBLOCKING_H
-#include <stdbool.h>
-
/* Non-blocking I/O is an I/O mode by which read(), write() calls avoid
blocking the current thread. When non-blocking is enabled:
- A read() call returns -1 with errno set to EAGAIN when no data or EOF
diff --git a/gl/lib/open.c b/gl/lib/open.c
index 170bff10..7ec8fdc3 100644
--- a/gl/lib/open.c
+++ b/gl/lib/open.c
@@ -1,5 +1,5 @@
/* Open a descriptor to a file.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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/gl/lib/openat-die.c b/gl/lib/openat-die.c
index 486d06c2..df3dbc9b 100644
--- a/gl/lib/openat-die.c
+++ b/gl/lib/openat-die.c
@@ -1,6 +1,6 @@
/* Report a save- or restore-cwd failure in our openat replacement and then exit.
- Copyright (C) 2005-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2023 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/gl/lib/openat-priv.h b/gl/lib/openat-priv.h
index 5d608107..1d31c4e8 100644
--- a/gl/lib/openat-priv.h
+++ b/gl/lib/openat-priv.h
@@ -1,6 +1,6 @@
/* Internals for openat-like functions.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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/gl/lib/openat-proc.c b/gl/lib/openat-proc.c
index 3bacf7db..88f70be4 100644
--- a/gl/lib/openat-proc.c
+++ b/gl/lib/openat-proc.c
@@ -1,6 +1,6 @@
/* Create /proc/self/fd-related names for subfiles of open directories.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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,9 +30,12 @@
#include <string.h>
#include <unistd.h>
-#ifdef __KLIBC__
+#ifdef __KLIBC__ /* OS/2 */
# include <InnoTekLIBC/backend.h>
#endif
+#ifdef __MVS__ /* z/OS */
+# include <termios.h>
+#endif
#include "intprops.h"
@@ -53,7 +56,8 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
return buf;
}
-#ifndef __KLIBC__
+#if !(defined __KLIBC__ || defined __MVS__)
+ /* Generic code for Linux, Solaris, and similar platforms. */
# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
{
enum {
@@ -107,14 +111,29 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
}
}
-#else
+#else /* (defined __KLIBC__ || defined __MVS__), i.e. OS/2 or z/OS */
/* OS/2 kLIBC provides a function to retrieve a path from a fd. */
{
- char dir[_MAX_PATH];
size_t bufsize;
+# ifdef __KLIBC__
+ char dir[_MAX_PATH];
if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
return NULL;
+# endif
+# ifdef __MVS__
+ char dir[_XOPEN_PATH_MAX];
+ /* Documentation:
+ https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-w-ioctl-w-pioctl-control-devices */
+ if (w_ioctl (fd, _IOCC_GPN, sizeof dir, dir) < 0)
+ return NULL;
+ /* Documentation:
+ https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-e2a-l-convert-characters-from-ebcdic-ascii */
+ dirlen = __e2a_l (dir, strlen (dir));
+ if (dirlen < 0 || dirlen >= sizeof dir)
+ return NULL;
+ dir[dirlen] = '\0';
+# endif
dirlen = strlen (dir);
bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */
diff --git a/gl/lib/openat.c b/gl/lib/openat.c
index 52aab19d..f28b10e1 100644
--- a/gl/lib/openat.c
+++ b/gl/lib/openat.c
@@ -1,5 +1,5 @@
/* provide a replacement openat function
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2023 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
@@ -44,7 +44,6 @@ orig_openat (int fd, char const *filename, int flags, mode_t mode)
#include "cloexec.h"
#include <stdarg.h>
-#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
diff --git a/gl/lib/openat.h b/gl/lib/openat.h
index 56919ef8..97f066d1 100644
--- a/gl/lib/openat.h
+++ b/gl/lib/openat.h
@@ -1,5 +1,5 @@
/* provide a replacement openat function
- Copyright (C) 2004-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2006, 2008-2023 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
@@ -19,16 +19,18 @@
#ifndef _GL_HEADER_OPENAT
#define _GL_HEADER_OPENAT
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _Noreturn,
+ _GL_ATTRIBUTE_DEPRECATED, HAVE_OPENAT. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <stdbool.h>
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#if !HAVE_OPENAT
diff --git a/gl/lib/opendir.c b/gl/lib/opendir.c
index fc6b455a..ceb0e282 100644
--- a/gl/lib/opendir.c
+++ b/gl/lib/opendir.c
@@ -1,5 +1,5 @@
/* Start reading the entries of a directory.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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,13 +29,17 @@
#else
-# include <stdlib.h>
-
-# include "dirent-private.h"
# include "filename.h"
#endif
+#include <stdlib.h>
+#include <string.h>
+
+#if GNULIB_defined_DIR
+# include "dirent-private.h"
+#endif
+
#if REPLACE_FCHDIR
# include <unistd.h>
#endif
@@ -57,14 +61,37 @@
DIR *
opendir (const char *dir_name)
+#undef opendir
{
-#if HAVE_OPENDIR
-# undef opendir
+#if HAVE_DIRENT_H /* equivalent to HAVE_OPENDIR */
DIR *dirp;
+# if GNULIB_defined_DIR
+# undef DIR
+
+ dirp = (struct gl_directory *) malloc (sizeof (struct gl_directory));
+ if (dirp == NULL)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ DIR *real_dirp = opendir (dir_name);
+ if (real_dirp == NULL)
+ {
+ int saved_errno = errno;
+ free (dirp);
+ errno = saved_errno;
+ return NULL;
+ }
+
+ dirp->fd_to_close = -1;
+ dirp->real_dirp = real_dirp;
+# else
dirp = opendir (dir_name);
if (dirp == NULL)
return NULL;
+# endif
# ifdef __KLIBC__
{
@@ -82,6 +109,7 @@ opendir (const char *dir_name)
}
}
# endif
+
#else
char dir_name_mask[MAX_PATH + 1 + 1 + 1];
@@ -154,6 +182,7 @@ opendir (const char *dir_name)
errno = ENOMEM;
return NULL;
}
+ dirp->fd_to_close = -1;
dirp->status = status;
dirp->current = current;
if (status == -1)
diff --git a/gl/lib/pathmax.h b/gl/lib/pathmax.h
index 19b93d7e..6930283b 100644
--- a/gl/lib/pathmax.h
+++ b/gl/lib/pathmax.h
@@ -1,5 +1,5 @@
/* Define PATH_MAX somehow. Requires sys/types.h.
- Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2022 Free Software
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -39,6 +39,11 @@
#endif
*/
+/* This file uses HAVE_SYS_PARAM_H. */
+# if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+# endif
+
# include <unistd.h>
# include <limits.h>
diff --git a/gl/lib/pipe-safer.c b/gl/lib/pipe-safer.c
index 22f8695e..750d0970 100644
--- a/gl/lib/pipe-safer.c
+++ b/gl/lib/pipe-safer.c
@@ -1,5 +1,5 @@
/* Invoke pipe, but avoid some glitches.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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/gl/lib/pipe.c b/gl/lib/pipe.c
index ce909b9f..e8573ed9 100644
--- a/gl/lib/pipe.c
+++ b/gl/lib/pipe.c
@@ -1,5 +1,5 @@
/* Create a pipe.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/printf-args.c b/gl/lib/printf-args.c
index 669c24a4..b2b21aee 100644
--- a/gl/lib/printf-args.c
+++ b/gl/lib/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -29,6 +29,9 @@
# include "printf-args.h"
#endif
+/* Get INT_WIDTH. */
+#include <limits.h>
+
#ifdef STATIC
STATIC
#endif
@@ -71,6 +74,102 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
case TYPE_ULONGLONGINT:
ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
break;
+ case TYPE_INT8_T:
+ #if INT8_WIDTH < INT_WIDTH
+ ap->a.a_int8_t = va_arg (args, /* int8_t */ int);
+ #else
+ ap->a.a_int8_t = va_arg (args, int8_t);
+ #endif
+ break;
+ case TYPE_UINT8_T:
+ #if UINT8_WIDTH < INT_WIDTH
+ ap->a.a_uint8_t = va_arg (args, /* uint8_t */ int);
+ #else
+ ap->a.a_uint8_t = va_arg (args, uint8_t);
+ #endif
+ break;
+ case TYPE_INT16_T:
+ #if INT16_WIDTH < INT_WIDTH
+ ap->a.a_int16_t = va_arg (args, /* int16_t */ int);
+ #else
+ ap->a.a_int16_t = va_arg (args, int16_t);
+ #endif
+ break;
+ case TYPE_UINT16_T:
+ #if UINT16_WIDTH < INT_WIDTH
+ ap->a.a_uint16_t = va_arg (args, /* uint16_t */ int);
+ #else
+ ap->a.a_uint16_t = va_arg (args, uint16_t);
+ #endif
+ break;
+ case TYPE_INT32_T:
+ #if INT32_WIDTH < INT_WIDTH
+ ap->a.a_int32_t = va_arg (args, /* int32_t */ int);
+ #else
+ ap->a.a_int32_t = va_arg (args, int32_t);
+ #endif
+ break;
+ case TYPE_UINT32_T:
+ #if UINT32_WIDTH < INT_WIDTH
+ ap->a.a_uint32_t = va_arg (args, /* uint32_t */ int);
+ #else
+ ap->a.a_uint32_t = va_arg (args, uint32_t);
+ #endif
+ break;
+ case TYPE_INT64_T:
+ ap->a.a_int64_t = va_arg (args, int64_t);
+ break;
+ case TYPE_UINT64_T:
+ ap->a.a_uint64_t = va_arg (args, uint64_t);
+ break;
+ case TYPE_INT_FAST8_T:
+ #if INT_FAST8_WIDTH < INT_WIDTH
+ ap->a.a_int_fast8_t = va_arg (args, /* int_fast8_t */ int);
+ #else
+ ap->a.a_int_fast8_t = va_arg (args, int_fast8_t);
+ #endif
+ break;
+ case TYPE_UINT_FAST8_T:
+ #if UINT_FAST8_WIDTH < INT_WIDTH
+ ap->a.a_uint_fast8_t = va_arg (args, /* uint_fast8_t */ int);
+ #else
+ ap->a.a_uint_fast8_t = va_arg (args, uint_fast8_t);
+ #endif
+ break;
+ case TYPE_INT_FAST16_T:
+ #if INT_FAST16_WIDTH < INT_WIDTH
+ ap->a.a_int_fast16_t = va_arg (args, /* int_fast16_t */ int);
+ #else
+ ap->a.a_int_fast16_t = va_arg (args, int_fast16_t);
+ #endif
+ break;
+ case TYPE_UINT_FAST16_T:
+ #if UINT_FAST16_WIDTH < INT_WIDTH
+ ap->a.a_uint_fast16_t = va_arg (args, /* uint_fast16_t */ int);
+ #else
+ ap->a.a_uint_fast16_t = va_arg (args, uint_fast16_t);
+ #endif
+ break;
+ case TYPE_INT_FAST32_T:
+ #if INT_FAST32_WIDTH < INT_WIDTH
+ ap->a.a_int_fast32_t = va_arg (args, /* int_fast32_t */ int);
+ #else
+ ap->a.a_int_fast32_t = va_arg (args, int_fast32_t);
+ #endif
+ break;
+ case TYPE_UINT_FAST32_T:
+ #if UINT_FAST32_WIDTH < INT_WIDTH
+ ap->a.a_uint_fast32_t = va_arg (args, /* uint_fast32_t */ int);
+ #else
+ ap->a.a_uint_fast32_t = va_arg (args, uint_fast32_t);
+ #endif
+ break;
+ case TYPE_INT_FAST64_T:
+ ap->a.a_int_fast64_t = va_arg (args, int_fast64_t);
+ break;
+ case TYPE_UINT_FAST64_T:
+ ap->a.a_uint_fast64_t = va_arg (args, uint_fast64_t);
+ break;
case TYPE_DOUBLE:
ap->a.a_double = va_arg (args, double);
break;
@@ -136,6 +235,30 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
case TYPE_COUNT_LONGLONGINT_POINTER:
ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
break;
+ case TYPE_COUNT_INT8_T_POINTER:
+ ap->a.a_count_int8_t_pointer = va_arg (args, int8_t *);
+ break;
+ case TYPE_COUNT_INT16_T_POINTER:
+ ap->a.a_count_int16_t_pointer = va_arg (args, int16_t *);
+ break;
+ case TYPE_COUNT_INT32_T_POINTER:
+ ap->a.a_count_int32_t_pointer = va_arg (args, int32_t *);
+ break;
+ case TYPE_COUNT_INT64_T_POINTER:
+ ap->a.a_count_int64_t_pointer = va_arg (args, int64_t *);
+ break;
+ case TYPE_COUNT_INT_FAST8_T_POINTER:
+ ap->a.a_count_int_fast8_t_pointer = va_arg (args, int_fast8_t *);
+ break;
+ case TYPE_COUNT_INT_FAST16_T_POINTER:
+ ap->a.a_count_int_fast16_t_pointer = va_arg (args, int_fast16_t *);
+ break;
+ case TYPE_COUNT_INT_FAST32_T_POINTER:
+ ap->a.a_count_int_fast32_t_pointer = va_arg (args, int_fast32_t *);
+ break;
+ case TYPE_COUNT_INT_FAST64_T_POINTER:
+ ap->a.a_count_int_fast64_t_pointer = va_arg (args, int_fast64_t *);
+ break;
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
case TYPE_U8_STRING:
diff --git a/gl/lib/printf-args.h b/gl/lib/printf-args.h
index 553fe961..11016102 100644
--- a/gl/lib/printf-args.h
+++ b/gl/lib/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -41,6 +41,9 @@
# include <wchar.h>
#endif
+/* Get intN_t, uintN_t, intN_fast_t, uintN_fast_t. */
+#include <stdint.h>
+
/* Get va_list. */
#include <stdarg.h>
@@ -59,6 +62,26 @@ typedef enum
TYPE_ULONGINT,
TYPE_LONGLONGINT,
TYPE_ULONGLONGINT,
+ /* According to ISO C 23 § 7.23.6.1, "all exact-width integer types",
+ "all minimum-width integer types", and "all fastest minimum-width integer
+ types" defined in <stdint.h> should be supported. But for portability
+ between platforms, we support only those with N = 8, 16, 32, 64. */
+ TYPE_INT8_T,
+ TYPE_UINT8_T,
+ TYPE_INT16_T,
+ TYPE_UINT16_T,
+ TYPE_INT32_T,
+ TYPE_UINT32_T,
+ TYPE_INT64_T,
+ TYPE_UINT64_T,
+ TYPE_INT_FAST8_T,
+ TYPE_UINT_FAST8_T,
+ TYPE_INT_FAST16_T,
+ TYPE_UINT_FAST16_T,
+ TYPE_INT_FAST32_T,
+ TYPE_UINT_FAST32_T,
+ TYPE_INT_FAST64_T,
+ TYPE_UINT_FAST64_T,
TYPE_DOUBLE,
TYPE_LONGDOUBLE,
TYPE_CHAR,
@@ -74,7 +97,15 @@ typedef enum
TYPE_COUNT_SHORT_POINTER,
TYPE_COUNT_INT_POINTER,
TYPE_COUNT_LONGINT_POINTER,
- TYPE_COUNT_LONGLONGINT_POINTER
+ TYPE_COUNT_LONGLONGINT_POINTER,
+ TYPE_COUNT_INT8_T_POINTER,
+ TYPE_COUNT_INT16_T_POINTER,
+ TYPE_COUNT_INT32_T_POINTER,
+ TYPE_COUNT_INT64_T_POINTER,
+ TYPE_COUNT_INT_FAST8_T_POINTER,
+ TYPE_COUNT_INT_FAST16_T_POINTER,
+ TYPE_COUNT_INT_FAST32_T_POINTER,
+ TYPE_COUNT_INT_FAST64_T_POINTER
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
, TYPE_U8_STRING
@@ -99,7 +130,23 @@ typedef struct
unsigned long int a_ulongint;
long long int a_longlongint;
unsigned long long int a_ulonglongint;
- float a_float;
+ int8_t a_int8_t;
+ uint8_t a_uint8_t;
+ int16_t a_int16_t;
+ uint16_t a_uint16_t;
+ int32_t a_int32_t;
+ uint32_t a_uint32_t;
+ int64_t a_int64_t;
+ uint64_t a_uint64_t;
+ int_fast8_t a_int_fast8_t;
+ uint_fast8_t a_uint_fast8_t;
+ int_fast16_t a_int_fast16_t;
+ uint_fast16_t a_uint_fast16_t;
+ int_fast32_t a_int_fast32_t;
+ uint_fast32_t a_uint_fast32_t;
+ int_fast64_t a_int_fast64_t;
+ uint_fast64_t a_uint_fast64_t;
+ float a_float; /* unused */
double a_double;
long double a_longdouble;
int a_char;
@@ -116,6 +163,14 @@ typedef struct
int * a_count_int_pointer;
long int * a_count_longint_pointer;
long long int * a_count_longlongint_pointer;
+ int8_t * a_count_int8_t_pointer;
+ int16_t * a_count_int16_t_pointer;
+ int32_t * a_count_int32_t_pointer;
+ int64_t * a_count_int64_t_pointer;
+ int_fast8_t * a_count_int_fast8_t_pointer;
+ int_fast16_t * a_count_int_fast16_t_pointer;
+ int_fast32_t * a_count_int_fast32_t_pointer;
+ int_fast64_t * a_count_int_fast64_t_pointer;
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
const uint8_t * a_u8_string;
diff --git a/gl/lib/printf-parse.c b/gl/lib/printf-parse.c
index aab02dc5..d3f2c3cb 100644
--- a/gl/lib/printf-parse.c
+++ b/gl/lib/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2023 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
@@ -326,226 +326,317 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
arg_type type;
/* Parse argument type/size specifiers. */
- {
- int flags = 0;
-
- for (;;)
- {
- if (*cp == 'h')
- {
- flags |= (1 << (flags & 1));
- cp++;
- }
- else if (*cp == 'L')
- {
- flags |= 4;
- cp++;
- }
- else if (*cp == 'l')
- {
- flags += 8;
- cp++;
- }
- else if (*cp == 'j')
- {
- if (sizeof (intmax_t) > sizeof (long))
- {
- /* intmax_t = long long */
- flags += 16;
- }
- else if (sizeof (intmax_t) > sizeof (int))
- {
- /* intmax_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 'z' || *cp == 'Z')
- {
- /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
- because the warning facility in gcc-2.95.2 understands
- only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
- if (sizeof (size_t) > sizeof (long))
- {
- /* size_t = long long */
- flags += 16;
- }
- else if (sizeof (size_t) > sizeof (int))
- {
- /* size_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 't')
- {
- if (sizeof (ptrdiff_t) > sizeof (long))
- {
- /* ptrdiff_t = long long */
- flags += 16;
- }
- else if (sizeof (ptrdiff_t) > sizeof (int))
- {
- /* ptrdiff_t = long */
- flags += 8;
- }
- cp++;
- }
+ /* Relevant for the conversion characters d, i. */
+ arg_type signed_type = TYPE_INT;
+ /* Relevant for the conversion characters b, o, u, x, X. */
+ arg_type unsigned_type = TYPE_UINT;
+ /* Relevant for the conversion characters n. */
+ arg_type pointer_type = TYPE_COUNT_INT_POINTER;
+ /* Relevant for the conversion characters a, A, e, E, f, F, g, G. */
+ arg_type floatingpoint_type = TYPE_DOUBLE;
+
+ if (*cp == 'h')
+ {
+ if (cp[1] == 'h')
+ {
+ signed_type = TYPE_SCHAR;
+ unsigned_type = TYPE_UCHAR;
+ pointer_type = TYPE_COUNT_SCHAR_POINTER;
+ cp += 2;
+ }
+ else
+ {
+ signed_type = TYPE_SHORT;
+ unsigned_type = TYPE_USHORT;
+ pointer_type = TYPE_COUNT_SHORT_POINTER;
+ cp++;
+ }
+ }
+ else if (*cp == 'l')
+ {
+ if (cp[1] == 'l')
+ {
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ cp += 2;
+ }
+ else
+ {
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ cp++;
+ }
+ }
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ }
+ cp++;
+ }
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = unsigned long long */
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = unsigned long */
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ }
+ cp++;
+ }
+ else if (*cp == 'w')
+ {
+ /* wN and wfN are standardized in ISO C 23. */
+ if (cp[1] == 'f')
+ {
+ if (cp[2] == '8')
+ {
+ signed_type = TYPE_INT_FAST8_T;
+ unsigned_type = TYPE_UINT_FAST8_T;
+ pointer_type = TYPE_COUNT_INT_FAST8_T_POINTER;
+ cp += 3;
+ }
+ else if (cp[2] == '1' && cp[3] == '6')
+ {
+ signed_type = TYPE_INT_FAST16_T;
+ unsigned_type = TYPE_UINT_FAST16_T;
+ pointer_type = TYPE_COUNT_INT_FAST16_T_POINTER;
+ cp += 4;
+ }
+ else if (cp[2] == '3' && cp[3] == '2')
+ {
+ signed_type = TYPE_INT_FAST32_T;
+ unsigned_type = TYPE_UINT_FAST32_T;
+ pointer_type = TYPE_COUNT_INT_FAST32_T_POINTER;
+ cp += 4;
+ }
+ else if (cp[2] == '6' && cp[3] == '4')
+ {
+ signed_type = TYPE_INT_FAST64_T;
+ unsigned_type = TYPE_UINT_FAST64_T;
+ pointer_type = TYPE_COUNT_INT_FAST64_T_POINTER;
+ cp += 4;
+ }
+ }
+ else
+ {
+ if (cp[1] == '8')
+ {
+ signed_type = TYPE_INT8_T;
+ unsigned_type = TYPE_UINT8_T;
+ pointer_type = TYPE_COUNT_INT8_T_POINTER;
+ cp += 2;
+ }
+ else if (cp[1] == '1' && cp[2] == '6')
+ {
+ signed_type = TYPE_INT16_T;
+ unsigned_type = TYPE_UINT16_T;
+ pointer_type = TYPE_COUNT_INT16_T_POINTER;
+ cp += 3;
+ }
+ else if (cp[1] == '3' && cp[2] == '2')
+ {
+ signed_type = TYPE_INT32_T;
+ unsigned_type = TYPE_UINT32_T;
+ pointer_type = TYPE_COUNT_INT32_T_POINTER;
+ cp += 3;
+ }
+ else if (cp[1] == '6' && cp[2] == '4')
+ {
+ signed_type = TYPE_INT64_T;
+ unsigned_type = TYPE_UINT64_T;
+ pointer_type = TYPE_COUNT_INT64_T_POINTER;
+ cp += 3;
+ }
+ }
+ }
+ else if (*cp == 'L')
+ {
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ cp++;
+ }
#if defined __APPLE__ && defined __MACH__
- /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
- We cannot change it to "lld" because PRIdMAX must also
- be understood by the system's printf routines. */
- else if (*cp == 'q')
- {
- if (64 / 8 > sizeof (long))
- {
- /* int64_t = long long */
- flags += 16;
- }
- else
- {
- /* int64_t = long */
- flags += 8;
- }
- cp++;
- }
+ /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'q')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* int64_t = long long */
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ }
+ else
+ {
+ /* int64_t = long */
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ }
+ cp++;
+ }
#endif
#if defined _WIN32 && ! defined __CYGWIN__
- /* On native Windows, PRIdMAX is defined as "I64d".
- We cannot change it to "lld" because PRIdMAX must also
- be understood by the system's printf routines. */
- else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
- {
- if (64 / 8 > sizeof (long))
- {
- /* __int64 = long long */
- flags += 16;
- }
- else
- {
- /* __int64 = long */
- flags += 8;
- }
- cp += 3;
- }
+ /* On native Windows, PRIdMAX is defined as "I64d".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* __int64_t = long long */
+ signed_type = TYPE_LONGLONGINT;
+ unsigned_type = TYPE_ULONGLONGINT;
+ pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
+ /* For backward compatibility only. */
+ floatingpoint_type = TYPE_LONGDOUBLE;
+ }
+ else
+ {
+ /* __int64_t = long */
+ signed_type = TYPE_LONGINT;
+ unsigned_type = TYPE_ULONGINT;
+ pointer_type = TYPE_COUNT_LONGINT_POINTER;
+ }
+ cp++;
+ }
#endif
- else
- break;
- }
- /* Read the conversion character. */
- c = *cp++;
- switch (c)
- {
- case 'd': case 'i':
- /* If 'long long' is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGLONGINT;
- else
- /* If 'long long' is the same as 'long', we parse "lld" into
- TYPE_LONGINT. */
- if (flags >= 8)
- type = TYPE_LONGINT;
- else if (flags & 2)
- type = TYPE_SCHAR;
- else if (flags & 1)
- type = TYPE_SHORT;
- else
- type = TYPE_INT;
- break;
- case 'o': case 'u': case 'x': case 'X':
- /* If 'unsigned long long' is larger than 'unsigned long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_ULONGLONGINT;
- else
- /* If 'unsigned long long' is the same as 'unsigned long', we
- parse "llu" into TYPE_ULONGINT. */
- if (flags >= 8)
- type = TYPE_ULONGINT;
- else if (flags & 2)
- type = TYPE_UCHAR;
- else if (flags & 1)
- type = TYPE_USHORT;
- else
- type = TYPE_UINT;
- break;
- case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGDOUBLE;
- else
- type = TYPE_DOUBLE;
- break;
- case 'c':
- if (flags >= 8)
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
+ type = signed_type;
+ break;
+ case 'b': case 'o': case 'u': case 'x': case 'X':
+ #if SUPPORT_GNU_PRINTF_DIRECTIVES \
+ || (__GLIBC__ + (__GLIBC_MINOR__ >= 35) > 2)
+ case 'B':
+ #endif
+ type = unsigned_type;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ type = floatingpoint_type;
+ break;
+ case 'c':
+ if (signed_type == TYPE_LONGINT
+ /* For backward compatibility only. */
+ || signed_type == TYPE_LONGLONGINT)
#if HAVE_WINT_T
- type = TYPE_WIDE_CHAR;
+ type = TYPE_WIDE_CHAR;
#else
- goto error;
+ goto error;
#endif
- else
- type = TYPE_CHAR;
- break;
+ else
+ type = TYPE_CHAR;
+ break;
#if HAVE_WINT_T
- case 'C':
- type = TYPE_WIDE_CHAR;
- c = 'c';
- break;
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
#endif
- case 's':
- if (flags >= 8)
+ case 's':
+ if (signed_type == TYPE_LONGINT
+ /* For backward compatibility only. */
+ || signed_type == TYPE_LONGLONGINT)
#if HAVE_WCHAR_T
- type = TYPE_WIDE_STRING;
+ type = TYPE_WIDE_STRING;
#else
- goto error;
+ goto error;
#endif
- else
- type = TYPE_STRING;
- break;
+ else
+ type = TYPE_STRING;
+ break;
#if HAVE_WCHAR_T
- case 'S':
- type = TYPE_WIDE_STRING;
- c = 's';
- break;
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
#endif
- case 'p':
- type = TYPE_POINTER;
- break;
- case 'n':
- /* If 'long long' is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_COUNT_LONGLONGINT_POINTER;
- else
- /* If 'long long' is the same as 'long', we parse "lln" into
- TYPE_COUNT_LONGINT_POINTER. */
- if (flags >= 8)
- type = TYPE_COUNT_LONGINT_POINTER;
- else if (flags & 2)
- type = TYPE_COUNT_SCHAR_POINTER;
- else if (flags & 1)
- type = TYPE_COUNT_SHORT_POINTER;
- else
- type = TYPE_COUNT_INT_POINTER;
- break;
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
+ type = pointer_type;
+ break;
#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- case 'U':
- if (flags >= 16)
- type = TYPE_U32_STRING;
- else if (flags >= 8)
- type = TYPE_U16_STRING;
- else
- type = TYPE_U8_STRING;
- break;
+ /* The unistdio extensions. */
+ case 'U':
+ if (signed_type == TYPE_LONGLONGINT)
+ type = TYPE_U32_STRING;
+ else if (signed_type == TYPE_LONGINT)
+ type = TYPE_U16_STRING;
+ else
+ type = TYPE_U8_STRING;
+ break;
#endif
- case '%':
- type = TYPE_NONE;
- break;
- default:
- /* Unknown conversion character. */
- goto error;
- }
- }
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
if (type != TYPE_NONE)
{
diff --git a/gl/lib/printf-parse.h b/gl/lib/printf-parse.h
index b12ccea3..45febac1 100644
--- a/gl/lib/printf-parse.h
+++ b/gl/lib/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -61,7 +61,7 @@ typedef struct
const char* precision_start;
const char* precision_end;
size_t precision_arg_index;
- char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ char conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index;
}
char_directive;
@@ -91,7 +91,7 @@ typedef struct
const uint8_t* precision_start;
const uint8_t* precision_end;
size_t precision_arg_index;
- uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ uint8_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index;
}
u8_directive;
@@ -119,7 +119,7 @@ typedef struct
const uint16_t* precision_start;
const uint16_t* precision_end;
size_t precision_arg_index;
- uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ uint16_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index;
}
u16_directive;
@@ -147,7 +147,7 @@ typedef struct
const uint32_t* precision_start;
const uint32_t* precision_end;
size_t precision_arg_index;
- uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ uint32_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index;
}
u32_directive;
diff --git a/gl/lib/progname.c b/gl/lib/progname.c
index 6f09c2b5..ed928e04 100644
--- a/gl/lib/progname.c
+++ b/gl/lib/progname.c
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2003, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/progname.h b/gl/lib/progname.h
index 05610896..945d1697 100644
--- a/gl/lib/progname.h
+++ b/gl/lib/progname.h
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2004, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/pselect.c b/gl/lib/pselect.c
index a1eca0c6..1b8c1913 100644
--- a/gl/lib/pselect.c
+++ b/gl/lib/pselect.c
@@ -1,6 +1,6 @@
/* pselect - synchronous I/O multiplexing
- Copyright 2011-2022 Free Software Foundation, Inc.
+ Copyright 2011-2023 Free Software Foundation, Inc.
This file is part of gnulib.
@@ -45,6 +45,12 @@ pselect (int nfds, fd_set *restrict rfds,
sigset_t origmask;
struct timeval tv, *tvp;
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
if (timeout)
{
if (! (0 <= timeout->tv_nsec && timeout->tv_nsec < 1000000000))
@@ -53,8 +59,10 @@ pselect (int nfds, fd_set *restrict rfds,
return -1;
}
- tv.tv_sec = timeout->tv_sec;
- tv.tv_usec = (timeout->tv_nsec + 999) / 1000;
+ tv = (struct timeval) {
+ .tv_sec = timeout->tv_sec,
+ .tv_usec = (timeout->tv_nsec + 999) / 1000
+ };
tvp = &tv;
}
else
diff --git a/gl/lib/pthread_sigmask.c b/gl/lib/pthread_sigmask.c
index cd4eb807..12810758 100644
--- a/gl/lib/pthread_sigmask.c
+++ b/gl/lib/pthread_sigmask.c
@@ -1,5 +1,5 @@
/* POSIX compatible signal blocking for threads.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/raise.c b/gl/lib/raise.c
index 385ddd38..506e20b4 100644
--- a/gl/lib/raise.c
+++ b/gl/lib/raise.c
@@ -1,6 +1,6 @@
/* Provide a non-threads replacement for the POSIX raise function.
- Copyright (C) 2002-2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2006, 2009-2023 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/gl/lib/rawmemchr.c b/gl/lib/rawmemchr.c
index ea68c1bf..45c6cd35 100644
--- a/gl/lib/rawmemchr.c
+++ b/gl/lib/rawmemchr.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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,8 @@
#if !HAVE_RAWMEMCHR
# include <limits.h>
-# include <stdalign.h>
# include <stdint.h>
-# include "verify.h"
/* Find the first occurrence of C in S. */
void *
@@ -36,7 +34,7 @@ rawmemchr (const void *s, int c_in)
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. */
- verify (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+ static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
const unsigned char *char_ptr;
unsigned char c = c_in;
diff --git a/gl/lib/rawmemchr.valgrind b/gl/lib/rawmemchr.valgrind
index 64cf86c8..f3e4cb0f 100644
--- a/gl/lib/rawmemchr.valgrind
+++ b/gl/lib/rawmemchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
-# Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2008-2023 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/gl/lib/readdir.c b/gl/lib/readdir.c
index 8e841df8..04dbba21 100644
--- a/gl/lib/readdir.c
+++ b/gl/lib/readdir.c
@@ -1,5 +1,5 @@
/* Read the next entry of a directory.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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
@@ -22,7 +22,9 @@
#include <errno.h>
#include <stddef.h>
-#include "dirent-private.h"
+#if GNULIB_defined_DIR
+# include "dirent-private.h"
+#endif
/* Don't assume that UNICODE is not defined. */
#undef FindNextFile
@@ -30,7 +32,11 @@
struct dirent *
readdir (DIR *dirp)
+#undef readdir
{
+#if HAVE_DIRENT_H /* equivalent to HAVE_READDIR */
+ return readdir (dirp->real_dirp);
+#else
char type;
struct dirent *result;
@@ -99,4 +105,5 @@ readdir (DIR *dirp)
result->d_type = type;
return result;
+#endif
}
diff --git a/gl/lib/readlink.c b/gl/lib/readlink.c
index ed03cc8d..14bbb7f1 100644
--- a/gl/lib/readlink.c
+++ b/gl/lib/readlink.c
@@ -1,5 +1,5 @@
/* Read the contents of a symbolic link.
- Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2023 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/gl/lib/readlinkat.c b/gl/lib/readlinkat.c
index ab45e140..7738ba8b 100644
--- a/gl/lib/readlinkat.c
+++ b/gl/lib/readlinkat.c
@@ -1,5 +1,5 @@
/* Read a symlink relative to an open directory.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/realloc.c b/gl/lib/realloc.c
index c8783815..1063eb09 100644
--- a/gl/lib/realloc.c
+++ b/gl/lib/realloc.c
@@ -1,6 +1,6 @@
/* realloc() function that is glibc compatible.
- Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2022 Free Software
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/reallocarray.c b/gl/lib/reallocarray.c
index bc4cba4b..8c99250f 100644
--- a/gl/lib/reallocarray.c
+++ b/gl/lib/reallocarray.c
@@ -1,6 +1,6 @@
/* reallocarray function that is glibc compatible.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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,16 +19,15 @@
#include <config.h>
+#include <stdckdint.h>
#include <stdlib.h>
#include <errno.h>
-#include "intprops.h"
-
void *
reallocarray (void *ptr, size_t nmemb, size_t size)
{
size_t nbytes;
- if (INT_MULTIPLY_WRAPV (nmemb, size, &nbytes))
+ if (ckd_mul (&nbytes, nmemb, size))
{
errno = ENOMEM;
return NULL;
diff --git a/gl/lib/regcomp.c b/gl/lib/regcomp.c
index 122c3de5..1f6a1311 100644
--- a/gl/lib/regcomp.c
+++ b/gl/lib/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -905,7 +905,7 @@ init_word_char (re_dfa_t *dfa)
bitset_word_t bits3 = 0x07fffffe;
if (BITSET_WORD_BITS == 64)
{
- /* Pacify gcc -Woverflow on 32-bit platformns. */
+ /* Pacify gcc -Woverflow on 32-bit platforms. */
dfa->word_char[0] = bits1 << 31 << 1 | bits0;
dfa->word_char[1] = bits3 << 31 << 1 | bits2;
i = 2;
diff --git a/gl/lib/regex.c b/gl/lib/regex.c
index ff117678..3beb0deb 100644
--- a/gl/lib/regex.c
+++ b/gl/lib/regex.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gl/lib/regex.h b/gl/lib/regex.h
index a7e0bd02..9ef0252f 100644
--- a/gl/lib/regex.h
+++ b/gl/lib/regex.h
@@ -1,6 +1,6 @@
/* Definitions for data structures and routines for the regular
expression library.
- Copyright (C) 1985, 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989-2023 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/gl/lib/regex_internal.c b/gl/lib/regex_internal.c
index 0e6919f3..998a19b7 100644
--- a/gl/lib/regex_internal.c
+++ b/gl/lib/regex_internal.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/gl/lib/regex_internal.h b/gl/lib/regex_internal.h
index 57a455b1..7e35a112 100644
--- a/gl/lib/regex_internal.h
+++ b/gl/lib/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -29,7 +29,7 @@
#include <locale.h>
#include <wchar.h>
#include <wctype.h>
-#include <stdbool.h>
+#include <stdckdint.h>
#include <stdint.h>
#ifndef _LIBC
@@ -151,9 +151,6 @@
as some non-GCC platforms lack them, an issue when this code is
used in Gnulib. */
-#ifndef SSIZE_MAX
-# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
-#endif
#ifndef ULONG_WIDTH
# define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX)
/* The number of usable bits in an unsigned integer type with maximum
@@ -823,7 +820,7 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
}
#ifdef _LIBC
-# if __GNUC__ >= 7
+# if __glibc_has_attribute (__fallthrough__)
# define FALLTHROUGH __attribute__ ((__fallthrough__))
# else
# define FALLTHROUGH ((void) 0)
diff --git a/gl/lib/regexec.c b/gl/lib/regexec.c
index 521cb028..f05f38ae 100644
--- a/gl/lib/regexec.c
+++ b/gl/lib/regexec.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -324,7 +324,7 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
char *s = NULL;
if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0
- || INT_ADD_WRAPV (length1, length2, &len))))
+ || ckd_add (&len, length1, length2))))
return -2;
/* Concatenate the strings. */
diff --git a/gl/lib/rename.c b/gl/lib/rename.c
index 119abe5c..aa3afd87 100644
--- a/gl/lib/rename.c
+++ b/gl/lib/rename.c
@@ -1,6 +1,6 @@
/* Work around rename bugs in some systems.
- Copyright (C) 2001-2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2006, 2009-2023 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,6 @@
existing files. */
# include <errno.h>
-# include <stdbool.h>
# include <stdlib.h>
# include <sys/stat.h>
# include <unistd.h>
@@ -361,7 +360,7 @@ rpl_rename (char const *src, char const *dst)
# if (RENAME_TRAILING_SLASH_SOURCE_BUG || RENAME_DEST_EXISTS_BUG \
|| RENAME_HARD_LINK_BUG)
/* If the only bug was that a trailing slash was allowed on a
- non-existing file destination, as in Solaris 10, then we've
+ nonexistent file destination, as in Solaris 10, then we've
already covered that situation. But if there is any problem with
a trailing slash on an existing source or destination, as in
Solaris 9, or if a directory can overwrite a symlink, as on
diff --git a/gl/lib/renameat.c b/gl/lib/renameat.c
index f08be7b2..e482b4b5 100644
--- a/gl/lib/renameat.c
+++ b/gl/lib/renameat.c
@@ -1,5 +1,5 @@
/* Rename a file relative to open directories.
- Copyright 2017-2022 Free Software Foundation, Inc.
+ Copyright 2017-2023 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/gl/lib/renameatu.c b/gl/lib/renameatu.c
index 7ba186ca..939e5896 100644
--- a/gl/lib/renameatu.c
+++ b/gl/lib/renameatu.c
@@ -1,5 +1,5 @@
/* Rename a file relative to open directories.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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
@@ -38,7 +38,6 @@ errno_fail (int e)
#if HAVE_RENAMEAT
-# include <stdbool.h>
# include <stdlib.h>
# include <string.h>
diff --git a/gl/lib/renameatu.h b/gl/lib/renameatu.h
index 239df4ce..86a7d2d1 100644
--- a/gl/lib/renameatu.h
+++ b/gl/lib/renameatu.h
@@ -1,5 +1,5 @@
/* Rename a file relative to open directories.
- Copyright 2017-2022 Free Software Foundation, Inc.
+ Copyright 2017-2023 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/gl/lib/rewinddir.c b/gl/lib/rewinddir.c
index b07aaf9c..f200cc53 100644
--- a/gl/lib/rewinddir.c
+++ b/gl/lib/rewinddir.c
@@ -1,5 +1,5 @@
/* Restart reading the entries of a directory from the beginning.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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,7 +21,9 @@
#include <errno.h>
-#include "dirent-private.h"
+#if GNULIB_defined_DIR
+# include "dirent-private.h"
+#endif
/* Don't assume that UNICODE is not defined. */
#undef FindFirstFile
@@ -29,7 +31,11 @@
void
rewinddir (DIR *dirp)
+#undef rewinddir
{
+#if HAVE_DIRENT_H /* equivalent to HAVE_REWINDDIR */
+ rewinddir (dirp->real_dirp);
+#else
/* Like in closedir(). */
if (dirp->current != INVALID_HANDLE_VALUE)
FindClose (dirp->current);
@@ -50,4 +56,5 @@ rewinddir (DIR *dirp)
break;
}
}
+#endif
}
diff --git a/gl/lib/rmdir.c b/gl/lib/rmdir.c
index 8c8b75e0..bd1d8197 100644
--- a/gl/lib/rmdir.c
+++ b/gl/lib/rmdir.c
@@ -1,6 +1,6 @@
/* Work around rmdir bugs.
- Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/same-inode.h b/gl/lib/same-inode.h
index f65f3d03..10964f00 100644
--- a/gl/lib/same-inode.h
+++ b/gl/lib/same-inode.h
@@ -1,6 +1,6 @@
/* Determine whether two stat buffers are known to refer to the same file.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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/gl/lib/save-cwd.c b/gl/lib/save-cwd.c
index ea487a40..3806084b 100644
--- a/gl/lib/save-cwd.c
+++ b/gl/lib/save-cwd.c
@@ -1,6 +1,6 @@
/* save-cwd.c -- Save and restore current working directory.
- Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/gl/lib/save-cwd.h b/gl/lib/save-cwd.h
index 90e8a074..d089b0e2 100644
--- a/gl/lib/save-cwd.h
+++ b/gl/lib/save-cwd.h
@@ -1,6 +1,6 @@
/* Save and restore current working directory.
- Copyright (C) 1995, 1997-1998, 2003, 2009-2022 Free Software Foundation,
+ Copyright (C) 1995, 1997-1998, 2003, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/scratch_buffer.h b/gl/lib/scratch_buffer.h
index f4fe5e8d..4cf60d23 100644
--- a/gl/lib/scratch_buffer.h
+++ b/gl/lib/scratch_buffer.h
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -98,20 +98,10 @@ extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer,
size_t nelem, size_t size);
#endif
-/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
- deallocating *BUFFER if it was heap-allocated. SIZE must be at
- most *BUFFER's size. Return NULL (setting errno) on memory
- exhaustion. */
-#if 0
-extern void *scratch_buffer_dupfree (struct scratch_buffer *buffer,
- size_t size);
-#endif
-
/* The implementation is imported from glibc. */
/* Avoid possible conflicts with symbols exported by the GNU libc. */
-#define __libc_scratch_buffer_dupfree gl_scratch_buffer_dupfree
#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
diff --git a/gl/lib/select.c b/gl/lib/select.c
index c2424982..6b6ca415 100644
--- a/gl/lib/select.c
+++ b/gl/lib/select.c
@@ -1,7 +1,7 @@
/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2022 Free Software Foundation, Inc.
+ Copyright 2008-2023 Free Software Foundation, Inc.
This file is part of gnulib.
@@ -279,8 +279,11 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
int i, fd, rc;
clock_t tend;
- if (nfds > FD_SETSIZE)
- nfds = FD_SETSIZE;
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
if (!timeout)
wait_timeout = INFINITE;
diff --git a/gl/lib/setenv.c b/gl/lib/setenv.c
index ebfd4e55..22b12fd0 100644
--- a/gl/lib/setenv.c
+++ b/gl/lib/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2023 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
@@ -375,6 +375,11 @@ rpl_setenv (const char *name, const char *value, int replace)
int saved_errno;
size_t len = strlen (value);
tmp = malloca (len + 2);
+ if (tmp == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
/* Since leading '=' is eaten, double it up. */
*tmp = '=';
memcpy (tmp + 1, value, len + 1);
diff --git a/gl/lib/setlocale-lock.c b/gl/lib/setlocale-lock.c
index 4e7540e1..b70ba09b 100644
--- a/gl/lib/setlocale-lock.c
+++ b/gl/lib/setlocale-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by setlocale_null_r.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/setlocale_null.c b/gl/lib/setlocale_null.c
index 778429b9..89c8a065 100644
--- a/gl/lib/setlocale_null.c
+++ b/gl/lib/setlocale_null.c
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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
@@ -173,7 +173,7 @@ setlocale_null_unlocked (int category, char *buf, size_t bufsize)
#endif
}
-#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+#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
at the same time. */
@@ -198,7 +198,7 @@ setlocale_null_with_lock (int category, char *buf, size_t bufsize)
return ret;
}
-# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin < 3.4.6 */
extern
# if defined _WIN32 || defined __CYGWIN__
diff --git a/gl/lib/setlocale_null.h b/gl/lib/setlocale_null.h
index d1921b09..c740fa0f 100644
--- a/gl/lib/setlocale_null.h
+++ b/gl/lib/setlocale_null.h
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/sig-handler.c b/gl/lib/sig-handler.c
index 0ab63ec1..5ea345fc 100644
--- a/gl/lib/sig-handler.c
+++ b/gl/lib/sig-handler.c
@@ -1,6 +1,6 @@
/* Convenience declarations when working with <signal.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/sig-handler.h b/gl/lib/sig-handler.h
index 1ca8d542..e85d30b3 100644
--- a/gl/lib/sig-handler.h
+++ b/gl/lib/sig-handler.h
@@ -1,6 +1,6 @@
/* Convenience declarations when working with <signal.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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,11 +18,13 @@
#ifndef _GL_SIG_HANDLER_H
#define _GL_SIG_HANDLER_H
-#include <signal.h>
-
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
+#include <signal.h>
+
_GL_INLINE_HEADER_BEGIN
#ifndef SIG_HANDLER_INLINE
# define SIG_HANDLER_INLINE _GL_INLINE
diff --git a/gl/lib/sigaction.c b/gl/lib/sigaction.c
index 953a6cae..19f76657 100644
--- a/gl/lib/sigaction.c
+++ b/gl/lib/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX compatible signal blocking.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Eric Blake <ebb9@byu.net>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/signal.in.h b/gl/lib/signal.in.h
index 640b5022..418d59c5 100644
--- a/gl/lib/signal.in.h
+++ b/gl/lib/signal.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <signal.h>.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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,13 +55,26 @@
#ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _@GUARD_PREFIX@_SIGNAL_H
-/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+/* For testing the OpenBSD version. */
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+ && defined __OpenBSD__
+# include <sys/param.h>
+#endif
+
+/* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD < 5.1, OSF/1 4.0, Solaris 2.6, Android,
OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
But avoid namespace pollution on glibc systems.*/
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
&& ((defined __APPLE__ && defined __MACH__) \
- || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
- || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
+ || (defined __FreeBSD__ && __FreeBSD__ < 8) \
+ || (defined __OpenBSD__ && OpenBSD < 201205) \
+ || defined __osf__ || defined __sun || defined __ANDROID__ \
+ || defined __KLIBC__) \
&& ! defined __GLIBC__
# include <pthread.h>
#endif
diff --git a/gl/lib/sigprocmask.c b/gl/lib/sigprocmask.c
index a805da66..943383e2 100644
--- a/gl/lib/sigprocmask.c
+++ b/gl/lib/sigprocmask.c
@@ -1,5 +1,5 @@
/* POSIX compatible signal blocking.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/size_max.h b/gl/lib/size_max.h
index dee2b8ee..2cfd31a5 100644
--- a/gl/lib/size_max.h
+++ b/gl/lib/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
@@ -18,6 +18,11 @@
#ifndef GNULIB_SIZE_MAX_H
#define GNULIB_SIZE_MAX_H
+/* This file uses HAVE_STDINT_H. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
# include <limits.h>
/* Get SIZE_MAX declaration on systems like glibc 2. */
diff --git a/gl/lib/sleep.c b/gl/lib/sleep.c
index 7a6fb152..37c1213c 100644
--- a/gl/lib/sleep.c
+++ b/gl/lib/sleep.c
@@ -1,5 +1,5 @@
/* Pausing execution of the current thread.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
@@ -22,8 +22,6 @@
#include <limits.h>
-#include "verify.h"
-
#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
@@ -56,7 +54,7 @@ unsigned int
rpl_sleep (unsigned int seconds)
{
/* This requires int larger than 16 bits. */
- verify (UINT_MAX / 24 / 24 / 60 / 60);
+ static_assert (UINT_MAX / 24 / 24 / 60 / 60);
const unsigned int limit = 24 * 24 * 60 * 60;
while (limit < seconds)
{
diff --git a/gl/lib/sockets.c b/gl/lib/sockets.c
index 31b43029..ca99db8b 100644
--- a/gl/lib/sockets.c
+++ b/gl/lib/sockets.c
@@ -1,6 +1,6 @@
/* sockets.c --- wrappers for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/sockets.h b/gl/lib/sockets.h
index 75e49fce..55d5e3a4 100644
--- a/gl/lib/sockets.h
+++ b/gl/lib/sockets.h
@@ -1,6 +1,6 @@
/* sockets.h - wrappers for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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 @@
#ifndef SOCKETS_H
#define SOCKETS_H 1
+/* This file uses _GL_ATTRIBUTE_CONST. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#define SOCKETS_1_0 0x0001
#define SOCKETS_1_1 0x0101
#define SOCKETS_2_0 0x0002
diff --git a/gl/lib/stat-time.c b/gl/lib/stat-time.c
index 3d48a2b5..bc282232 100644
--- a/gl/lib/stat-time.c
+++ b/gl/lib/stat-time.c
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/stat-time.h b/gl/lib/stat-time.h
index 6b0088e3..75eb27e5 100644
--- a/gl/lib/stat-time.h
+++ b/gl/lib/stat-time.h
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2023 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,16 +20,18 @@
#ifndef STAT_TIME_H
#define STAT_TIME_H 1
-#include "intprops.h"
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_UNUSED,
+ _GL_ATTRIBUTE_PURE, HAVE_STRUCT_STAT_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
#include <errno.h>
+#include <stdckdint.h>
#include <stddef.h>
#include <sys/stat.h>
#include <time.h>
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_STAT_TIME_INLINE
# define _GL_STAT_TIME_INLINE _GL_INLINE
@@ -120,10 +122,8 @@ get_stat_atime (struct stat const *st)
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_atim);
#else
- struct timespec t;
- t.tv_sec = st->st_atime;
- t.tv_nsec = get_stat_atime_ns (st);
- return t;
+ return (struct timespec) { .tv_sec = st->st_atime,
+ .tv_nsec = get_stat_atime_ns (st) };
#endif
}
@@ -134,10 +134,8 @@ get_stat_ctime (struct stat const *st)
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_ctim);
#else
- struct timespec t;
- t.tv_sec = st->st_ctime;
- t.tv_nsec = get_stat_ctime_ns (st);
- return t;
+ return (struct timespec) { .tv_sec = st->st_ctime,
+ .tv_nsec = get_stat_ctime_ns (st) };
#endif
}
@@ -148,10 +146,8 @@ get_stat_mtime (struct stat const *st)
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_mtim);
#else
- struct timespec t;
- t.tv_sec = st->st_mtime;
- t.tv_nsec = get_stat_mtime_ns (st);
- return t;
+ return (struct timespec) { .tv_sec = st->st_mtime,
+ .tv_nsec = get_stat_mtime_ns (st) };
#endif
}
@@ -166,8 +162,8 @@ get_stat_birthtime (_GL_UNUSED struct stat const *st)
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
t = STAT_TIMESPEC (st, st_birthtim);
#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
- t.tv_sec = st->st_birthtime;
- t.tv_nsec = st->st_birthtimensec;
+ t = (struct timespec) { .tv_sec = st->st_birthtime,
+ .tv_nsec = st->st_birthtimensec };
#elif defined _WIN32 && ! defined __CYGWIN__
/* Native Windows platforms (but not Cygwin) put the "file creation
time" in st_ctime (!). See
@@ -175,13 +171,11 @@ get_stat_birthtime (_GL_UNUSED struct stat const *st)
# if _GL_WINDOWS_STAT_TIMESPEC
t = st->st_ctim;
# else
- t.tv_sec = st->st_ctime;
- t.tv_nsec = 0;
+ t = (struct timespec) { .tv_sec = st->st_ctime };
# endif
#else
/* Birth time is not supported. */
- t.tv_sec = -1;
- t.tv_nsec = -1;
+ t = (struct timespec) { .tv_sec = -1, .tv_nsec = -1 };
#endif
#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
@@ -193,10 +187,7 @@ get_stat_birthtime (_GL_UNUSED struct stat const *st)
sometimes returns junk in the birth time fields; work around this
bug if it is detected. */
if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
- {
- t.tv_sec = -1;
- t.tv_nsec = -1;
- }
+ t = (struct timespec) { .tv_sec = -1, .tv_nsec = -1 };
#endif
return t;
@@ -230,9 +221,8 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st)
}
ts->tv_nsec = r;
/* Overflow is possible, as Solaris 11 stat can yield
- tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
- INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
- if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
+ tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000. */
+ if (ckd_add (&ts->tv_sec, q, ts->tv_sec))
{
errno = EOVERFLOW;
return -1;
diff --git a/gl/lib/stat-w32.c b/gl/lib/stat-w32.c
index c1a29239..2f011975 100644
--- a/gl/lib/stat-w32.c
+++ b/gl/lib/stat-w32.c
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -50,7 +50,6 @@
#include "stat-w32.h"
#include "pathmax.h"
-#include "verify.h"
/* Don't assume that UNICODE is not defined. */
#undef LoadLibrary
@@ -228,7 +227,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
{
buf->st_dev = id.VolumeSerialNumber;
- verify (sizeof (ino_t) == sizeof (id.FileId));
+ static_assert (sizeof (ino_t) == sizeof (id.FileId));
memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
goto ino_done;
}
diff --git a/gl/lib/stat-w32.h b/gl/lib/stat-w32.h
index 0f79d614..c6738749 100644
--- a/gl/lib/stat-w32.h
+++ b/gl/lib/stat-w32.h
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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/gl/lib/stat.c b/gl/lib/stat.c
index 574489ac..7987e265 100644
--- a/gl/lib/stat.c
+++ b/gl/lib/stat.c
@@ -1,5 +1,5 @@
/* Work around platform bugs in stat.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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,11 +55,9 @@ orig_stat (const char *filename, struct stat *buf)
#include <errno.h>
#include <limits.h>
-#include <stdbool.h>
#include <string.h>
#include "filename.h"
#include "malloca.h"
-#include "verify.h"
#ifdef WINDOWS_NATIVE
# define WIN32_LEAN_AND_MEAN
diff --git a/gl/lib/stdalign.in.h b/gl/lib/stdalign.in.h
deleted file mode 100644
index 3b117df1..00000000
--- a/gl/lib/stdalign.in.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* A substitute for ISO C11 <stdalign.h>.
-
- Copyright 2011-2022 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 and Bruno Haible. */
-
-#ifndef _GL_STDALIGN_H
-#define _GL_STDALIGN_H
-
-/* ISO C11 <stdalign.h> for platforms that lack it.
-
- References:
- ISO C11 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.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>)
- section 18.10. */
-
-/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
- requirement of a structure member (i.e., slot or field) that is of
- type TYPE, as an integer constant expression.
-
- This differs from GCC's and clang's __alignof__ operator, which can
- yield a better-performing alignment for an object of that type. For
- example, on x86 with GCC and on Linux/x86 with clang,
- __alignof__ (double) and __alignof__ (long long) are 8, whereas
- alignof (double) and alignof (long long) are 4 unless the option
- '-malign-double' is used.
-
- The result cannot be used as a value for an 'enum' constant, if you
- want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
-
- Include <stddef.h> for offsetof. */
-#include <stddef.h>
-
-/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
- standard headers, defines conflicting implementations of _Alignas
- and _Alignof that are no better than ours; override them. */
-#undef _Alignas
-#undef _Alignof
-
-/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
- clang versions < 8.0.0 have the same bug. */
-#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
- || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
- && !defined __clang__) \
- || (defined __clang__ && __clang_major__ < 8))
-# ifdef __cplusplus
-# if 201103 <= __cplusplus
-# define _Alignof(type) alignof (type)
-# else
- template <class __t> struct __alignof_helper { char __a; __t __b; };
-# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
-# endif
-# else
-# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
-# endif
-#endif
-#if ! (defined __cplusplus && 201103 <= __cplusplus)
-# define alignof _Alignof
-#endif
-#define __alignof_is_defined 1
-
-/* alignas (A), also known as _Alignas (A), aligns a variable or type
- to the alignment A, where A is an integer constant expression. For
- example:
-
- int alignas (8) foo;
- struct s { int a; int alignas (8) bar; };
-
- aligns the address of FOO and the offset of BAR to be multiples of 8.
-
- A should be a power of two that is at least the type's alignment
- and at most the implementation's alignment limit. This limit is
- 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
- to MSVC through at least version 10.0, A should be an integer
- constant, as MSVC does not support expressions such as 1 << 3.
- To be portable to Sun C 5.11, do not align auto variables to
- anything stricter than their default alignment.
-
- The following C11 requirements are not supported here:
-
- - If A is zero, alignas has no effect.
- - alignas can be used multiple times; the strictest one wins.
- - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
-
- */
-
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
-# if defined __cplusplus && 201103 <= __cplusplus
-# define _Alignas(a) alignas (a)
-# elif (!defined __attribute__ \
- && ((defined __APPLE__ && defined __MACH__ \
- ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
- : __GNUC__ && !defined __ibmxl__) \
- || (4 <= __clang_major__) \
- || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
- || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
-# define _Alignas(a) __attribute__ ((__aligned__ (a)))
-# elif 1300 <= _MSC_VER
-# define _Alignas(a) __declspec (align (a))
-# endif
-#endif
-#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# define alignas _Alignas
-#endif
-#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
-# define __alignas_is_defined 1
-#endif
-
-#endif /* _GL_STDALIGN_H */
diff --git a/gl/lib/stdarg.in.h b/gl/lib/stdarg.in.h
index 95306bfb..8145216e 100644
--- a/gl/lib/stdarg.in.h
+++ b/gl/lib/stdarg.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <stdarg.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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,6 +27,11 @@
#ifndef _@GUARD_PREFIX@_STDARG_H
#define _@GUARD_PREFIX@_STDARG_H
+/* This file uses va_copy. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#ifndef va_copy
# define va_copy(a,b) ((a) = (b))
#endif
diff --git a/gl/lib/stdbool.in.h b/gl/lib/stdbool.in.h
deleted file mode 100644
index 03840f10..00000000
--- a/gl/lib/stdbool.in.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
- Written by Bruno Haible <haible@clisp.cons.org>, 2001.
-
- 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 _GL_STDBOOL_H
-#define _GL_STDBOOL_H
-
-/* ISO C 99 <stdbool.h> for platforms that lack it. */
-
-/* Usage suggestions:
-
- Programs that use <stdbool.h> should be aware of some limitations
- and standards compliance issues.
-
- Standards compliance:
-
- - <stdbool.h> must be #included before 'bool', 'false', 'true'
- can be used.
-
- - You cannot assume that sizeof (bool) == 1.
-
- - Programs should not undefine the macros bool, true, and false,
- as C99 lists that as an "obsolescent feature".
-
- Limitations of this substitute, when used in a C89 environment:
-
- - <stdbool.h> must be #included before the '_Bool' type can be used.
-
- - You cannot assume that _Bool is a typedef; it might be a macro.
-
- - Bit-fields of type 'bool' are not supported. Portable code
- should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
-
- - In C99, casts and automatic conversions to '_Bool' or 'bool' are
- performed in such a way that every nonzero value gets converted
- to 'true', and zero gets converted to 'false'. This doesn't work
- with this substitute. With this substitute, only the values 0 and 1
- give the expected result when converted to _Bool' or 'bool'.
-
- - C99 allows the use of (_Bool)0.0 in constant expressions, but
- this substitute cannot always provide this property.
-
- Also, it is suggested that programs use 'bool' rather than '_Bool';
- this isn't required, but 'bool' is more common. */
-
-
-/* 7.16. Boolean type and values */
-
-/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
- definitions below, but temporarily we have to #undef them. */
-#if defined __BEOS__ && !defined __HAIKU__
-# include <OS.h> /* defines bool but not _Bool */
-# undef false
-# undef true
-#endif
-
-#ifdef __cplusplus
-# define _Bool bool
-# define bool bool
-#else
-# if defined __BEOS__ && !defined __HAIKU__
- /* A compiler known to have 'bool'. */
- /* If the compiler already has both 'bool' and '_Bool', we can assume they
- are the same types. */
-# if !@HAVE__BOOL@
-typedef bool _Bool;
-# endif
-# else
-# if !defined __GNUC__
- /* If @HAVE__BOOL@:
- Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
- the built-in _Bool type is used. See
- https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
- https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
- Similar bugs are likely with other compilers as well; this file
- wouldn't be used if <stdbool.h> was working.
- So we override the _Bool type.
- If !@HAVE__BOOL@:
- Need to define _Bool ourselves. As 'signed char' or as an enum type?
- Use of a typedef, with SunPRO C, leads to a stupid
- "warning: _Bool is a keyword in ISO C99".
- Use of an enum type, with IRIX cc, leads to a stupid
- "warning(1185): enumerated type mixed with another type".
- Even the existence of an enum type, without a typedef,
- "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
- The only benefit of the enum, debuggability, is not important
- with these compilers. So use 'signed char' and no enum. */
-# define _Bool signed char
-# else
- /* With this compiler, trust the _Bool type if the compiler has it. */
-# if !@HAVE__BOOL@
- /* For the sake of symbolic names in gdb, define true and false as
- enum constants, not only as macros.
- It is tempting to write
- typedef enum { false = 0, true = 1 } _Bool;
- so that gdb prints values of type 'bool' symbolically. But then
- values of type '_Bool' might promote to 'int' or 'unsigned int'
- (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
- (see ISO C 99 6.3.1.1.(2)). So add a negative value to the
- enum; this ensures that '_Bool' promotes to 'int'. */
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-# endif
-# endif
-# endif
-# define bool _Bool
-#endif
-
-/* The other macros must be usable in preprocessor directives. */
-#ifdef __cplusplus
-# define false false
-# define true true
-#else
-# define false 0
-# define true 1
-#endif
-
-#define __bool_true_false_are_defined 1
-
-#endif /* _GL_STDBOOL_H */
diff --git a/gl/lib/stdckdint.in.h b/gl/lib/stdckdint.in.h
new file mode 100644
index 00000000..71bab5f0
--- /dev/null
+++ b/gl/lib/stdckdint.in.h
@@ -0,0 +1,35 @@
+/* stdckdint.h -- checked integer arithmetic
+
+ Copyright 2022-2023 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 the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program 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 _GL_STDCKDINT_H
+#define _GL_STDCKDINT_H
+
+#include "intprops-internal.h"
+
+/* Store into *R the low-order bits of A + B, A - B, A * B, respectively.
+ Return 1 if the result overflows, 0 otherwise.
+ A, B, and *R can have any integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+
+ These are like the standard macros introduced in C23, except that
+ arguments should not have side effects. */
+
+#define ckd_add(r, a, b) ((bool) _GL_INT_ADD_WRAPV (a, b, r))
+#define ckd_sub(r, a, b) ((bool) _GL_INT_SUBTRACT_WRAPV (a, b, r))
+#define ckd_mul(r, a, b) ((bool) _GL_INT_MULTIPLY_WRAPV (a, b, r))
+
+#endif /* _GL_STDCKDINT_H */
diff --git a/gl/lib/stddef.in.h b/gl/lib/stddef.in.h
index 5c9a747d..431e819b 100644
--- a/gl/lib/stddef.in.h
+++ b/gl/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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,7 +18,7 @@
/* Written by Eric Blake. */
/*
- * POSIX 2008 <stddef.h> for platforms that have issues.
+ * POSIX 2008 and ISO C 23 <stddef.h> for platforms that have issues.
* <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
*/
@@ -37,9 +37,9 @@
remember if special invocation has ever been used to obtain wint_t,
in which case we need to clean up NULL yet again. */
-# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _@GUARD_PREFIX@_STDDEF_WINT_T)
# ifdef __need_wint_t
-# define _GL_STDDEF_WINT_T
+# define _@GUARD_PREFIX@_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
/* On TinyCC, make sure that the macros that indicate the special invocation
@@ -69,6 +69,7 @@ typedef long rpl_max_align_t;
typedef long max_align_t;
# define _MAX_ALIGN_T
# endif
+# define __CLANG_MAX_ALIGN_T_DEFINED
# define GNULIB_defined_max_align_t 1
# endif
# endif
@@ -79,7 +80,7 @@ typedef long max_align_t;
/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
# if (@REPLACE_NULL@ \
- && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
+ && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _@GUARD_PREFIX@_STDDEF_WINT_T))
# undef NULL
# ifdef __cplusplus
/* ISO C++ says that the macro NULL must expand to an integer constant
@@ -100,6 +101,11 @@ typedef long max_align_t;
# ifndef _@GUARD_PREFIX@_STDDEF_H
# define _@GUARD_PREFIX@_STDDEF_H
+/* This file uses _Noreturn. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Some platforms lack wchar_t. */
#if !@HAVE_WCHAR_T@
# define wchar_t int
@@ -137,11 +143,49 @@ typedef union
long int __i _GL_STDDEF_ALIGNAS (long int);
} rpl_max_align_t;
# define max_align_t rpl_max_align_t
+# define __CLANG_MAX_ALIGN_T_DEFINED
# define GNULIB_defined_max_align_t 1
# endif
# endif
#endif
+/* ISO C 23 § 7.21.1 The unreachable macro */
+#ifndef unreachable
+
+/* Code borrowed from verify.h. */
+# ifndef _GL_HAS_BUILTIN_UNREACHABLE
+# if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+# elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+# else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+# endif
+# endif
+
+# if _GL_HAS_BUILTIN_UNREACHABLE
+# define unreachable() __builtin_unreachable ()
+# elif 1200 <= _MSC_VER
+# define unreachable() __assume (0)
+# else
+/* Declare abort(), without including <stdlib.h>. */
+extern
+# if defined __cplusplus
+"C"
+# endif
+_Noreturn
+void abort (void)
+# if defined __cplusplus && (__GLIBC__ >= 2)
+throw ()
+# endif
+;
+# define unreachable() abort ()
+# endif
+
+#endif
+
# endif /* _@GUARD_PREFIX@_STDDEF_H */
# endif /* _@GUARD_PREFIX@_STDDEF_H */
#endif /* __need_XXX */
diff --git a/gl/lib/stdint.in.h b/gl/lib/stdint.in.h
index eaa7874f..5ddc644b 100644
--- a/gl/lib/stdint.in.h
+++ b/gl/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2023 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
diff --git a/gl/lib/stdio-read.c b/gl/lib/stdio-read.c
index 85efa0d4..6e2984c5 100644
--- a/gl/lib/stdio-read.c
+++ b/gl/lib/stdio-read.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream read function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/stdio-write.c b/gl/lib/stdio-write.c
index 82facf54..9cf36cca 100644
--- a/gl/lib/stdio-write.c
+++ b/gl/lib/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/stdio.in.h b/gl/lib/stdio.in.h
index 7b36dac2..6be12c05 100644
--- a/gl/lib/stdio.in.h
+++ b/gl/lib/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2023 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
@@ -36,6 +36,12 @@
#ifndef _@GUARD_PREFIX@_STDIO_H
+/* 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
+#endif
+
#define _GL_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */
@@ -43,9 +49,20 @@
#undef _GL_ALREADY_INCLUDING_STDIO_H
+#ifdef _GL_DEFINED__POSIX_C_SOURCE
+# undef _GL_DEFINED__POSIX_C_SOURCE
+# undef _POSIX_C_SOURCE
+#endif
+
#ifndef _@GUARD_PREFIX@_STDIO_H
#define _@GUARD_PREFIX@_STDIO_H
+/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT,
+ _GL_ATTRIBUTE_MALLOC, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get va_list. Needed on many systems, including glibc 2.8. */
#include <stdarg.h>
@@ -116,6 +133,16 @@
# endif
#endif
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
/* An __attribute__ __format__ specifier for a function that takes a format
string and arguments, where the format string directives are the ones
standardized by ISO C99 and POSIX.
@@ -193,6 +220,36 @@
# undef putc_unlocked
#endif
+
+/* Maximum number of characters produced by printing a NaN value. */
+#ifndef _PRINTF_NAN_LEN_MAX
+# if defined __FreeBSD__ || defined __DragonFly__ \
+ || defined __NetBSD__ \
+ || (defined __APPLE__ && defined __MACH__)
+/* On BSD systems, a NaN value prints as just "nan", without a sign. */
+# define _PRINTF_NAN_LEN_MAX 3
+# elif (__GLIBC__ >= 2) || MUSL_LIBC || defined __OpenBSD__ || defined __sun || defined __CYGWIN__
+/* glibc, musl libc, OpenBSD, Solaris libc, and Cygwin produce "[-]nan". */
+# define _PRINTF_NAN_LEN_MAX 4
+# elif defined _AIX
+/* AIX produces "[-]NaNQ". */
+# define _PRINTF_NAN_LEN_MAX 5
+# elif defined _WIN32 && !defined __CYGWIN__
+/* On native Windows, the output can be:
+ - with MSVC ucrt: "[-]nan" or "[-]nan(ind)" or "[-]nan(snan)",
+ - with mingw: "[-]1.#IND" or "[-]1.#QNAN". */
+# define _PRINTF_NAN_LEN_MAX 10
+# elif defined __sgi
+/* On IRIX, the output typically is "[-]nan0xNNNNNNNN" with 8 hexadecimal
+ digits. */
+# define _PRINTF_NAN_LEN_MAX 14
+# else
+/* We don't know, but 32 should be a safe maximum. */
+# define _PRINTF_NAN_LEN_MAX 32
+# endif
+#endif
+
+
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -210,7 +267,9 @@ _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
# endif
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (dprintf);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef dprintf
# if HAVE_RAW_DECL_DPRINTF
@@ -273,7 +332,8 @@ _GL_CXXALIASWARN (fcloseall);
# endif
_GL_FUNCDECL_RPL (fdopen, FILE *,
(int fd, const char *mode)
- _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -286,7 +346,8 @@ _GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode)
- _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
# endif
@@ -296,7 +357,8 @@ _GL_CXXALIASWARN (fdopen);
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode)
- _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
# if defined GNULIB_POSIXCHECK
# undef fdopen
@@ -407,7 +469,8 @@ _GL_CXXALIASWARN (fileno);
# endif
_GL_FUNCDECL_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
_GL_CXXALIAS_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode));
# else
@@ -882,7 +945,9 @@ _GL_CXXALIAS_SYS (getdelim, ssize_t,
int delimiter,
FILE *restrict stream));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdelim);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getdelim
# if HAVE_RAW_DECL_GETDELIM
@@ -921,7 +986,7 @@ _GL_CXXALIAS_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream));
# endif
-# if @HAVE_DECL_GETLINE@
+# if __GLIBC__ >= 2 && @HAVE_DECL_GETLINE@
_GL_CXXALIASWARN (getline);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -951,9 +1016,17 @@ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
# endif
_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
# else
+# if @HAVE_DECL_GETW@
+# if defined __APPLE__ && defined __MACH__
+/* The presence of the declaration depends on _POSIX_C_SOURCE. */
+_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream));
+# endif
_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getw);
+# endif
#endif
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
@@ -1052,13 +1125,15 @@ _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
# endif
_GL_FUNCDECL_RPL (popen, FILE *,
(const char *cmd, const char *mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
# else
# if !@HAVE_POPEN@ || __GNUC__ >= 11
_GL_FUNCDECL_SYS (popen, FILE *,
(const char *cmd, const char *mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
# endif
@@ -1068,7 +1143,8 @@ _GL_CXXALIASWARN (popen);
/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
_GL_FUNCDECL_SYS (popen, FILE *,
(const char *cmd, const char *mode)
- _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
# if defined GNULIB_POSIXCHECK
# undef popen
@@ -1190,9 +1266,17 @@ _GL_CXXALIASWARN (puts);
# endif
_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
# else
+# if @HAVE_DECL_PUTW@
+# if defined __APPLE__ && defined __MACH__
+/* The presence of the declaration depends on _POSIX_C_SOURCE. */
+_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (putw);
+# endif
#endif
#if @GNULIB_REMOVE@
@@ -1398,13 +1482,15 @@ _GL_CXXALIASWARN (tempnam);
# define tmpfile rpl_tmpfile
# endif
_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
- _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
# else
# if __GNUC__ >= 11
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
- _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
# endif
@@ -1415,7 +1501,8 @@ _GL_CXXALIASWARN (tmpfile);
# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
- _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1)
+ _GL_ATTRIBUTE_MALLOC);
# endif
# if defined GNULIB_POSIXCHECK
# undef tmpfile
diff --git a/gl/lib/stdlib.in.h b/gl/lib/stdlib.in.h
index a86643c3..1479a2b2 100644
--- a/gl/lib/stdlib.in.h
+++ b/gl/lib/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2023 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
@@ -37,6 +37,12 @@
#ifndef _@GUARD_PREFIX@_STDLIB_H
#define _@GUARD_PREFIX@_STDLIB_H
+/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
+ _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
@@ -67,9 +73,7 @@
# include <random.h>
# endif
-# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
-# include <stdint.h>
-# endif
+# include <stdint.h>
# if !@HAVE_STRUCT_RANDOM_DATA@
/* Define 'struct random_data'.
@@ -164,11 +168,22 @@ struct random_data
#if @GNULIB__EXIT@
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
-# if !@HAVE__EXIT@
+# if @REPLACE__EXIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef _Exit
+# define _Exit rpl__Exit
+# endif
+_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status));
+_GL_CXXALIAS_RPL (_Exit, void, (int status));
+# else
+# if !@HAVE__EXIT@
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
-# endif
+# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (_Exit);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef _Exit
# if HAVE_RAW_DECL__EXIT
@@ -226,7 +241,7 @@ _GL_FUNCDECL_SYS (aligned_alloc, void *,
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
# endif
# endif
-# if @HAVE_ALIGNED_ALLOC@
+# if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
_GL_CXXALIASWARN (aligned_alloc);
# endif
#else
@@ -416,12 +431,24 @@ _GL_CXXALIASWARN (gcvt);
The three numbers are the load average of the last 1 minute, the last 5
minutes, and the last 15 minutes, respectively.
LOADAVG is an array of NELEM numbers. */
-# if !@HAVE_DECL_GETLOADAVG@
+# if @REPLACE_GETLOADAVG@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getloadavg
+# define getloadavg rpl_getloadavg
+# endif
+_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_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getloadavg);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getloadavg
# if HAVE_RAW_DECL_GETLOADAVG
@@ -430,6 +457,41 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# endif
#endif
+#if @GNULIB_GETPROGNAME@
+/* Return the base name of the executing program.
+ On native Windows this will usually end in ".exe" or ".EXE". */
+# if @REPLACE_GETPROGNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getprogname
+# define getprogname rpl_getprogname
+# endif
+# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
+_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+# else
+_GL_FUNCDECL_RPL (getprogname, const char *, (void));
+# endif
+_GL_CXXALIAS_RPL (getprogname, const char *, (void));
+# else
+# if !@HAVE_GETPROGNAME@
+# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
+_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+# else
+_GL_FUNCDECL_SYS (getprogname, const char *, (void));
+# endif
+# endif
+_GL_CXXALIAS_SYS (getprogname, const char *, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getprogname);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getprogname
+# if HAVE_RAW_DECL_GETPROGNAME
+_GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
+ "use gnulib module getprogname for portability");
+# endif
+#endif
+
#if @GNULIB_GETSUBOPT@
/* Assuming *OPTIONP is a comma separated list of elements of the form
"token" or "token=value", getsubopt parses the first of these elements.
@@ -442,14 +504,28 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
For more details see the POSIX specification.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
-# if !@HAVE_GETSUBOPT@
+# if @REPLACE_GETSUBOPT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getsubopt
+# define getsubopt rpl_getsubopt
+# endif
+_GL_FUNCDECL_RPL (getsubopt, int,
+ (char **optionp, char *const *tokens, char **valuep)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_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)));
-# endif
+# endif
_GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getsubopt);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getsubopt
# if HAVE_RAW_DECL_GETSUBOPT
@@ -517,6 +593,51 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
# endif
#endif
+/* Return maximum number of bytes of a multibyte character. */
+#if @REPLACE_MB_CUR_MAX@
+# if !GNULIB_defined_MB_CUR_MAX
+static inline
+int gl_MB_CUR_MAX (void)
+{
+ /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
+ return MB_CUR_MAX + (MB_CUR_MAX == 3);
+}
+# undef MB_CUR_MAX
+# define MB_CUR_MAX gl_MB_CUR_MAX ()
+# define GNULIB_defined_MB_CUR_MAX 1
+# endif
+#endif
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSTOWCS@
+# if @REPLACE_MBSTOWCS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbstowcs
+# define mbstowcs rpl_mbstowcs
+# endif
+_GL_FUNCDECL_RPL (mbstowcs, size_t,
+ (wchar_t *restrict dest, const char *restrict src,
+ size_t len)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbstowcs, size_t,
+ (wchar_t *restrict dest, const char *restrict src,
+ size_t len));
+# else
+_GL_CXXALIAS_SYS (mbstowcs, size_t,
+ (wchar_t *restrict dest, const char *restrict src,
+ size_t len));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbstowcs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbstowcs
+# if HAVE_RAW_DECL_MBSTOWCS
+_GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
+ "use gnulib module mbstowcs for portability");
+# endif
+#endif
+
/* Convert a multibyte character to a wide character. */
#if @GNULIB_MBTOWC@
# if @REPLACE_MBTOWC@
@@ -579,12 +700,24 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
implementation.
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
-# if !@HAVE_MKOSTEMP@
+# if @REPLACE_MKOSTEMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkostemp
+# define mkostemp rpl_mkostemp
+# endif
+_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+_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)));
-# endif
+# endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkostemp);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkostemp
# if HAVE_RAW_DECL_MKOSTEMP
@@ -607,14 +740,28 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
implementation.
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
-# if !@HAVE_MKOSTEMPS@
+# if @REPLACE_MKOSTEMPS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkostemps
+# define mkostemps rpl_mkostemps
+# endif
+_GL_FUNCDECL_RPL (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+_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)));
-# endif
+# endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkostemps);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkostemps
# if HAVE_RAW_DECL_MKOSTEMPS
@@ -713,7 +860,7 @@ _GL_CXXALIAS_SYS (posix_memalign, int,
(void **memptr, size_t alignment, size_t size));
# endif
# endif
-# if @HAVE_POSIX_MEMALIGN@
+# if __GLIBC__ >= 2 && @HAVE_POSIX_MEMALIGN@
_GL_CXXALIASWARN (posix_memalign);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -727,11 +874,22 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
#if @GNULIB_POSIX_OPENPT@
/* Return an FD open to the master side of a pseudo-terminal. Flags should
include O_RDWR, and may also include O_NOCTTY. */
-# if !@HAVE_POSIX_OPENPT@
+# if @REPLACE_POSIX_OPENPT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef posix_openpt
+# define posix_openpt rpl_posix_openpt
+# endif
+_GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
+_GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
+# else
+# if !@HAVE_POSIX_OPENPT@
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
-# endif
+# endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (posix_openpt);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef posix_openpt
# if HAVE_RAW_DECL_POSIX_OPENPT
@@ -900,7 +1058,9 @@ _GL_FUNCDECL_SYS (random, long, (void));
int. */
_GL_CXXALIAS_SYS_CAST (random, long, (void));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (random);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef random
# if HAVE_RAW_DECL_RANDOM
@@ -925,7 +1085,9 @@ _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
unsigned long seed. */
_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (srandom);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef srandom
# if HAVE_RAW_DECL_SRANDOM
@@ -956,7 +1118,9 @@ _GL_FUNCDECL_SYS (initstate, char *,
_GL_CXXALIAS_SYS_CAST (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (initstate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef initstate
# if HAVE_RAW_DECL_INITSTATE
@@ -981,7 +1145,9 @@ _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
is const char *arg_state. */
_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (setstate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef setstate
# if HAVE_RAW_DECL_SETSTATE
@@ -1167,7 +1333,9 @@ _GL_FUNCDECL_SYS (reallocarray, void *,
_GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (reallocarray);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef reallocarray
# if HAVE_RAW_DECL_REALLOCARRAY
@@ -1363,7 +1531,9 @@ _GL_CXXALIAS_SYS (strtol, long,
(const char *restrict string, char **restrict endptr,
int base));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (strtol);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef strtol
# if HAVE_RAW_DECL_STRTOL
@@ -1444,7 +1614,9 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
int base));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (strtoul);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef strtoul
# if HAVE_RAW_DECL_STRTOUL
diff --git a/gl/lib/stdopen.c b/gl/lib/stdopen.c
index 841e410a..e9a8e49d 100644
--- a/gl/lib/stdopen.c
+++ b/gl/lib/stdopen.c
@@ -1,6 +1,6 @@
/* stdopen.c - ensure that the three standard file descriptors are in use
- Copyright (C) 2005-2006, 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2019-2023 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/gl/lib/stdopen.h b/gl/lib/stdopen.h
index 6a9d83c6..c6111fab 100644
--- a/gl/lib/stdopen.h
+++ b/gl/lib/stdopen.h
@@ -1,5 +1,5 @@
/* Arrange for stdin/stdout/stderr to be open.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/stpcpy.c b/gl/lib/stpcpy.c
index 434f84ae..73c1eb78 100644
--- a/gl/lib/stpcpy.c
+++ b/gl/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-2022 Free Software
+ Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2023 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
diff --git a/gl/lib/str-two-way.h b/gl/lib/str-two-way.h
index b00017c0..dfe70224 100644
--- a/gl/lib/str-two-way.h
+++ b/gl/lib/str-two-way.h
@@ -1,5 +1,5 @@
/* Byte-wise substring search, using the Two-Way algorithm.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake <ebb9@byu.net>, 2008.
diff --git a/gl/lib/strcasecmp.c b/gl/lib/strcasecmp.c
index a85a2b10..3a5ce3e1 100644
--- a/gl/lib/strcasecmp.c
+++ b/gl/lib/strcasecmp.c
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison function.
- Copyright (C) 1998-1999, 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2023 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/gl/lib/strcasestr.c b/gl/lib/strcasestr.c
index b36f4091..8eea435c 100644
--- a/gl/lib/strcasestr.c
+++ b/gl/lib/strcasestr.c
@@ -1,5 +1,5 @@
/* Case-insensitive searching in a string.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This file is free software: you can redistribute it and/or modify
@@ -21,7 +21,6 @@
#include <string.h>
#include <ctype.h>
-#include <stdbool.h>
#include <strings.h>
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
diff --git a/gl/lib/strchrnul.c b/gl/lib/strchrnul.c
index 2141b3e1..8724427b 100644
--- a/gl/lib/strchrnul.c
+++ b/gl/lib/strchrnul.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007-2023 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/gl/lib/strchrnul.valgrind b/gl/lib/strchrnul.valgrind
index 1cf50ec8..d998366e 100644
--- a/gl/lib/strchrnul.valgrind
+++ b/gl/lib/strchrnul.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in strchrnul().
-# Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2008-2023 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/gl/lib/strdup.c b/gl/lib/strdup.c
index 2a0df023..08c40d57 100644
--- a/gl/lib/strdup.c
+++ b/gl/lib/strdup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2022 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gl/lib/streq.h b/gl/lib/streq.h
index 49f73c1b..712948eb 100644
--- a/gl/lib/streq.h
+++ b/gl/lib/streq.h
@@ -1,5 +1,5 @@
/* Optimized string comparison.
- Copyright (C) 2001-2002, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2023 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/gl/lib/strerror-override.c b/gl/lib/strerror-override.c
index 6be1afdc..cddaa4a9 100644
--- a/gl/lib/strerror-override.c
+++ b/gl/lib/strerror-override.c
@@ -1,6 +1,6 @@
/* strerror-override.c --- POSIX compatible system error routine
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 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/gl/lib/strerror-override.h b/gl/lib/strerror-override.h
index d010d27c..c9b3ba8c 100644
--- a/gl/lib/strerror-override.h
+++ b/gl/lib/strerror-override.h
@@ -1,6 +1,6 @@
/* strerror-override.h --- POSIX compatible system error routine
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 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,6 +18,11 @@
#ifndef _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
+
# include <errno.h>
# include <stddef.h>
diff --git a/gl/lib/strerror.c b/gl/lib/strerror.c
index 67c5216e..d754f601 100644
--- a/gl/lib/strerror.c
+++ b/gl/lib/strerror.c
@@ -1,6 +1,6 @@
/* strerror.c --- POSIX compatible system error routine
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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,6 @@
#include "intprops.h"
#include "strerror-override.h"
-#include "verify.h"
/* Use the system functions, not the gnulib overrides in this file. */
#undef sprintf
@@ -55,7 +54,7 @@ strerror (int n)
if (!msg || !*msg)
{
static char const fmt[] = "Unknown error %d";
- verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+ static_assert (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
sprintf (buf, fmt, n);
errno = EINVAL;
return buf;
diff --git a/gl/lib/string.in.h b/gl/lib/string.in.h
index 3996da9f..912d0f7a 100644
--- a/gl/lib/string.in.h
+++ b/gl/lib/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2023 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,12 @@
#ifndef _@GUARD_PREFIX@_STRING_H
#define _@GUARD_PREFIX@_STRING_H
+/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
+ _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
@@ -59,10 +65,11 @@
# include <unistd.h>
#endif
-/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */
+/* AIX 7.2 and Android 13 declare ffsl and ffsll in <strings.h>, not in
+ <string.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
- && defined _AIX) \
+ && (defined _AIX || defined __ANDROID__)) \
&& ! defined __GLIBC__
# include <strings.h>
#endif
@@ -82,7 +89,14 @@
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
@@ -118,7 +132,11 @@
# if (@REPLACE_FREE@ && !defined free \
&& !(defined __cplusplus && defined GNULIB_NAMESPACE))
/* We can't do '#define free rpl_free' here. */
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void rpl_free (void *) throw ();
+# else
_GL_EXTERN_C void rpl_free (void *);
+# endif
# undef _GL_ATTRIBUTE_DEALLOC_FREE
# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
# else
@@ -300,16 +318,32 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
last written byte. */
#if @GNULIB_MEMPCPY@
-# if ! @HAVE_MEMPCPY@
+# if @REPLACE_MEMPCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mempcpy
+# define mempcpy rpl_mempcpy
+# endif
+_GL_FUNCDECL_RPL (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n));
+# else
+# if !@HAVE_MEMPCPY@
_GL_FUNCDECL_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
size_t __n)
_GL_ARG_NONNULL ((1, 2)));
-# endif
+# endif
_GL_CXXALIAS_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
size_t __n));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mempcpy);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mempcpy
# if HAVE_RAW_DECL_MEMPCPY
@@ -336,7 +370,7 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr,
|| defined __clang__)
_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (memrchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -347,6 +381,23 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
# endif
#endif
+/* 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@
+_GL_FUNCDECL_SYS (memset_explicit, void *,
+ (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));
+_GL_CXXALIASWARN (memset_explicit);
+#elif defined GNULIB_POSIXCHECK
+# undef memset_explicit
+# if HAVE_RAW_DECL_MEMSET_EXPLICIT
+_GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - "
+ "use gnulib module memset_explicit for portability");
+# endif
+#endif
+
/* Find the first occurrence of C in S. More efficient than
memchr(S,C,N), at the expense of undefined behavior if C does not
occur within N bytes. */
@@ -381,14 +432,28 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
#if @GNULIB_STPCPY@
-# if ! @HAVE_STPCPY@
+# if @REPLACE_STPCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpcpy
+# define stpcpy rpl_stpcpy
+# endif
+_GL_FUNCDECL_RPL (stpcpy, char *,
+ (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)
_GL_ARG_NONNULL ((1, 2)));
-# endif
+# endif
_GL_CXXALIAS_SYS (stpcpy, char *,
(char *restrict __dst, char const *restrict __src));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (stpcpy);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef stpcpy
# if HAVE_RAW_DECL_STPCPY
@@ -423,7 +488,9 @@ _GL_CXXALIAS_SYS (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
size_t __n));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (stpncpy);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef stpncpy
# if HAVE_RAW_DECL_STPNCPY
@@ -474,7 +541,7 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul,
_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
_GL_CXXALIASWARN1 (strchrnul, char const *,
(char const *__s, int __c_in) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strchrnul);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -839,7 +906,7 @@ _GL_CXXALIASWARN1 (strcasestr, char *,
(char *haystack, const char *needle) throw ());
_GL_CXXALIASWARN1 (strcasestr, const char *,
(const char *haystack, const char *needle) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strcasestr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -943,7 +1010,9 @@ _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mbslen);
+# endif
#endif
#if @GNULIB_MBSNLEN@
@@ -1185,7 +1254,7 @@ _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
# endif
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
# endif
-# if @HAVE_DECL_STRERROR_R@
+# if __GLIBC__ >= 2 && @HAVE_DECL_STRERROR_R@
_GL_CXXALIASWARN (strerror_r);
# endif
#elif defined GNULIB_POSIXCHECK
diff --git a/gl/lib/strings.in.h b/gl/lib/strings.in.h
index 2c31d2e1..929329d0 100644
--- a/gl/lib/strings.in.h
+++ b/gl/lib/strings.in.h
@@ -1,6 +1,6 @@
/* A substitute <strings.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -36,6 +36,11 @@
#ifndef _@GUARD_PREFIX@_STRINGS_H
#define _@GUARD_PREFIX@_STRINGS_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if ! @HAVE_DECL_STRNCASECMP@
/* Get size_t. */
# include <stddef.h>
diff --git a/gl/lib/stripslash.c b/gl/lib/stripslash.c
index aee89b78..fe46a9c1 100644
--- a/gl/lib/stripslash.c
+++ b/gl/lib/stripslash.c
@@ -1,6 +1,6 @@
/* stripslash.c -- remove redundant trailing slashes from a file name
- Copyright (C) 1990, 2001, 2003-2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/strncasecmp.c b/gl/lib/strncasecmp.c
index 35d215b9..c5c2cd35 100644
--- a/gl/lib/strncasecmp.c
+++ b/gl/lib/strncasecmp.c
@@ -1,5 +1,5 @@
/* strncasecmp.c -- case insensitive string comparator
- Copyright (C) 1998-1999, 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2023 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/gl/lib/strndup.c b/gl/lib/strndup.c
index 72cbc57d..5c1f32ff 100644
--- a/gl/lib/strndup.c
+++ b/gl/lib/strndup.c
@@ -1,6 +1,6 @@
/* A replacement function, for systems that lack strndup.
- Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2022 Free Software
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/strnlen.c b/gl/lib/strnlen.c
index c8fc69c6..09c010ea 100644
--- a/gl/lib/strnlen.c
+++ b/gl/lib/strnlen.c
@@ -1,5 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/strnlen1.c b/gl/lib/strnlen1.c
index c22f96b6..25866c5e 100644
--- a/gl/lib/strnlen1.c
+++ b/gl/lib/strnlen1.c
@@ -1,5 +1,5 @@
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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/gl/lib/strnlen1.h b/gl/lib/strnlen1.h
index d45dd91e..02dcd4c4 100644
--- a/gl/lib/strnlen1.h
+++ b/gl/lib/strnlen1.h
@@ -1,5 +1,5 @@
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2023 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
@@ -17,6 +17,11 @@
#ifndef _STRNLEN1_H
#define _STRNLEN1_H
+/* This file uses _GL_ATTRIBUTE_PURE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
diff --git a/gl/lib/strsep.c b/gl/lib/strsep.c
index c05d7ebe..8e9708a3 100644
--- a/gl/lib/strsep.c
+++ b/gl/lib/strsep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2007, 2009-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007, 2009-2023 Free Software Foundation, Inc.
Written by Yoann Vandoorselaere <yoann@prelude-ids.org>.
diff --git a/gl/lib/sys_file.in.h b/gl/lib/sys_file.in.h
index 1ae54f85..3919e576 100644
--- a/gl/lib/sys_file.in.h
+++ b/gl/lib/sys_file.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/file.h.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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,13 +32,18 @@
#ifndef _@GUARD_PREFIX@_SYS_FILE_H
#define _@GUARD_PREFIX@_SYS_FILE_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#ifndef LOCK_SH
/* Operations for the 'flock' call (same as Linux kernel constants). */
# define LOCK_SH 1 /* Shared lock. */
# define LOCK_EX 2 /* Exclusive lock. */
# define LOCK_UN 8 /* Unlock. */
-/* Can be OR'd in to one of the above. */
+/* Can be OR'd into one of the above. */
# define LOCK_NB 4 /* Don't block when locking. */
#endif
diff --git a/gl/lib/sys_ioctl.in.h b/gl/lib/sys_ioctl.in.h
index 7f1cdc86..78a79036 100644
--- a/gl/lib/sys_ioctl.in.h
+++ b/gl/lib/sys_ioctl.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <sys/ioctl.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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,11 @@
#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
#define _@GUARD_PREFIX@_SYS_IOCTL_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
but not in <sys/ioctl.h>.
Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
@@ -62,7 +67,9 @@ _GL_FUNCDECL_SYS (ioctl, int,
_GL_CXXALIAS_SYS (ioctl, int,
(int fd, int request, ... /* {void *,char *} arg */));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ioctl);
+# endif
#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
# undef ioctl
# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
diff --git a/gl/lib/sys_random.in.h b/gl/lib/sys_random.in.h
index e730e613..b240033b 100644
--- a/gl/lib/sys_random.in.h
+++ b/gl/lib/sys_random.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/random.h>.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 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,6 +45,11 @@
#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
#define _@GUARD_PREFIX@_SYS_RANDOM_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <sys/types.h>
/* Define the GRND_* constants. */
@@ -84,7 +89,9 @@ _GL_FUNCDECL_SYS (getrandom, ssize_t,
_GL_CXXALIAS_SYS (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags));
# endif
+# if __GLIBC__ + (__GLIBC_MINOR__ >= 25) > 2
_GL_CXXALIASWARN (getrandom);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getrandom
# if HAVE_RAW_DECL_GETRANDOM
diff --git a/gl/lib/sys_select.in.h b/gl/lib/sys_select.in.h
index 2bd0e0f7..3abfc48a 100644
--- a/gl/lib/sys_select.in.h
+++ b/gl/lib/sys_select.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/select.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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,13 @@
# 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
+
/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
both include <sys/select.h>.
On Cygwin and OpenBSD, <sys/time.h> includes <sys/select.h>.
@@ -71,6 +78,11 @@
#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* On many platforms, <sys/select.h> assumes prior inclusion of
<sys/types.h>. Also, mingw defines sigset_t there, instead of
in <signal.h> where it belongs. */
@@ -82,9 +94,10 @@
of 'struct timeval', and no definition of this type.
Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
in <sys/time.h>.
- But avoid namespace pollution on glibc systems and "unknown type
- name" problems on Cygwin. */
-# if !(defined __GLIBC__ || defined __CYGWIN__)
+ But avoid namespace pollution on glibc systems, a circular include
+ <sys/select.h> -> <sys/time.h> -> <sys/select.h> on FreeBSD 13.1, and
+ "unknown type name" problems on Cygwin. */
+# if !(defined __GLIBC__ || defined __FreeBSD__ || defined __CYGWIN__)
# include <sys/time.h>
# endif
@@ -287,7 +300,9 @@ _GL_CXXALIAS_SYS_CAST (pselect, int,
struct timespec const *restrict,
const sigset_t *restrict));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (pselect);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef pselect
# if HAVE_RAW_DECL_PSELECT
diff --git a/gl/lib/sys_socket.c b/gl/lib/sys_socket.c
index 0bfd60f2..b7388cec 100644
--- a/gl/lib/sys_socket.c
+++ b/gl/lib/sys_socket.c
@@ -1,6 +1,6 @@
/* Inline functions for <sys/socket.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/sys_socket.in.h b/gl/lib/sys_socket.in.h
index acdf7eee..afeedf07 100644
--- a/gl/lib/sys_socket.in.h
+++ b/gl/lib/sys_socket.in.h
@@ -1,6 +1,6 @@
/* Provide a sys/socket header file for systems lacking it (read: MinGW)
and for systems where it is incomplete.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
@@ -63,9 +63,12 @@
#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
#define _@GUARD_PREFIX@_SYS_SOCKET_H
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
+ HAVE_RAW_DECL_*, alignof. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_SYS_SOCKET_INLINE
# define _GL_SYS_SOCKET_INLINE _GL_INLINE
@@ -97,7 +100,6 @@ typedef unsigned char sa_family_t;
# endif
# endif
#else
-# include <stdalign.h>
/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
# define __ss_aligntype unsigned long int
diff --git a/gl/lib/sys_stat.in.h b/gl/lib/sys_stat.in.h
index 714c3cb1..ad4da17f 100644
--- a/gl/lib/sys_stat.in.h
+++ b/gl/lib/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat.h header file.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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,13 @@
#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
+
#if defined __need_system_sys_stat_h
/* Special invocation convention. */
@@ -48,6 +55,11 @@
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
#define _@GUARD_PREFIX@_SYS_STAT_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
@@ -549,7 +561,7 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
-# if @HAVE_FUTIMENS@
+# if __GLIBC__ >= 2 && @HAVE_FUTIMENS@
_GL_CXXALIASWARN (futimens);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -596,44 +608,6 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
#endif
-#if @GNULIB_LSTAT@
-# if ! @HAVE_LSTAT@
-/* mingw does not support symlinks, therefore it does not have lstat. But
- without links, stat does just fine. */
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define lstat stat
-# endif
-_GL_CXXALIAS_RPL_1 (lstat, stat, int,
- (const char *restrict name, struct stat *restrict buf));
-# elif @REPLACE_LSTAT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef lstat
-# define lstat rpl_lstat
-# endif
-_GL_FUNCDECL_RPL (lstat, int,
- (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));
-# else
-_GL_CXXALIAS_SYS (lstat, int,
- (const char *restrict name, struct stat *restrict buf));
-# endif
-# if @HAVE_LSTAT@
-_GL_CXXALIASWARN (lstat);
-# endif
-#elif @GNULIB_OVERRIDES_STRUCT_STAT@
-# undef lstat
-# define lstat lstat_used_without_requesting_gnulib_module_lstat
-#elif defined GNULIB_POSIXCHECK
-# undef lstat
-# if HAVE_RAW_DECL_LSTAT
-_GL_WARN_ON_USE (lstat, "lstat is unportable - "
- "use gnulib module lstat for portability");
-# endif
-#endif
-
-
#if @GNULIB_MKDIR@
# if @REPLACE_MKDIR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -754,7 +728,9 @@ _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
# endif
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkfifoat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkfifoat
# if HAVE_RAW_DECL_MKFIFOAT
@@ -811,7 +787,9 @@ _GL_FUNCDECL_SYS (mknodat, int,
_GL_CXXALIAS_SYS (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mknodat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mknodat
# if HAVE_RAW_DECL_MKNODAT
@@ -895,6 +873,44 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
#endif
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
+/* mingw does not support symlinks, therefore it does not have lstat. But
+ without links, stat does just fine. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lstat stat
+# endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# elif @REPLACE_LSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lstat
+# define lstat rpl_lstat
+# endif
+_GL_FUNCDECL_RPL (lstat, int,
+ (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));
+# else
+_GL_CXXALIAS_SYS (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+ "use gnulib module lstat for portability");
+# endif
+#endif
+
+
#if @GNULIB_MDA_UMASK@
/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
@@ -937,7 +953,7 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# endif
-# if @HAVE_UTIMENSAT@
+# if __GLIBC__ >= 2 && @HAVE_UTIMENSAT@
_GL_CXXALIASWARN (utimensat);
# endif
#elif defined GNULIB_POSIXCHECK
diff --git a/gl/lib/sys_time.in.h b/gl/lib/sys_time.in.h
index 87db1a88..59cce144 100644
--- a/gl/lib/sys_time.in.h
+++ b/gl/lib/sys_time.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/time.h.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -24,6 +24,13 @@
#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
+
/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself
recursively via <sys/select.h>.
Simply delegate to the system's header in this case; it is a no-op.
@@ -41,6 +48,11 @@
#ifndef _@GUARD_PREFIX@_SYS_TIME_H
#define _@GUARD_PREFIX@_SYS_TIME_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if ! @HAVE_SYS_TIME_H@
# include <time.h>
#endif
diff --git a/gl/lib/sys_types.in.h b/gl/lib/sys_types.in.h
index 698e88d6..ea77e140 100644
--- a/gl/lib/sys_types.in.h
+++ b/gl/lib/sys_types.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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,13 @@
#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
+
#if defined _WIN32 && !defined __CYGWIN__ \
&& (defined __need_off_t || defined __need___off64_t \
|| defined __need_ssize_t || defined __need_time_t)
diff --git a/gl/lib/sys_uio.in.h b/gl/lib/sys_uio.in.h
index 788d461f..64c4fb6d 100644
--- a/gl/lib/sys_uio.in.h
+++ b/gl/lib/sys_uio.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/uio.h>.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/sysexits.in.h b/gl/lib/sysexits.in.h
index 9a65060e..c19e5e27 100644
--- a/gl/lib/sysexits.in.h
+++ b/gl/lib/sysexits.in.h
@@ -1,5 +1,5 @@
/* exit() exit codes for some BSD system programs.
- Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2023 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/gl/lib/tempname.c b/gl/lib/tempname.c
index 5fc5efe0..bf362db6 100644
--- a/gl/lib/tempname.c
+++ b/gl/lib/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -20,16 +20,9 @@
# include "tempname.h"
#endif
-#include <sys/types.h>
-#include <assert.h>
-#include <stdbool.h>
-
#include <errno.h>
#include <stdio.h>
-#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
-#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
#endif
@@ -43,27 +36,23 @@
# error report this to bug-gnulib@gnu.org
#endif
-#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
-#include <stdalign.h>
#include <stdint.h>
#include <sys/random.h>
#include <sys/stat.h>
#include <time.h>
#if _LIBC
-# define struct_stat64 struct stat64
-# define __secure_getenv __libc_secure_getenv
+# define struct_stat64 struct __stat64_t64
#else
# define struct_stat64 struct stat
# define __gen_tempname gen_tempname
# define __mkdir mkdir
# define __open open
-# define __lstat64(file, buf) lstat (file, buf)
-# define __stat64(file, buf) stat (file, buf)
+# define __lstat64_time64(file, buf) lstat (file, buf)
# define __getrandom getrandom
# define __clock_gettime64 clock_gettime
# define __timespec64 timespec
@@ -77,94 +66,56 @@ typedef uint_fast64_t random_value;
#define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */
#define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62)
+/* Return the result of mixing the entropy from R and S.
+ Assume that R and S are not particularly random,
+ and that the result should look randomish to an untrained eye. */
+
static random_value
-random_bits (random_value var, bool use_getrandom)
+mix_random_values (random_value r, random_value s)
{
- random_value r;
- /* Without GRND_NONBLOCK it can be blocked for minutes on some systems. */
- if (use_getrandom && __getrandom (&r, sizeof r, GRND_NONBLOCK) == sizeof r)
- return r;
-#if _LIBC || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
- /* Add entropy if getrandom did not work. */
- struct __timespec64 tv;
- __clock_gettime64 (CLOCK_MONOTONIC, &tv);
- var ^= tv.tv_nsec;
-#endif
- return 2862933555777941757 * var + 3037000493;
+ /* As this code is used only when high-quality randomness is neither
+ available nor necessary, there is no need for fancier polynomials
+ such as those in the Linux kernel's 'random' driver. */
+ return (2862933555777941757 * r + 3037000493) ^ s;
}
-#if _LIBC
-/* Return nonzero if DIR is an existent directory. */
-static int
-direxists (const char *dir)
-{
- struct_stat64 buf;
- return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
-}
+/* Set *R to a random value.
+ Return true if *R is set to high-quality value taken from getrandom.
+ Otherwise return false, falling back to a low-quality *R that might
+ depend on S.
-/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
- non-null and exists, uses it; otherwise uses the first of $TMPDIR,
- P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
- for use with mk[s]temp. Will fail (-1) if DIR is non-null and
- doesn't exist, none of the searched dirs exists, or there's not
- enough space in TMPL. */
-int
-__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
- int try_tmpdir)
+ This function returns false only when getrandom fails.
+ On GNU systems this should happen only early in the boot process,
+ when the fallback should be good enough for programs using tempname
+ because any attacker likely has root privileges already. */
+
+static bool
+random_bits (random_value *r, random_value s)
{
- const char *d;
- size_t dlen, plen;
+ /* Without GRND_NONBLOCK it can be blocked for minutes on some systems. */
+ if (__getrandom (r, sizeof *r, GRND_NONBLOCK) == sizeof *r)
+ return true;
- if (!pfx || !pfx[0])
- {
- pfx = "file";
- plen = 4;
- }
- else
- {
- plen = strlen (pfx);
- if (plen > 5)
- plen = 5;
- }
+ /* If getrandom did not work, use ersatz entropy based on low-order
+ clock bits. On GNU systems getrandom should fail only
+ early in booting, when ersatz should be good enough.
+ Do not use ASLR-based entropy, as that would leak ASLR info into
+ the resulting file name which is typically public.
- if (try_tmpdir)
- {
- d = __secure_getenv ("TMPDIR");
- if (d != NULL && direxists (d))
- dir = d;
- else if (dir != NULL && direxists (dir))
- /* nothing */ ;
- else
- dir = NULL;
- }
- if (dir == NULL)
- {
- if (direxists (P_tmpdir))
- dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
- else
- {
- __set_errno (ENOENT);
- return -1;
- }
- }
+ Of course we are in a state of sin here. */
- dlen = strlen (dir);
- while (dlen > 1 && dir[dlen - 1] == '/')
- dlen--; /* remove trailing slashes */
+ random_value v = s;
- /* check we have room for "${dir}/${pfx}XXXXXX\0" */
- if (tmpl_len < dlen + 1 + plen + 6 + 1)
- {
- __set_errno (EINVAL);
- return -1;
- }
+#if _LIBC || (defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME)
+ struct __timespec64 tv;
+ __clock_gettime64 (CLOCK_REALTIME, &tv);
+ v = mix_random_values (v, tv.tv_sec);
+ v = mix_random_values (v, tv.tv_nsec);
+#endif
- sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
- return 0;
+ *r = mix_random_values (v, clock ());
+ return false;
}
-#endif /* _LIBC */
#if _LIBC
static int try_tempname_len (char *, int, void *, int (*) (char *, void *),
@@ -191,7 +142,7 @@ try_nocreate (char *tmpl, _GL_UNUSED void *flags)
{
struct_stat64 st;
- if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW)
+ if (__lstat64_time64 (tmpl, &st) == 0 || errno == EOVERFLOW)
__set_errno (EEXIST);
return errno == ENOENT ? 0 : -1;
}
@@ -213,7 +164,7 @@ static const char letters[] =
and return a read-write fd. The file is mode 0600.
__GT_DIR: create a directory, which will be mode 0700.
- We use a clever algorithm to get hard-to-predict names. */
+ */
#ifdef _LIBC
static
#endif
@@ -261,25 +212,17 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
unsigned int attempts = ATTEMPTS_MIN;
#endif
- /* A random variable. The initial value is used only the for fallback path
- on 'random_bits' on 'getrandom' failure. Its initial value tries to use
- some entropy from the ASLR and ignore possible bits from the stack
- alignment. */
- random_value v = ((uintptr_t) &v) / alignof (max_align_t);
+ /* A random variable. */
+ random_value v = 0;
- /* How many random base-62 digits can currently be extracted from V. */
+ /* A value derived from the random variable, and how many random
+ base-62 digits can currently be extracted from VDIGBUF. */
+ random_value vdigbuf;
int vdigits = 0;
- /* Whether to consume entropy when acquiring random bits. On the
- first try it's worth the entropy cost with __GT_NOCREATE, which
- is inherently insecure and can use the entropy to make it a bit
- less secure. On the (rare) second and later attempts it might
- help against DoS attacks. */
- bool use_getrandom = tryfunc == try_nocreate;
-
- /* Least unfair value for V. If V is less than this, V can generate
- BASE_62_DIGITS digits fairly. Otherwise it might be biased. */
- random_value const unfair_min
+ /* Least biased value for V. If V is less than this, V can generate
+ BASE_62_DIGITS unbiased digits. Otherwise the digits are biased. */
+ random_value const biased_min
= RANDOM_VALUE_MAX - RANDOM_VALUE_MAX % BASE_62_POWER;
len = strlen (tmpl);
@@ -299,18 +242,16 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
{
if (vdigits == 0)
{
- do
- {
- v = random_bits (v, use_getrandom);
- use_getrandom = true;
- }
- while (unfair_min <= v);
+ /* Worry about bias only if the bits are high quality. */
+ while (random_bits (&v, v) && biased_min <= v)
+ continue;
+ vdigbuf = v;
vdigits = BASE_62_DIGITS;
}
- XXXXXX[i] = letters[v % 62];
- v /= 62;
+ XXXXXX[i] = letters[vdigbuf % 62];
+ vdigbuf /= 62;
vdigits--;
}
diff --git a/gl/lib/tempname.h b/gl/lib/tempname.h
index c172820f..36a51381 100644
--- a/gl/lib/tempname.h
+++ b/gl/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 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 @@ extern "C" {
and return a read-write fd. The file is mode 0600.
GT_DIR: create a directory, which will be mode 0700.
- We use a clever algorithm to get hard-to-predict names. */
+ */
extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
/* Similar, except X_SUFFIX_LEN gives the number of Xs. */
extern int gen_tempname_len (char *tmpl, int suffixlen, int flags, int kind,
diff --git a/gl/lib/termios.in.h b/gl/lib/termios.in.h
index 32b7c5b3..0036cbac 100644
--- a/gl/lib/termios.in.h
+++ b/gl/lib/termios.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <termios.h>.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 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
@@ -40,6 +40,11 @@ extern "C" {
#ifndef _@GUARD_PREFIX@_TERMIOS_H
#define _@GUARD_PREFIX@_TERMIOS_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get pid_t. */
#include <sys/types.h>
diff --git a/gl/lib/time.in.h b/gl/lib/time.in.h
index 6d4c7719..06428adb 100644
--- a/gl/lib/time.in.h
+++ b/gl/lib/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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,13 @@
#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
+
/* Don't get in the way of glibc when it includes time.h merely to
declare a few standard symbols, rather than to declare all the
symbols. (However, skip this for MinGW as it treats __need_time_t
@@ -45,6 +52,12 @@
# @INCLUDE_NEXT@ @NEXT_TIME_H@
+/* This file uses _GL_ATTRIBUTE_DEPRECATED, GNULIB_POSIXCHECK,
+ HAVE_RAW_DECL_*. */
+# if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+# endif
+
/* NetBSD 5.0 mis-defines NULL. */
# include <stddef.h>
@@ -112,12 +125,24 @@ struct __time_t_must_be_integral {
/* Set *TS to the current time, and return BASE.
Upon failure, return 0. */
# if @GNULIB_TIMESPEC_GET@
-# if ! @HAVE_TIMESPEC_GET@
+# if @REPLACE_TIMESPEC_GET@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef timespec_get
+# define timespec_get rpl_timespec_get
+# endif
+_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_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (timespec_get);
+# endif
# endif
/* Set *TS to the current time resolution, and return BASE.
@@ -131,6 +156,22 @@ _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
_GL_CXXALIASWARN (timespec_getres);
# endif
+/* Return the number of seconds that have elapsed since the Epoch. */
+# if @GNULIB_TIME@
+# if @REPLACE_TIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define time rpl_time
+# endif
+_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp));
+_GL_CXXALIAS_RPL (time, time_t, (time_t *__tp));
+# else
+_GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (time);
+# endif
+# endif
+
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */
@@ -315,6 +356,9 @@ _GL_CXXALIASWARN (strptime);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define ctime rpl_ctime
# endif
+# ifndef __cplusplus
+_GL_ATTRIBUTE_DEPRECATED
+# endif
_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
@@ -422,7 +466,9 @@ _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (timegm);
+# endif
# endif
/* Encourage applications to avoid unsafe functions that can overrun
@@ -435,8 +481,10 @@ _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
# endif
# if defined GNULIB_POSIXCHECK
# undef asctime_r
+# if HAVE_RAW_DECL_ASCTIME_R
_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime
@@ -445,8 +493,10 @@ _GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime_r
+# if HAVE_RAW_DECL_CTIME_R
_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
#endif
diff --git a/gl/lib/timespec.c b/gl/lib/timespec.c
index 9d136cb8..5f7ffbdd 100644
--- a/gl/lib/timespec.c
+++ b/gl/lib/timespec.c
@@ -1,6 +1,6 @@
/* Inline functions for <timespec.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/timespec.h b/gl/lib/timespec.h
index 9e358289..e94da75d 100644
--- a/gl/lib/timespec.h
+++ b/gl/lib/timespec.h
@@ -1,6 +1,6 @@
/* timespec -- System time interface
- Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2022 Free Software
+ Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -19,11 +19,14 @@
#if ! defined TIMESPEC_H
#define TIMESPEC_H
-#include <time.h>
-
-#ifndef _GL_INLINE_HEADER_BEGIN
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_ATTRIBUTE_CONST,
+ _GL_ATTRIBUTE_PURE, _GL_CMP. */
+#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+
+#include <time.h>
+
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_TIMESPEC_INLINE
# define _GL_TIMESPEC_INLINE _GL_INLINE
@@ -52,10 +55,7 @@ enum { LOG10_TIMESPEC_RESOLUTION = LOG10_TIMESPEC_HZ };
_GL_TIMESPEC_INLINE struct timespec
make_timespec (time_t s, long int ns)
{
- struct timespec r;
- r.tv_sec = s;
- r.tv_nsec = ns;
- return r;
+ return (struct timespec) { .tv_sec = s, .tv_nsec = ns };
}
/* Return negative, zero, positive if A < B, A == B, A > B, respectively. */
diff --git a/gl/lib/unistd--.h b/gl/lib/unistd--.h
index d395f7e0..ae4fb680 100644
--- a/gl/lib/unistd--.h
+++ b/gl/lib/unistd--.h
@@ -1,6 +1,6 @@
/* Like unistd.h, but redefine some names to avoid glitches.
- Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2023 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/gl/lib/unistd-safer.h b/gl/lib/unistd-safer.h
index db82c854..32686e71 100644
--- a/gl/lib/unistd-safer.h
+++ b/gl/lib/unistd-safer.h
@@ -1,6 +1,6 @@
/* Invoke unistd-like functions, but avoid some glitches.
- Copyright (C) 2001, 2003, 2005, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005, 2009-2023 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/gl/lib/unistd.c b/gl/lib/unistd.c
index 95978e6a..be7a8255 100644
--- a/gl/lib/unistd.c
+++ b/gl/lib/unistd.c
@@ -1,6 +1,6 @@
/* Inline functions for <unistd.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/unistd.in.h b/gl/lib/unistd.in.h
index 57df09ec..2ae040a7 100644
--- a/gl/lib/unistd.in.h
+++ b/gl/lib/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 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
@@ -40,6 +40,24 @@
# undef _GL_INCLUDING_UNISTD_H
#endif
+/* Avoid lseek bugs in FreeBSD, macOS <https://bugs.gnu.org/61386>.
+ This bug is fixed after FreeBSD 13; see <https://bugs.freebsd.org/256205>.
+ Use macOS "9999" to stand for a future fixed macOS version. */
+#if defined __FreeBSD__ && __FreeBSD__ < 14
+# undef SEEK_DATA
+# undef SEEK_HOLE
+#elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# include <AvailabilityMacros.h>
+# endif
+# if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \
+ || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000)
+# include <sys/fcntl.h> /* It also defines the two macros. */
+# undef SEEK_DATA
+# undef SEEK_HOLE
+# endif
+#endif
+
/* Get all possible declarations of gethostname(). */
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
&& !defined _GL_INCLUDING_WINSOCK2_H
@@ -51,6 +69,12 @@
#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_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* NetBSD 5.0 mis-defines NULL. Also get size_t. */
/* But avoid namespace pollution on glibc systems. */
#ifndef __GLIBC__
@@ -152,9 +176,6 @@
# include <getopt-pfx-core.h>
#endif
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_UNISTD_INLINE
# define _GL_UNISTD_INLINE _GL_INLINE
@@ -541,17 +562,22 @@ _GL_CXXALIASWARN (dup2);
Return newfd if successful, otherwise -1 and errno set.
See the Linux man page at
<https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
-# if @HAVE_DUP3@
+# if @REPLACE_DUP3@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup3
# define dup3 rpl_dup3
# endif
_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
# else
+# if !@HAVE_DUP3@
_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+# endif
_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (dup3);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef dup3
# if HAVE_RAW_DECL_DUP3
@@ -870,7 +896,9 @@ _GL_FUNCDECL_SYS (execvpe, int,
_GL_CXXALIAS_SYS (execvpe, int,
(const char *program, char * const *argv, char * const *env));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (execvpe);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef execvpe
# if HAVE_RAW_DECL_EXECVPE
@@ -925,7 +953,9 @@ _GL_FUNCDECL_SYS (faccessat, int,
_GL_CXXALIAS_SYS (faccessat, int,
(int fd, char const *file, int mode, int flag));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (faccessat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef faccessat
# if HAVE_RAW_DECL_FACCESSAT
@@ -1002,11 +1032,22 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
Return 0 if successful, otherwise -1 and errno set.
See POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
-# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
+# if @REPLACE_FDATASYNC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdatasync
+# define fdatasync rpl_fdatasync
+# endif
+_GL_FUNCDECL_RPL (fdatasync, int, (int fd));
+_GL_CXXALIAS_RPL (fdatasync, int, (int fd));
+# else
+# if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@
_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
-# endif
+# endif
_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fdatasync);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fdatasync
# if HAVE_RAW_DECL_FDATASYNC
@@ -1053,7 +1094,9 @@ _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
# endif
_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ftruncate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef ftruncate
# if HAVE_RAW_DECL_FTRUNCATE
@@ -1143,7 +1186,9 @@ _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
# endif
_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdomainname);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getdomainname
# if HAVE_RAW_DECL_GETDOMAINNAME
@@ -1183,11 +1228,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
#if @GNULIB_GETENTROPY@
/* Fill a buffer with random bytes. */
-# if !@HAVE_GETENTROPY@
+# if @REPLACE_GETENTROPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# 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));
+# else
+# if !@HAVE_GETENTROPY@
_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
-# endif
+# endif
_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getentropy);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getentropy
# if HAVE_RAW_DECL_GETENTROPY
@@ -1321,7 +1377,9 @@ _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
int size. */
_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getlogin_r);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getlogin_r
# if HAVE_RAW_DECL_GETLOGIN_R
@@ -1659,7 +1717,9 @@ _GL_CXXALIAS_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2,
int flag));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (linkat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef linkat
# if HAVE_RAW_DECL_LINKAT
@@ -1740,8 +1800,9 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
Return 0 upon success, or -1 with errno set upon failure.
See also the Linux man page at
<https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
-# if @HAVE_PIPE2@
+# if @REPLACE_PIPE2@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pipe2
# define pipe2 rpl_pipe2
# endif
_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
@@ -1750,7 +1811,9 @@ _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (pipe2);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef pipe2
# if HAVE_RAW_DECL_PIPE2
@@ -1785,7 +1848,9 @@ _GL_FUNCDECL_SYS (pread, ssize_t,
_GL_CXXALIAS_SYS (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (pread);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef pread
# if HAVE_RAW_DECL_PREAD
@@ -1820,7 +1885,9 @@ _GL_FUNCDECL_SYS (pwrite, ssize_t,
_GL_CXXALIAS_SYS (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (pwrite);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef pwrite
# if HAVE_RAW_DECL_PWRITE
@@ -1934,7 +2001,9 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file,
char *restrict buf, size_t len));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (readlinkat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef readlinkat
# if HAVE_RAW_DECL_READLINKAT
@@ -1994,15 +2063,27 @@ _GL_CXXALIASWARN (rmdir);
Platforms with no ability to set the hostname return -1 and set
errno = ENOSYS. */
-# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
+# if @REPLACE_SETHOSTNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# 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));
+# else
+# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
_GL_ARG_NONNULL ((1)));
-# endif
+# 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));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sethostname);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef sethostname
# if HAVE_RAW_DECL_SETHOSTNAME
@@ -2055,7 +2136,7 @@ _GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
# else
# if defined __hpux /* HP-UX */
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
-# elif defined __sun && !defined _XPG4 /* Solaris */
+# elif defined __sun && (defined __SunOS_5_10 || defined __XOPEN_OR_POSIX) && !defined _XPG4 /* Solaris */
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
# else
_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
@@ -2111,7 +2192,9 @@ _GL_FUNCDECL_SYS (symlinkat, int,
_GL_CXXALIAS_SYS (symlinkat, int,
(char const *contents, int fd, char const *file));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (symlinkat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef symlinkat
# if HAVE_RAW_DECL_SYMLINKAT
@@ -2141,7 +2224,9 @@ _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
# endif
_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (truncate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef truncate
# if HAVE_RAW_DECL_TRUNCATE
@@ -2171,7 +2256,9 @@ _GL_FUNCDECL_SYS (ttyname_r, int,
_GL_CXXALIAS_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ttyname_r);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef ttyname_r
# if HAVE_RAW_DECL_TTYNAME_R
diff --git a/gl/lib/unlink.c b/gl/lib/unlink.c
index b549dd4a..d77d2629 100644
--- a/gl/lib/unlink.c
+++ b/gl/lib/unlink.c
@@ -1,6 +1,6 @@
/* Work around unlink bugs.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/unlinkat.c b/gl/lib/unlinkat.c
index c9ff3ab2..ea3d5ea5 100644
--- a/gl/lib/unlinkat.c
+++ b/gl/lib/unlinkat.c
@@ -1,6 +1,6 @@
/* Work around unlinkat bugs on Solaris 9 and Hurd.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 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/gl/lib/utime.c b/gl/lib/utime.c
index 799be0fa..3cf1840f 100644
--- a/gl/lib/utime.c
+++ b/gl/lib/utime.c
@@ -1,5 +1,5 @@
/* Work around platform bugs in utime.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -24,7 +24,6 @@
#if defined _WIN32 && ! defined __CYGWIN__
# include <errno.h>
-# include <stdbool.h>
# include <windows.h>
# include "filename.h"
# include "malloca.h"
diff --git a/gl/lib/utime.in.h b/gl/lib/utime.in.h
index 6cf17b67..da491697 100644
--- a/gl/lib/utime.in.h
+++ b/gl/lib/utime.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <utime.h>.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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,13 @@
#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_UTIME_H@
# @INCLUDE_NEXT@ @NEXT_UTIME_H@
@@ -29,6 +36,11 @@
#ifndef _@GUARD_PREFIX@_UTIME_H
#define _@GUARD_PREFIX@_UTIME_H
+/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if !@HAVE_UTIME_H@
# include <sys/utime.h>
#endif
diff --git a/gl/lib/utimens.c b/gl/lib/utimens.c
index 2fa12518..faa197e6 100644
--- a/gl/lib/utimens.c
+++ b/gl/lib/utimens.c
@@ -1,6 +1,6 @@
/* Set file access and modification times.
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 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,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -406,10 +405,10 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
struct timeval *t;
if (ts)
{
- timeval[0].tv_sec = ts[0].tv_sec;
- timeval[0].tv_usec = ts[0].tv_nsec / 1000;
- timeval[1].tv_sec = ts[1].tv_sec;
- timeval[1].tv_usec = ts[1].tv_nsec / 1000;
+ timeval[0] = (struct timeval) { .tv_sec = ts[0].tv_sec,
+ .tv_usec = ts[0].tv_nsec / 1000 };
+ timeval[1] = (struct timeval) { .tv_sec = ts[1].tv_sec,
+ .tv_usec = ts[1].tv_nsec / 1000 };
t = timeval;
}
else
@@ -503,8 +502,8 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
struct utimbuf *ut;
if (ts)
{
- utimbuf.actime = ts[0].tv_sec;
- utimbuf.modtime = ts[1].tv_sec;
+ utimbuf = (struct utimbuf) { .actime = ts[0].tv_sec,
+ .modtime = ts[1].tv_sec };
ut = &utimbuf;
}
else
@@ -622,10 +621,10 @@ lutimens (char const *file, struct timespec const timespec[2])
int result;
if (ts)
{
- timeval[0].tv_sec = ts[0].tv_sec;
- timeval[0].tv_usec = ts[0].tv_nsec / 1000;
- timeval[1].tv_sec = ts[1].tv_sec;
- timeval[1].tv_usec = ts[1].tv_nsec / 1000;
+ timeval[0] = (struct timeval) { .tv_sec = ts[0].tv_sec,
+ .tv_usec = ts[0].tv_nsec / 1000 };
+ timeval[1] = (struct timeval) { .tv_sec = ts[1].tv_sec,
+ .tv_usec = ts[1].tv_nsec / 1000 };
t = timeval;
}
else
diff --git a/gl/lib/utimens.h b/gl/lib/utimens.h
index 2ccc06e5..4a21792a 100644
--- a/gl/lib/utimens.h
+++ b/gl/lib/utimens.h
@@ -1,6 +1,6 @@
/* Set file access and modification times.
- Copyright 2012-2022 Free Software Foundation, Inc.
+ Copyright 2012-2023 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
@@ -17,6 +17,11 @@
/* Written by Paul Eggert. */
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <time.h>
int fdutimens (int, char const *, struct timespec const [2]);
int utimens (char const *, struct timespec const [2]);
@@ -26,9 +31,6 @@ int lutimens (char const *, struct timespec const [2]);
# include <fcntl.h>
# include <sys/stat.h>
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_UTIMENS_INLINE
# define _GL_UTIMENS_INLINE _GL_INLINE
diff --git a/gl/lib/vasnprintf.c b/gl/lib/vasnprintf.c
index 285c674b..9ad31b2a 100644
--- a/gl/lib/vasnprintf.c
+++ b/gl/lib/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2023 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
@@ -83,8 +83,9 @@
#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() */
#include <errno.h> /* errno */
-#include <limits.h> /* CHAR_BIT */
+#include <limits.h> /* CHAR_BIT, INT_WIDTH, LONG_WIDTH */
#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
#if HAVE_NL_LANGINFO
# include <langinfo.h>
@@ -101,31 +102,30 @@
#include "xsize.h"
#include "attribute.h"
-#include "verify.h"
-#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
# include <math.h>
# include "float+.h"
#endif
-#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
# include <math.h>
# include "isnand-nolibm.h"
#endif
-#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
# include <math.h>
# include "isnanl-nolibm.h"
# include "fpucw.h"
#endif
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
# include <math.h>
# include "isnand-nolibm.h"
# include "printf-frexp.h"
#endif
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
# include <math.h>
# include "isnanl-nolibm.h"
# include "printf-frexpl.h"
@@ -138,8 +138,6 @@
# define VASNPRINTF vasnwprintf
# define FCHAR_T wchar_t
# define DCHAR_T wchar_t
-# define TCHAR_T wchar_t
-# define DCHAR_IS_TCHAR 1
# define DIRECTIVE wchar_t_directive
# define DIRECTIVES wchar_t_directives
# define PRINTF_PARSE wprintf_parse
@@ -159,24 +157,32 @@
# endif
#endif
#if WIDE_CHAR_VERSION
- /* TCHAR_T is wchar_t. */
-# define USE_SNPRINTF 1
-# if HAVE_DECL__SNWPRINTF
- /* On Windows, the function swprintf() has a different signature than
- on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
- instead. The mingw function snwprintf() has fewer bugs than the
- MSVCRT function _snwprintf(), so prefer that. */
-# if defined __MINGW32__
-# define SNPRINTF snwprintf
+ /* DCHAR_T is wchar_t. */
+# if HAVE_DECL__SNWPRINTF || (HAVE_SWPRINTF && HAVE_WORKING_SWPRINTF)
+# define TCHAR_T wchar_t
+# define DCHAR_IS_TCHAR 1
+# define USE_SNPRINTF 1
+# if HAVE_DECL__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+ instead. The mingw function snwprintf() has fewer bugs than the
+ MSVCRT function _snwprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snwprintf
+# else
+# define SNPRINTF _snwprintf
+# define USE_MSVC__SNPRINTF 1
+# endif
# else
-# define SNPRINTF _snwprintf
-# define USE_MSVC__SNPRINTF 1
+ /* Unix. */
+# define SNPRINTF swprintf
# endif
# else
- /* Unix. */
-# define SNPRINTF swprintf
+ /* Old platforms such as NetBSD 3.0, OpenBSD 3.8, HP-UX 11.00, IRIX 6.5. */
+# define TCHAR_T char
# endif
-#else
+#endif
+#if !WIDE_CHAR_VERSION || !DCHAR_IS_TCHAR
/* TCHAR_T is char. */
/* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
But don't use it on BeOS, since BeOS snprintf produces no output if the
@@ -241,7 +247,7 @@ local_strnlen (const char *string, size_t maxlen)
# endif
#endif
-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+#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 HAVE_WCSLEN
# define local_wcslen wcslen
# else
@@ -264,8 +270,8 @@ local_wcslen (const wchar_t *s)
# endif
#endif
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
-# if HAVE_WCSNLEN
+#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+# if HAVE_WCSNLEN && HAVE_DECL_WCSNLEN
# define local_wcsnlen wcsnlen
# else
# ifndef local_wcsnlen_defined
@@ -283,7 +289,7 @@ 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 && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+#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 ENABLE_WCHAR_FALLBACK
static size_t
wctomb_fallback (char *s, wchar_t wc)
@@ -351,7 +357,7 @@ local_wctomb (char *s, wchar_t wc)
# endif
#endif
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
/* Determine the decimal-point character according to the current locale. */
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
@@ -378,7 +384,7 @@ decimal_point_char (void)
# endif
#endif
-#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL
+#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE
/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
static int
@@ -389,7 +395,7 @@ is_infinite_or_zero (double x)
#endif
-#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
+#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE
/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
static int
@@ -400,7 +406,7 @@ is_infinite_or_zerol (long double x)
#endif
-#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE
/* Converting 'long double' to decimal without rare rounding bugs requires
real bignums. We use the naming conventions of GNU gmp, but vastly simpler
@@ -408,11 +414,11 @@ is_infinite_or_zerol (long double x)
typedef unsigned int mp_limb_t;
# define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
typedef unsigned long long mp_twolimb_t;
# define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
/* Representation of a bignum >= 0. */
typedef struct
@@ -921,6 +927,14 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
return roomptr;
}
+/* 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
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Walloc-size-larger-than="
+# endif
+
/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
representation.
Destroys the contents of a.
@@ -977,6 +991,10 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
return c_ptr;
}
+# if __GNUC__ >= 7
+# pragma GCC diagnostic pop
+# endif
+
# if NEED_PRINTF_LONG_DOUBLE
/* Assuming x is finite and >= 0:
@@ -1171,8 +1189,6 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
void *z_memory;
char *digits;
- if (memory == NULL)
- return NULL;
/* x = 2^e * m, hence
y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
= round (2^s * 5^n * m). */
@@ -1380,10 +1396,13 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
static char *
scale10_round_decimal_long_double (long double x, int n)
{
- int e IF_LINT(= 0);
+ int e;
mpn_t m;
void *memory = decode_long_double (x, &e, &m);
- return scale10_round_decimal_decoded (e, m, memory, n);
+ if (memory != NULL)
+ return scale10_round_decimal_decoded (e, m, memory, n);
+ else
+ return NULL;
}
# endif
@@ -1398,10 +1417,13 @@ scale10_round_decimal_long_double (long double x, int n)
static char *
scale10_round_decimal_double (double x, int n)
{
- int e IF_LINT(= 0);
+ int e;
mpn_t m;
void *memory = decode_double (x, &e, &m);
- return scale10_round_decimal_decoded (e, m, memory, n);
+ if (memory != NULL)
+ return scale10_round_decimal_decoded (e, m, memory, n);
+ else
+ return NULL;
}
# endif
@@ -1604,7 +1626,7 @@ is_borderline (const char *digits, size_t precision)
#endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
/* Use a different function name, to make it possible that the 'wchar_t'
parametrization and the 'char' parametrization get compiled in the same
@@ -1627,24 +1649,156 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
switch (conversion)
{
case 'd': case 'i': case 'u':
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
+ switch (type)
+ {
+ default:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_LONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (long int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_LONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (long long int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (int8_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint8_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (int16_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint16_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (int32_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint32_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (int64_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint64_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (int_fast8_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast8_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (int_fast16_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast16_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (int_fast32_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast32_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_INT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (int_fast64_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast64_t) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ }
if (tmp_length < precision)
tmp_length = precision;
/* Multiply by 2, as an estimate for FLAG_GROUP. */
@@ -1653,25 +1807,156 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
tmp_length = xsum (tmp_length, 1);
break;
+ case 'b':
+ #if SUPPORT_GNU_PRINTF_DIRECTIVES \
+ || (__GLIBC__ + (__GLIBC_MINOR__ >= 35) > 2)
+ case 'B':
+ #endif
+ switch (type)
+ {
+ default:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint8_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint16_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint32_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint64_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast8_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast16_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast32_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast64_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ }
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 2, to account for a prefix from the alternate form. */
+ tmp_length = xsum (tmp_length, 2);
+ break;
+
case 'o':
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
+ switch (type)
+ {
+ default:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint8_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint16_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint32_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint64_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast8_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast16_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast32_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast64_t) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ }
if (tmp_length < precision)
tmp_length = precision;
/* Add 1, to account for a leading sign. */
@@ -1679,27 +1964,89 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
break;
case 'x': case 'X':
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
+ switch (type)
+ {
+ default:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint8_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint16_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint32_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint64_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast8_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast16_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast32_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast64_t) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ break;
+ }
if (tmp_length < precision)
tmp_length = precision;
- /* Add 2, to account for a leading sign or alternate form. */
+ /* Add 2, to account for a prefix from the alternate form. */
tmp_length = xsum (tmp_length, 2);
break;
@@ -2005,6 +2352,30 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
case TYPE_COUNT_LONGLONGINT_POINTER:
*a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
break;
+ case TYPE_COUNT_INT8_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int8_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT16_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int16_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT32_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int32_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT64_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int64_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT_FAST8_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_fast8_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT_FAST16_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_fast16_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT_FAST32_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_fast32_t_pointer = length;
+ break;
+ case TYPE_COUNT_INT_FAST64_T_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_fast64_t_pointer = length;
+ break;
default:
abort ();
}
@@ -2130,7 +2501,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
- if (characters < width && !(dp->flags & FLAG_LEFT))
+ if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2175,7 +2546,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
- if (characters < width && (dp->flags & FLAG_LEFT))
+ if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2232,7 +2603,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
- if (characters < width && !(dp->flags & FLAG_LEFT))
+ if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2277,7 +2648,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
- if (characters < width && (dp->flags & FLAG_LEFT))
+ if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2334,7 +2705,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
- if (characters < width && !(dp->flags & FLAG_LEFT))
+ if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2379,7 +2750,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
- if (characters < width && (dp->flags & FLAG_LEFT))
+ if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2394,7 +2765,150 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
+#if WIDE_CHAR_VERSION && (!DCHAR_IS_TCHAR || NEED_WPRINTF_DIRECTIVE_LC)
+ else if ((dp->conversion == 's'
+ && a.arg[dp->arg_index].type == TYPE_WIDE_STRING)
+ || (dp->conversion == 'c'
+ && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR))
+ {
+ /* %ls or %lc in vasnwprintf. See the specification of
+ fwprintf. */
+ /* It would be silly to use snprintf ("%ls", ...) and then
+ convert back the result from a char[] to a wchar_t[].
+ Instead, just copy the argument wchar_t[] to the result. */
+ int flags = dp->flags;
+ size_t width;
+
+ 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);
+ }
+ }
+
+ {
+ const wchar_t *ls_arg;
+ wchar_t lc_arg[1];
+ size_t characters;
+
+ if (dp->conversion == 's')
+ {
+ int has_precision;
+ size_t precision;
+
+ 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;
+ }
+ }
+
+ ls_arg = a.arg[dp->arg_index].a.a_wide_string;
+
+ if (has_precision)
+ {
+ /* Use only at most PRECISION wide characters, from
+ the left. */
+ const wchar_t *ls_arg_end;
+
+ ls_arg_end = ls_arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ if (*ls_arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+ ls_arg_end++;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string, and count the number of wide
+ characters. */
+ characters = local_wcslen (ls_arg);
+ }
+ }
+ else /* dp->conversion == 'c' */
+ {
+ lc_arg[0] = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ ls_arg = lc_arg;
+ characters = 1;
+ }
+
+ {
+ size_t total = (characters < width ? width : characters);
+ ENSURE_ALLOCATION (xsum (length, total));
+
+ if (characters < width && !(flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+ if (characters > 0)
+ {
+ DCHAR_CPY (result + length, ls_arg, characters);
+ length += characters;
+ }
+
+ if (characters < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+ }
+#endif
+#if (!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
else if (dp->conversion == 's'
# if WIDE_CHAR_VERSION
&& a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2551,7 +3065,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
- if (characters < width && !(dp->flags & FLAG_LEFT))
+ if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2602,17 +3116,19 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# else
count = mbtowc (&wc, arg, arg_end - arg);
# endif
- if (count <= 0)
- /* mbrtowc not consistent with mbrlen, or mbtowc
- not consistent with mblen. */
+ if (count == 0)
+ /* mbrtowc not consistent with strlen. */
abort ();
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
ENSURE_ALLOCATION (xsum (length, 1));
result[length++] = wc;
arg += count;
}
}
- if (characters < width && (dp->flags & FLAG_LEFT))
+ if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2628,7 +3144,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters;
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
@@ -2768,7 +3284,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
- if (w < width && !(dp->flags & FLAG_LEFT))
+ if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2836,7 +3352,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
- if (w < width && (dp->flags & FLAG_LEFT))
+ if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@@ -2847,12 +3363,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
}
#endif
-#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION
+#if (NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T && !WIDE_CHAR_VERSION
else if (dp->conversion == 'c'
&& a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)
{
/* Implement the 'lc' directive ourselves, in order to provide
- the fallback that avoids EILSEQ. */
+ a correct behaviour for the null wint_t argument and/or the
+ fallback that avoids EILSEQ. */
int flags = dp->flags;
int has_width;
size_t width;
@@ -2894,7 +3411,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters;
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
DCHAR_T *tmpdst;
size_t tmpdst_len;
@@ -2918,8 +3435,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
count = local_wcrtomb (cbuf, arg, &state);
if (count < 0)
- /* Inconsistency. */
- abort ();
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
characters = count;
}
}
@@ -2977,7 +3494,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
- if (w < width && !(dp->flags & FLAG_LEFT))
+ if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@@ -3017,9 +3534,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
count = local_wcrtomb (cbuf, arg, &state);
- if (count <= 0)
- /* Inconsistency. */
- abort ();
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
ENSURE_ALLOCATION (xsum (length, count));
memcpy (result + length, cbuf, count);
length += count;
@@ -3033,7 +3550,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
- if (w < width && (dp->flags & FLAG_LEFT))
+ if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@@ -3043,14 +3560,399 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
#endif
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+#if NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION
+ else if (dp->conversion == 'c'
+ && a.arg[dp->arg_index].type != TYPE_WIDE_CHAR)
+ {
+ /* Implement the 'c' directive ourselves, in order to avoid
+ EILSEQ in the "C" locale. */
+ int flags = dp->flags;
+ size_t width;
+
+ 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);
+ }
+ }
+
+ /* %c in vasnwprintf. See the specification of fwprintf. */
+ {
+ char arg = (char) a.arg[dp->arg_index].a.a_char;
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ int count = mbrtowc (&wc, &arg, 1, &state);
+ if (count < 0)
+ /* 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;
+ }
+
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length++] = wc;
+
+ if (1 < width && (flags & FLAG_LEFT))
+ {
+ size_t n = width - 1;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+#endif
+#if NEED_PRINTF_DIRECTIVE_B || NEED_PRINTF_DIRECTIVE_UPPERCASE_B
+ else if (0
+# if NEED_PRINTF_DIRECTIVE_B
+ || (dp->conversion == 'b')
+# endif
+# if NEED_PRINTF_DIRECTIVE_UPPERCASE_B
+ || (dp->conversion == 'B')
+# endif
+ )
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ size_t count;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *tmp_end;
+ DCHAR_T *tmp_start;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ 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);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 1;
+ 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;
+ }
+ }
+
+ /* Allocate a temporary buffer of sufficient size. */
+ switch (type)
+ {
+ default:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_ULONGLONGINT:
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long int) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint8_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint16_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint32_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint64_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST8_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast8_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST16_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast16_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST32_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast32_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ case TYPE_UINT_FAST64_T:
+ tmp_length =
+ (unsigned int) (sizeof (uint_fast64_t) * CHAR_BIT)
+ + 1; /* turn floor into ceil */
+ break;
+ }
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 2, to account for a prefix from the alternate form. */
+ tmp_length = xsum (tmp_length, 2);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ tmp_end = tmp + tmp_length;
+
+ unsigned long long arg;
+ switch (type)
+ {
+ case TYPE_UCHAR:
+ arg = a.arg[dp->arg_index].a.a_uchar;
+ break;
+ case TYPE_USHORT:
+ arg = a.arg[dp->arg_index].a.a_ushort;
+ break;
+ case TYPE_UINT:
+ arg = a.arg[dp->arg_index].a.a_uint;
+ break;
+ case TYPE_ULONGINT:
+ arg = a.arg[dp->arg_index].a.a_ulongint;
+ break;
+ case TYPE_ULONGLONGINT:
+ arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ break;
+ case TYPE_UINT8_T:
+ arg = a.arg[dp->arg_index].a.a_uint8_t;
+ break;
+ case TYPE_UINT16_T:
+ arg = a.arg[dp->arg_index].a.a_uint16_t;
+ break;
+ case TYPE_UINT32_T:
+ arg = a.arg[dp->arg_index].a.a_uint32_t;
+ break;
+ case TYPE_UINT64_T:
+ arg = a.arg[dp->arg_index].a.a_uint64_t;
+ break;
+ case TYPE_UINT_FAST8_T:
+ arg = a.arg[dp->arg_index].a.a_uint_fast8_t;
+ break;
+ case TYPE_UINT_FAST16_T:
+ arg = a.arg[dp->arg_index].a.a_uint_fast16_t;
+ break;
+ case TYPE_UINT_FAST32_T:
+ arg = a.arg[dp->arg_index].a.a_uint_fast32_t;
+ break;
+ case TYPE_UINT_FAST64_T:
+ arg = a.arg[dp->arg_index].a.a_uint_fast64_t;
+ break;
+ default:
+ abort ();
+ }
+ int need_prefix = ((flags & FLAG_ALT) && arg != 0);
+
+ p = tmp_end;
+ /* "The result of converting a zero value with a precision
+ of zero is no characters." */
+ if (!(has_precision && precision == 0 && arg == 0))
+ {
+ do
+ {
+ *--p = '0' + (arg & 1);
+ arg = arg >> 1;
+ }
+ while (arg != 0);
+ }
+
+ if (has_precision)
+ {
+ DCHAR_T *digits_start = tmp_end - precision;
+ while (p > digits_start)
+ *--p = '0';
+ }
+
+ pad_ptr = p;
+
+ if (need_prefix)
+ {
+# if NEED_PRINTF_DIRECTIVE_B && !NEED_PRINTF_DIRECTIVE_UPPERCASE_B
+ *--p = 'b';
+# elif NEED_PRINTF_DIRECTIVE_UPPERCASE_B && !NEED_PRINTF_DIRECTIVE_B
+ *--p = 'B';
+# else
+ *--p = dp->conversion;
+# endif
+ *--p = '0';
+ }
+ tmp_start = p;
+
+ /* The generated string now extends from tmp_start to tmp_end,
+ with the zero padding insertion point being at pad_ptr,
+ tmp_start <= pad_ptr <= tmp_end. */
+ count = tmp_end - tmp_start;
+
+ if (count < width)
+ {
+ size_t pad = width - count;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (p = tmp_start; p < tmp_end; p++)
+ *(p - pad) = *p;
+ for (p = tmp_end - pad; p < tmp_end; p++)
+ *p = ' ';
+ }
+ else if ((flags & FLAG_ZERO)
+ /* Neither ISO C nor POSIX specify that the '0'
+ flag is ignored when a width and a precision
+ are both present. But most implementations
+ do so. */
+ && !(has_width && has_precision))
+ {
+ /* Pad with zeroes. */
+ for (p = tmp_start; p < pad_ptr; p++)
+ *(p - pad) = *p;
+ for (p = pad_ptr - pad; p < pad_ptr; p++)
+ *p = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ for (p = tmp_start - pad; p < tmp_start; p++)
+ *p = ' ';
+ }
+
+ tmp_start = tmp_start - pad;
+ }
+
+ count = tmp_end - tmp_start;
+
+ if (count > tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp_start, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+#endif
+#if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
else if ((dp->conversion == 'a' || dp->conversion == 'A')
# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
&& (0
# if NEED_PRINTF_DOUBLE
|| a.arg[dp->arg_index].type == TYPE_DOUBLE
# endif
-# if NEED_PRINTF_LONG_DOUBLE
+# if NEED_PRINTF_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
|| a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
# endif
)
@@ -3170,7 +4072,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
p = tmp;
if (type == TYPE_LONGDOUBLE)
{
-# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
+# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION)
long double arg = a.arg[dp->arg_index].a.a_longdouble;
if (isnanl (arg))
@@ -3290,7 +4192,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
*p++ = dp->conversion - 'A' + 'P';
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
{ '%', '+', 'd', '\0' };
@@ -3441,7 +4343,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
*p++ = dp->conversion - 'A' + 'P';
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
{ '%', '+', 'd', '\0' };
@@ -3533,7 +4435,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += count;
}
#endif
-#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+#if NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE
else if ((dp->conversion == 'f' || dp->conversion == 'F'
|| dp->conversion == 'e' || dp->conversion == 'E'
|| dp->conversion == 'g' || dp->conversion == 'G'
@@ -3901,7 +4803,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
*p++ = dp->conversion; /* 'e' or 'E' */
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
{ '%', '+', '.', '2', 'd', '\0' };
@@ -4082,7 +4984,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
*p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
{ '%', '+', '.', '2', 'd', '\0' };
@@ -4359,7 +5261,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
*p++ = dp->conversion; /* 'e' or 'E' */
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
/* Produce the same number of exponent digits
@@ -4552,7 +5454,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
*p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION && DCHAR_IS_TCHAR
{
static const wchar_t decimal_format[] =
/* Produce the same number of exponent digits
@@ -4720,13 +5622,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags;
-#if !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_UNBOUNDED_PRECISION
int has_width;
#endif
-#if !USE_SNPRINTF || !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_UNBOUNDED_PRECISION
size_t width;
#endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || 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_UNBOUNDED_PRECISION
int has_precision;
size_t precision;
#endif
@@ -4735,7 +5637,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#else
# define prec_ourselves 0
#endif
-#if NEED_PRINTF_FLAG_LEFTADJUST
+#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
int pad_ourselves;
@@ -4752,10 +5654,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
TCHAR_T *tmp;
#endif
-#if !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_UNBOUNDED_PRECISION
has_width = 0;
#endif
-#if !USE_SNPRINTF || !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_UNBOUNDED_PRECISION
width = 0;
if (dp->width_start != dp->width_end)
{
@@ -4783,13 +5685,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end);
}
-#if !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_UNBOUNDED_PRECISION
has_width = 1;
-#endif
+# endif
}
#endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || 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_UNBOUNDED_PRECISION
has_precision = 0;
precision = 6;
if (dp->precision_start != dp->precision_end)
@@ -4826,6 +5728,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
switch (dp->conversion)
{
case 'd': case 'i': case 'u':
+ case 'b':
+ #if SUPPORT_GNU_PRINTF_DIRECTIVES \
+ || (__GLIBC__ + (__GLIBC_MINOR__ >= 35) > 2)
+ case 'B':
+ #endif
case 'o':
case 'x': case 'X': case 'p':
prec_ourselves = has_precision && (precision > 0);
@@ -4837,7 +5744,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to perform the padding ourselves. */
-#if !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_UNBOUNDED_PRECISION)
switch (dp->conversion)
{
# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
@@ -4956,6 +5863,54 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
case TYPE_LONGLONGINT:
case TYPE_ULONGLONGINT:
+ #if INT8_WIDTH > LONG_WIDTH
+ case TYPE_INT8_T:
+ #endif
+ #if UINT8_WIDTH > LONG_WIDTH
+ case TYPE_UINT8_T:
+ #endif
+ #if INT16_WIDTH > LONG_WIDTH
+ case TYPE_INT16_T:
+ #endif
+ #if UINT16_WIDTH > LONG_WIDTH
+ case TYPE_UINT16_T:
+ #endif
+ #if INT32_WIDTH > LONG_WIDTH
+ case TYPE_INT32_T:
+ #endif
+ #if UINT32_WIDTH > LONG_WIDTH
+ case TYPE_UINT32_T:
+ #endif
+ #if INT64_WIDTH > LONG_WIDTH
+ case TYPE_INT64_T:
+ #endif
+ #if UINT64_WIDTH > LONG_WIDTH
+ case TYPE_UINT64_T:
+ #endif
+ #if INT_FAST8_WIDTH > LONG_WIDTH
+ case TYPE_INT_FAST8_T:
+ #endif
+ #if UINT_FAST8_WIDTH > LONG_WIDTH
+ case TYPE_UINT_FAST8_T:
+ #endif
+ #if INT_FAST16_WIDTH > LONG_WIDTH
+ case TYPE_INT_FAST16_T:
+ #endif
+ #if UINT_FAST16_WIDTH > LONG_WIDTH
+ case TYPE_UINT_FAST16_T:
+ #endif
+ #if INT_FAST32_WIDTH > LONG_WIDTH
+ case TYPE_INT3_FAST2_T:
+ #endif
+ #if UINT_FAST32_WIDTH > LONG_WIDTH
+ case TYPE_UINT_FAST32_T:
+ #endif
+ #if INT_FAST64_WIDTH > LONG_WIDTH
+ case TYPE_INT_FAST64_T:
+ #endif
+ #if UINT_FAST64_WIDTH > LONG_WIDTH
+ case TYPE_UINT_FAST64_T:
+ #endif
#if defined _WIN32 && ! defined __CYGWIN__
*fbp++ = 'I';
*fbp++ = '6';
@@ -4967,12 +5922,60 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
FALLTHROUGH;
case TYPE_LONGINT:
case TYPE_ULONGINT:
-#if HAVE_WINT_T
+ #if INT8_WIDTH > INT_WIDTH && INT8_WIDTH <= LONG_WIDTH
+ case TYPE_INT8_T:
+ #endif
+ #if UINT8_WIDTH > INT_WIDTH && UINT8_WIDTH <= LONG_WIDTH
+ case TYPE_UINT8_T:
+ #endif
+ #if INT16_WIDTH > INT_WIDTH && INT16_WIDTH <= LONG_WIDTH
+ case TYPE_INT16_T:
+ #endif
+ #if UINT16_WIDTH > INT_WIDTH && UINT16_WIDTH <= LONG_WIDTH
+ case TYPE_UINT16_T:
+ #endif
+ #if INT32_WIDTH > INT_WIDTH && INT32_WIDTH <= LONG_WIDTH
+ case TYPE_INT32_T:
+ #endif
+ #if UINT32_WIDTH > INT_WIDTH && UINT32_WIDTH <= LONG_WIDTH
+ case TYPE_UINT32_T:
+ #endif
+ #if INT64_WIDTH > INT_WIDTH && INT64_WIDTH <= LONG_WIDTH
+ case TYPE_INT64_T:
+ #endif
+ #if UINT64_WIDTH > INT_WIDTH && UINT64_WIDTH <= LONG_WIDTH
+ case TYPE_UINT64_T:
+ #endif
+ #if INT_FAST8_WIDTH > INT_WIDTH && INT_FAST8_WIDTH <= LONG_WIDTH
+ case TYPE_INT_FAST8_T:
+ #endif
+ #if UINT_FAST8_WIDTH > INT_WIDTH && UINT_FAST8_WIDTH <= LONG_WIDTH
+ case TYPE_UINT_FAST8_T:
+ #endif
+ #if INT_FAST16_WIDTH > INT_WIDTH && INT_FAST16_WIDTH <= LONG_WIDTH
+ case TYPE_INT_FAST16_T:
+ #endif
+ #if UINT_FAST16_WIDTH > INT_WIDTH && UINT_FAST16_WIDTH <= LONG_WIDTH
+ case TYPE_UINT_FAST16_T:
+ #endif
+ #if INT_FAST32_WIDTH > INT_WIDTH && INT_FAST32_WIDTH <= LONG_WIDTH
+ case TYPE_INT_FAST32_T:
+ #endif
+ #if UINT_FAST32_WIDTH > INT_WIDTH && UINT_FAST32_WIDTH <= LONG_WIDTH
+ case TYPE_UINT_FAST32_T:
+ #endif
+ #if INT_FAST64_WIDTH > INT_WIDTH && INT_FAST64_WIDTH <= LONG_WIDTH
+ case TYPE_INT_FAST64_T:
+ #endif
+ #if UINT_FAST64_WIDTH > INT_WIDTH && UINT_FAST64_WIDTH <= LONG_WIDTH
+ case TYPE_UINT_FAST64_T:
+ #endif
+ #if HAVE_WINT_T
case TYPE_WIDE_CHAR:
-#endif
-#if HAVE_WCHAR_T
+ #endif
+ #if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
-#endif
+ #endif
*fbp++ = 'l';
break;
case TYPE_LONGDOUBLE:
@@ -4988,47 +5991,74 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if ((HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99) \
+ /* Decide whether to pass %n in the format string
+ to SNPRINTF. */
+# if (((!WIDE_CHAR_VERSION || !DCHAR_IS_TCHAR) \
+ && (HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99)) \
|| ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
&& !defined __UCLIBC__) \
|| (defined __APPLE__ && defined __MACH__) \
+ || defined __OpenBSD__ \
|| defined __ANDROID__ \
- || (defined _WIN32 && ! defined __CYGWIN__))
- /* On systems where we know that snprintf's return value
- conforms to ISO C 99 (HAVE_SNPRINTF_RETVAL_C99) and that
- snprintf always produces NUL-terminated strings
- (HAVE_SNPRINTF_TRUNCATION_C99), it is possible to avoid
- using %n. And it is desirable to do so, because more and
- more platforms no longer support %n, for "security reasons".
- In particular, the following platforms:
+ || (defined _WIN32 && ! defined __CYGWIN__)) \
+ || (WIDE_CHAR_VERSION && MUSL_LIBC)
+ /* We can avoid passing %n and instead rely on SNPRINTF's
+ return value if
+ - !WIDE_CHAR_VERSION || !DCHAR_IS_TCHAR, because otherwise,
+ when WIDE_CHAR_VERSION && DCHAR_IS_TCHAR,
+ snwprintf()/_snwprintf() (Windows) and swprintf() (Unix)
+ don't return the needed buffer size,
+ and
+ - we're compiling for a system where we know
+ - that snprintf's return value conforms to ISO C 99
+ (HAVE_SNPRINTF_RETVAL_C99) and
+ - that snprintf always produces NUL-terminated strings
+ (HAVE_SNPRINTF_TRUNCATION_C99).
+ And it is desirable to do so, because more and more platforms
+ no longer support %n, for "security reasons". */
+ /* On specific platforms, listed below, we *must* avoid %n.
+ In the case
+ !WIDE_CHAR_VERSION && HAVE_SNPRINTF_RETVAL_C99 && !USE_MSVC__SNPRINTF
+ we can rely on the return value of snprintf instead. Whereas
+ in the opposite case
+ WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+ we need to make room based on an estimation, computed by
+ MAX_ROOM_NEEDED. */
+ /* The following platforms forbid %n:
- On glibc2 systems from 2004-10-18 or newer, the use of
%n in format strings in writable memory may crash the
program (if compiled with _FORTIFY_SOURCE=2).
- - On Mac OS X 10.13 or newer, the use of %n in format
+ - On macOS 10.13 or newer, the use of %n in format
strings in writable memory by default crashes the
program.
+ - On OpenBSD, since 2021-08-30, the use of %n in format
+ strings produces an abort (see
+ <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/vfprintf.c.diff?r1=1.79&r2=1.80&f=h>,
+ <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/vfwprintf.c.diff?r1=1.20&r2=1.21&f=h>).
- On Android, starting on 2018-03-07, the use of %n in
format strings produces a fatal error (see
<https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>).
- On these platforms, HAVE_SNPRINTF_RETVAL_C99 and
- HAVE_SNPRINTF_TRUNCATION_C99 are 1. We have listed them
- explicitly in the condition above, in case of cross-
- compilation (just to be sure). */
- /* On native Windows systems (such as mingw), we can avoid using
- %n because:
+ - On native Windows systems (such as mingw) where the OS is
+ Windows Vista, the use of %n in format strings by default
+ crashes the program. See
+ <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
+ On the first four of these platforms, if !WIDE_CHAR_VERSION,
+ it is not a big deal to avoid %n, because on these platforms,
+ HAVE_SNPRINTF_RETVAL_C99 and HAVE_SNPRINTF_TRUNCATION_C99 are
+ 1.
+ On native Windows, if !WIDE_CHAR_VERSION, it's not a big deal
+ either because:
- Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
snprintf does not write more than the specified number
of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
'4', '5', '6' into buf, not '4', '5', '\0'.)
- Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
allows us to recognize the case of an insufficient
- buffer size: it returns -1 in this case.
- On native Windows systems (such as mingw) where the OS is
- Windows Vista, the use of %n in format strings by default
- crashes the program. See
- <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
- <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
- So we should avoid %n in this situation. */
+ buffer size: it returns -1 in this case. */
+ /* Additionally, in the WIDE_CHAR_VERSION case, we cannot use %n
+ on musl libc because we would run into an swprintf() bug.
+ See <https://www.openwall.com/lists/musl/2023/03/19/1>. */
fbp[1] = '\0';
# else /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */
fbp[1] = '%';
@@ -5189,6 +6219,102 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
SNPRINTF_BUF (arg);
}
break;
+ case TYPE_INT8_T:
+ {
+ int8_t arg = a.arg[dp->arg_index].a.a_int8_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT8_T:
+ {
+ uint8_t arg = a.arg[dp->arg_index].a.a_uint8_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT16_T:
+ {
+ int16_t arg = a.arg[dp->arg_index].a.a_int16_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT16_T:
+ {
+ uint16_t arg = a.arg[dp->arg_index].a.a_uint16_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT32_T:
+ {
+ int32_t arg = a.arg[dp->arg_index].a.a_int32_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT32_T:
+ {
+ uint32_t arg = a.arg[dp->arg_index].a.a_uint32_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT64_T:
+ {
+ int64_t arg = a.arg[dp->arg_index].a.a_int64_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT64_T:
+ {
+ uint64_t arg = a.arg[dp->arg_index].a.a_uint64_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT_FAST8_T:
+ {
+ int_fast8_t arg = a.arg[dp->arg_index].a.a_int_fast8_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT_FAST8_T:
+ {
+ uint_fast8_t arg = a.arg[dp->arg_index].a.a_uint_fast8_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT_FAST16_T:
+ {
+ int_fast16_t arg = a.arg[dp->arg_index].a.a_int_fast16_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT_FAST16_T:
+ {
+ uint_fast16_t arg = a.arg[dp->arg_index].a.a_uint_fast16_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT_FAST32_T:
+ {
+ int_fast32_t arg = a.arg[dp->arg_index].a.a_int_fast32_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT_FAST32_T:
+ {
+ uint_fast32_t arg = a.arg[dp->arg_index].a.a_uint_fast32_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT_FAST64_T:
+ {
+ int_fast64_t arg = a.arg[dp->arg_index].a.a_int_fast64_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT_FAST64_T:
+ {
+ uint_fast64_t arg = a.arg[dp->arg_index].a.a_uint_fast64_t;
+ SNPRINTF_BUF (arg);
+ }
+ break;
case TYPE_DOUBLE:
{
double arg = a.arg[dp->arg_index].a.a_double;
@@ -5271,12 +6397,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Look at the snprintf() return value. */
if (retcount < 0)
{
-# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+# if (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
/* HP-UX 10.20 snprintf() is doubly deficient:
It doesn't understand the '%n' directive,
*and* it returns -1 (rather than the length
that would have been required) when the
buffer is too small.
+ Likewise, in case of
+ WIDE_CHAR_VERSION && DCHAR_IS_TCHAR, the
+ functions snwprintf()/_snwprintf() (Windows)
+ or swprintf() (Unix).
But a failure at this point can also come
from other reasons than a too small buffer,
such as an invalid wide string argument to
@@ -5312,7 +6442,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
}
else
- count = retcount;
+ {
+ count = retcount;
+# if WIDE_CHAR_VERSION && defined __MINGW32__
+ if (count == 0 && dp->conversion == 'c')
+ /* snwprintf returned 0 instead of 1. But it
+ wrote a null wide character. */
+ count = 1;
+# endif
+ }
}
}
#endif
@@ -5442,21 +6580,73 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#if !DCHAR_IS_TCHAR
/* Convert from TCHAR_T[] to DCHAR_T[]. */
- if (dp->conversion == 'c' || dp->conversion == 's')
+ if (dp->conversion == 'c' || dp->conversion == 's'
+# if __GLIBC__ >= 2 && !defined __UCLIBC__
+ || (flags & FLAG_LOCALIZED)
+# endif
+ )
{
- /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
- TYPE_WIDE_STRING.
- The result string is not certainly ASCII. */
+ /* The result string is not guaranteed to be ASCII. */
const TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
# if USE_SNPRINTF
tmpsrc = (TCHAR_T *) (result + length);
# else
tmpsrc = tmp;
# endif
+# if WIDE_CHAR_VERSION
+ /* Convert tmpsrc[0..count-1] to a freshly allocated
+ wide character array. */
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ tmpdst_len = 0;
+ {
+ const TCHAR_T *src = tmpsrc;
+ size_t srclen = count;
+
+ for (; srclen > 0; tmpdst_len++)
+ {
+ /* Parse the next multibyte character. */
+ size_t ret = mbrtowc (NULL, src, srclen, &state);
+ if (ret == (size_t)(-2) || ret == (size_t)(-1))
+ goto fail_with_EILSEQ;
+ if (ret == 0)
+ ret = 1;
+ src += ret;
+ srclen -= ret;
+ }
+ }
+
+ tmpdst =
+ (wchar_t *) malloc ((tmpdst_len + 1) * sizeof (wchar_t));
+ if (tmpdst == NULL)
+ goto out_of_memory;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ {
+ DCHAR_T *destptr = tmpdst;
+ const TCHAR_T *src = tmpsrc;
+ size_t srclen = count;
+
+ for (; srclen > 0; destptr++)
+ {
+ /* Parse the next multibyte character. */
+ size_t ret = mbrtowc (destptr, src, srclen, &state);
+ if (ret == (size_t)(-2) || ret == (size_t)(-1))
+ /* Should already have been caught in the first
+ loop, above. */
+ abort ();
+ if (ret == 0)
+ ret = 1;
+ src += ret;
+ srclen -= ret;
+ }
+ }
+# else
tmpdst =
DCHAR_CONV_FROM_ENCODING (locale_charset (),
iconveh_question_mark,
@@ -5465,6 +6655,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
NULL, &tmpdst_len);
if (tmpdst == NULL)
goto fail_with_errno;
+# endif
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
{ free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
@@ -5531,7 +6722,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Here count <= allocated - length. */
/* Perform padding. */
-#if !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_UNBOUNDED_PRECISION
if (pad_ourselves && has_width)
{
size_t w;
@@ -5590,6 +6781,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
|| (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
pad_ptr = NULL;
+ else
+ /* Do the zero-padding after the "0x" or
+ "0b" prefix, not before. */
+ if (p - rp >= 2
+ && *rp == '0'
+ && (((dp->conversion == 'a'
+ || dp->conversion == 'x')
+ && rp[1] == 'x')
+ || ((dp->conversion == 'A'
+ || dp->conversion == 'X')
+ && rp[1] == 'X')
+ || (dp->conversion == 'b'
+ && rp[1] == 'b')
+ || (dp->conversion == 'B'
+ && rp[1] == 'B')))
+ pad_ptr += 2;
}
/* The generated string now extends from rp to p,
with the zero padding insertion point being at
@@ -5603,7 +6810,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
for (; pad > 0; pad--)
*p++ = ' ';
}
- else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL
+ /* ISO C says: "For d, i, o, u, x, and X
+ conversions, if a precision is
+ specified, the 0 flag is ignored. */
+ && !(has_precision
+ && (dp->conversion == 'd'
+ || dp->conversion == 'i'
+ || dp->conversion == 'o'
+ || dp->conversion == 'u'
+ || dp->conversion == 'x'
+ || dp->conversion == 'X'
+ /* Although ISO C does not
+ require it, treat 'b' and 'B'
+ like 'x' and 'X'. */
+ || dp->conversion == 'b'
+ || dp->conversion == 'B')))
{
/* Pad with zeroes. */
DCHAR_T *q = end;
@@ -5697,7 +6919,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
errno = ENOMEM;
goto fail_with_errno;
-#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T)
+#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)
fail_with_EILSEQ:
errno = EILSEQ;
goto fail_with_errno;
diff --git a/gl/lib/vasnprintf.h b/gl/lib/vasnprintf.h
index 27cf54c5..2d134070 100644
--- a/gl/lib/vasnprintf.h
+++ b/gl/lib/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2023 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
@@ -17,6 +17,11 @@
#ifndef _VASNPRINTF_H
#define _VASNPRINTF_H
+/* This file uses _GL_ATTRIBUTE_FORMAT. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get va_list. */
#include <stdarg.h>
diff --git a/gl/lib/vasprintf.c b/gl/lib/vasprintf.c
index 218275f2..d2878cd9 100644
--- a/gl/lib/vasprintf.c
+++ b/gl/lib/vasprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006-2023 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/gl/lib/verify.h b/gl/lib/verify.h
index c5c63ae9..e4af9151 100644
--- a/gl/lib/verify.h
+++ b/gl/lib/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 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,19 +25,19 @@
works as per C11. This is supported by GCC 4.6.0+ and by clang 4+.
Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
- per C2x. This is supported by GCC 9.1+.
+ per C23. This is supported by GCC 9.1+.
Support compilers claiming conformance to the relevant standard,
and also support GCC when not pedantic. If we were willing to slow
'configure' down we could also use it with other compilers, but
since this affects only the quality of diagnostics, why bother? */
#ifndef __cplusplus
-# if (201112L <= __STDC_VERSION__ \
+# if (201112 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ \
&& (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
# define _GL_HAVE__STATIC_ASSERT 1
# endif
-# if (202000L <= __STDC_VERSION__ \
+# if (202311 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
# define _GL_HAVE__STATIC_ASSERT1 1
# endif
@@ -202,12 +202,12 @@ template <int w>
This macro requires three or more arguments but uses at most the first
two, so that the _Static_assert macro optionally defined below supports
- both the C11 two-argument syntax and the C2x one-argument syntax.
+ both the C11 two-argument syntax and the C23 one-argument syntax.
Unfortunately, unlike C11, this implementation must appear as an
ordinary declaration, and cannot appear inside struct { ... }. */
-#if 200410 <= __cpp_static_assert
+#if 202311 <= __STDC_VERSION__ || 200410 <= __cpp_static_assert
# define _GL_VERIFY(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
#elif defined _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
@@ -222,18 +222,68 @@ template <int w>
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
#ifdef _GL_STATIC_ASSERT_H
-# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
-# define _Static_assert(...) \
- _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+/* Define _Static_assert if needed. */
+/* With clang ≥ 3.8.0 in C++ mode, _Static_assert already works and accepts
+ 1 or 2 arguments. We better don't override it, because clang's standard
+ C++ library uses static_assert inside classes in several places, and our
+ replacement via _GL_VERIFY does not work in these contexts. */
+# if (defined __cplusplus && defined __clang__ \
+ && (4 <= __clang_major__ + (8 <= __clang_minor__)))
+# if 5 <= __clang_major__
+/* Avoid "warning: 'static_assert' with no message is a C++17 extension". */
+# pragma clang diagnostic ignored "-Wc++17-extensions"
+# else
+/* Avoid "warning: static_assert with no message is a C++1z extension". */
+# pragma clang diagnostic ignored "-Wc++1z-extensions"
+# endif
+# elif !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
+# if !defined _MSC_VER || defined __clang__
+# define _Static_assert(...) \
+ _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+# else
+# if defined __cplusplus && _MSC_VER >= 1910
+ /* In MSVC 14.1 or newer, static_assert accepts one or two arguments,
+ but _Static_assert is not defined. */
+# define _Static_assert static_assert
+# else
+ /* Work around MSVC preprocessor incompatibility with ISO C; see
+ <https://stackoverflow.com/questions/5134523/>. */
+# define _Static_assert(R, ...) \
+ _GL_VERIFY ((R), "static assertion failed", -)
+# endif
+# endif
# endif
-# if __cpp_static_assert < 201411 && !defined static_assert
-# define static_assert _Static_assert /* C11 requires this #define. */
+/* Define static_assert if needed. */
+# if (!defined static_assert \
+ && __STDC_VERSION__ < 202311 \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6 && _MSC_VER < 1910)))
+# if 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),.
+ the solution is specific to MSVC. */
+# define _GL_EXPAND(x) x
+# 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_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
+/* Avoid "fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords." */
+# define _ALLOW_KEYWORD_MACROS 1
+# else
+# define static_assert _Static_assert /* C11 requires this #define. */
+# endif
# endif
#endif
/* @assert.h omit start@ */
-#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_TRAP 0
+#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
# define _GL_HAS_BUILTIN_TRAP 1
#elif defined __has_builtin
# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
@@ -241,12 +291,16 @@ template <int w>
# define _GL_HAS_BUILTIN_TRAP 0
#endif
-#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
-# define _GL_HAS_BUILTIN_UNREACHABLE 1
-#elif defined __has_builtin
-# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
-#else
-# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#ifndef _GL_HAS_BUILTIN_UNREACHABLE
+# if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+# elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+# else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+# endif
#endif
/* Each of these macros verifies that its argument R is nonzero. To
@@ -303,13 +357,16 @@ template <int w>
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#elif 1200 <= _MSC_VER
# define assume(R) __assume (R)
+#elif 202311 <= __STDC_VERSION__
+# include <stddef.h>
+# define assume(R) ((R) ? (void) 0 : unreachable ())
#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
/* Doing it this way helps various packages when configured with
--enable-gcc-warnings, which compiles with -Dlint. It's nicer
- when 'assume' silences warnings even with older GCCs. */
+ if 'assume' silences warnings with GCC 3.4 through GCC 4.4.7 (2012). */
# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
#else
- /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6. */
+ /* Some older tools grok NOTREACHED, e.g., Oracle Studio 12.6 (2017). */
# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
#endif
diff --git a/gl/lib/verror.c b/gl/lib/verror.c
index 3b08b31d..46bb2304 100644
--- a/gl/lib/verror.c
+++ b/gl/lib/verror.c
@@ -1,5 +1,5 @@
/* va_list error handler for noninteractive utilities
- Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2023 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/gl/lib/verror.h b/gl/lib/verror.h
index e52562cb..bd385e1e 100644
--- a/gl/lib/verror.h
+++ b/gl/lib/verror.h
@@ -1,5 +1,5 @@
/* Declaration for va_list error-reporting function
- Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009-2023 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
@@ -17,6 +17,11 @@
#ifndef _VERROR_H
#define _VERROR_H 1
+/* This file uses _GL_ATTRIBUTE_FORMAT. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdarg.h>
/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
diff --git a/gl/lib/vsnprintf.c b/gl/lib/vsnprintf.c
index 80999e9b..acd4e2d4 100644
--- a/gl/lib/vsnprintf.c
+++ b/gl/lib/vsnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/w32sock.h b/gl/lib/w32sock.h
index 17db3f12..84e46e33 100644
--- a/gl/lib/w32sock.h
+++ b/gl/lib/w32sock.h
@@ -1,6 +1,6 @@
/* w32sock.h --- internal auxiliary functions for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/warn-on-use.h b/gl/lib/warn-on-use.h
index 94f5b920..30756034 100644
--- a/gl/lib/warn-on-use.h
+++ b/gl/lib/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 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/gl/lib/wchar.in.h b/gl/lib/wchar.in.h
index 835ddbe6..75f3ed21 100644
--- a/gl/lib/wchar.in.h
+++ b/gl/lib/wchar.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 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
@@ -84,6 +84,12 @@
#ifndef _@GUARD_PREFIX@_WCHAR_H
#define _@GUARD_PREFIX@_WCHAR_H
+/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
+ _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#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. */
@@ -99,7 +105,14 @@
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
@@ -181,7 +194,11 @@ typedef int rpl_mbstate_t;
# if (@REPLACE_FREE@ && !defined free \
&& !(defined __cplusplus && defined GNULIB_NAMESPACE))
/* We can't do '#define free rpl_free' here. */
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void rpl_free (void *) throw ();
+# else
_GL_EXTERN_C void rpl_free (void *);
+# endif
# undef _GL_ATTRIBUTE_DEALLOC_FREE
# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
# else
@@ -434,7 +451,9 @@ _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
const char **restrict srcp, size_t srclen, size_t len,
mbstate_t *restrict ps));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mbsnrtowcs);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mbsnrtowcs
# if HAVE_RAW_DECL_MBSNRTOWCS
@@ -622,13 +641,25 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
/* Compare N wide characters of S1 and S2. */
#if @GNULIB_WMEMCMP@
-# if !@HAVE_WMEMCMP@
+# if @REPLACE_WMEMCMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wmemcmp
+# define wmemcmp rpl_wmemcmp
+# endif
+_GL_FUNCDECL_RPL (wmemcmp, int,
+ (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)
_GL_ATTRIBUTE_PURE);
-# endif
+# endif
_GL_CXXALIAS_SYS (wmemcmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (wmemcmp);
# endif
@@ -687,14 +718,27 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
/* Copy N wide characters of SRC to DEST.
Return pointer to wide characters after the last written wide character. */
#if @GNULIB_WMEMPCPY@
-# if !@HAVE_WMEMPCPY@
+# if @REPLACE_WMEMPCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wmempcpy
+# define wmempcpy rpl_wmempcpy
+# endif
+_GL_FUNCDECL_RPL (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+_GL_CXXALIAS_RPL (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# else
+# if !@HAVE_WMEMPCPY@
_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
(wchar_t *restrict dest,
const wchar_t *restrict src, size_t n));
-# endif
+# endif
_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
(wchar_t *restrict dest,
const wchar_t *restrict src, size_t n));
+# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (wmempcpy);
# endif
@@ -745,7 +789,10 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
/* Return the number of wide characters in S, but at most MAXLEN. */
#if @GNULIB_WCSNLEN@
-# if !@HAVE_WCSNLEN@
+/* 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_WCSNLEN@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
_GL_ATTRIBUTE_PURE);
# endif
@@ -782,7 +829,10 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
#if @GNULIB_WCPCPY@
-# if !@HAVE_WCPCPY@
+/* 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_WCPCPY@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
(wchar_t *restrict dest, const wchar_t *restrict src));
# endif
@@ -823,7 +873,10 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
/* Copy no more than N characters of SRC to DEST, returning the address of
the last character written into DEST. */
#if @GNULIB_WCPNCPY@
-# if !@HAVE_WCPNCPY@
+/* 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_WCPNCPY@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
(wchar_t *restrict dest,
const wchar_t *restrict src, size_t n));
@@ -885,11 +938,21 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
/* Compare S1 and S2. */
#if @GNULIB_WCSCMP@
-# if !@HAVE_WCSCMP@
+# if @REPLACE_WCSCMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcscmp
+# define wcscmp rpl_wcscmp
+# endif
+_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_ATTRIBUTE_PURE);
-# endif
+# endif
_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (wcscmp);
# endif
@@ -904,13 +967,25 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
/* Compare no more than N wide characters of S1 and S2. */
#if @GNULIB_WCSNCMP@
-# if !@HAVE_WCSNCMP@
+# if @REPLACE_WCSNCMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsncmp
+# define wcsncmp rpl_wcsncmp
+# endif
+_GL_FUNCDECL_RPL (wcsncmp, int,
+ (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)
_GL_ATTRIBUTE_PURE);
-# endif
+# endif
_GL_CXXALIAS_SYS (wcsncmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (wcsncmp);
# endif
@@ -925,7 +1000,10 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
/* Compare S1 and S2, ignoring case. */
#if @GNULIB_WCSCASECMP@
-# if !@HAVE_WCSCASECMP@
+/* 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_WCSCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
_GL_ATTRIBUTE_PURE);
# endif
@@ -942,7 +1020,10 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
/* Compare no more than N chars of S1 and S2, ignoring case. */
#if @GNULIB_WCSNCASECMP@
-# if !@HAVE_WCSNCASECMP@
+/* 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_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsncasecmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n)
_GL_ATTRIBUTE_PURE);
@@ -1009,7 +1090,10 @@ _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
# endif
_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
# else
-# if !@HAVE_WCSDUP@ || __GNUC__ >= 11
+/* 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
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
(const wchar_t *s)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
@@ -1115,7 +1199,7 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
#endif
-/* Return the length of the initial segmet of WCS which consists entirely
+/* Return the length of the initial segment of WCS which consists entirely
of wide characters not in REJECT. */
#if @GNULIB_WCSCSPN@
# if !@HAVE_WCSCSPN@
@@ -1135,7 +1219,7 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
#endif
-/* Return the length of the initial segmet of WCS which consists entirely
+/* Return the length of the initial segment of WCS which consists entirely
of wide characters in ACCEPT. */
#if @GNULIB_WCSSPN@
# if !@HAVE_WCSSPN@
@@ -1190,12 +1274,25 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
/* Find the first occurrence of NEEDLE in HAYSTACK. */
#if @GNULIB_WCSSTR@
-# if !@HAVE_WCSSTR@
+# if @REPLACE_WCSSTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsstr
+# define wcsstr rpl_wcsstr
+# endif
+_GL_FUNCDECL_RPL (wcsstr, wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle)
+ _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcsstr, wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle));
+# else
+# if !@HAVE_WCSSTR@
_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
(const wchar_t *restrict haystack,
const wchar_t *restrict needle)
_GL_ATTRIBUTE_PURE);
-# endif
+# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" {
const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
@@ -1206,6 +1303,7 @@ _GL_CXXALIAS_SYS_CAST2 (wcsstr,
(const wchar_t *restrict, const wchar_t *restrict),
const wchar_t *,
(const wchar_t *restrict, const wchar_t *restrict));
+# endif
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
diff --git a/gl/lib/wcrtomb.c b/gl/lib/wcrtomb.c
index e14d8022..48a6c8eb 100644
--- a/gl/lib/wcrtomb.c
+++ b/gl/lib/wcrtomb.c
@@ -1,5 +1,5 @@
/* Convert wide character to multibyte character.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 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/gl/lib/wctype-h.c b/gl/lib/wctype-h.c
index 12781433..7d3e14a6 100644
--- a/gl/lib/wctype-h.c
+++ b/gl/lib/wctype-h.c
@@ -1,6 +1,6 @@
/* Inline functions for <wctype.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/wctype.in.h b/gl/lib/wctype.in.h
index 98cafee7..227fdac2 100644
--- a/gl/lib/wctype.in.h
+++ b/gl/lib/wctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 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,12 @@
#ifndef _@GUARD_PREFIX@_WCTYPE_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
+ HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if @HAVE_WINT_T@
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
# include <wchar.h>
@@ -68,9 +74,6 @@
#ifndef _@GUARD_PREFIX@_WCTYPE_H
#define _@GUARD_PREFIX@_WCTYPE_H
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_WCTYPE_INLINE
# define _GL_WCTYPE_INLINE _GL_INLINE
diff --git a/gl/lib/windows-initguard.h b/gl/lib/windows-initguard.h
index a29d7e97..9d36f53c 100644
--- a/gl/lib/windows-initguard.h
+++ b/gl/lib/windows-initguard.h
@@ -1,5 +1,5 @@
/* Init guards, somewhat like spinlocks (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-mutex.c b/gl/lib/windows-mutex.c
index 28e429c1..ab7258c9 100644
--- a/gl/lib/windows-mutex.c
+++ b/gl/lib/windows-mutex.c
@@ -1,5 +1,5 @@
/* Plain mutexes (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-mutex.h b/gl/lib/windows-mutex.h
index 7aedfdf6..039eb707 100644
--- a/gl/lib/windows-mutex.h
+++ b/gl/lib/windows-mutex.h
@@ -1,5 +1,5 @@
/* Plain mutexes (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-once.c b/gl/lib/windows-once.c
index deea5487..0d28281f 100644
--- a/gl/lib/windows-once.c
+++ b/gl/lib/windows-once.c
@@ -1,5 +1,5 @@
/* Once-only control (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-once.h b/gl/lib/windows-once.h
index 85534c99..54885680 100644
--- a/gl/lib/windows-once.h
+++ b/gl/lib/windows-once.h
@@ -1,5 +1,5 @@
/* Once-only control (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-recmutex.c b/gl/lib/windows-recmutex.c
index d8087ac1..a8ce9a04 100644
--- a/gl/lib/windows-recmutex.c
+++ b/gl/lib/windows-recmutex.c
@@ -1,5 +1,5 @@
/* Plain recursive mutexes (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-recmutex.h b/gl/lib/windows-recmutex.h
index 746e75c0..08ff4597 100644
--- a/gl/lib/windows-recmutex.h
+++ b/gl/lib/windows-recmutex.h
@@ -1,5 +1,5 @@
/* Plain recursive mutexes (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-rwlock.c b/gl/lib/windows-rwlock.c
index d186e037..7cbd7bb1 100644
--- a/gl/lib/windows-rwlock.c
+++ b/gl/lib/windows-rwlock.c
@@ -1,5 +1,5 @@
/* Read-write locks (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/windows-rwlock.h b/gl/lib/windows-rwlock.h
index 65c5ab49..fe8381e8 100644
--- a/gl/lib/windows-rwlock.h
+++ b/gl/lib/windows-rwlock.h
@@ -1,5 +1,5 @@
/* Read-write locks (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 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/gl/lib/wmemchr-impl.h b/gl/lib/wmemchr-impl.h
index f92a362e..96b9ad3a 100644
--- a/gl/lib/wmemchr-impl.h
+++ b/gl/lib/wmemchr-impl.h
@@ -1,5 +1,5 @@
/* Search wide character array for a wide character.
- Copyright (C) 1999, 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 1999.
This file is free software: you can redistribute it and/or modify
diff --git a/gl/lib/wmemchr.c b/gl/lib/wmemchr.c
index 127e1a52..5d282473 100644
--- a/gl/lib/wmemchr.c
+++ b/gl/lib/wmemchr.c
@@ -1,5 +1,5 @@
/* Search wide character array for a wide character.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 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/gl/lib/wmempcpy.c b/gl/lib/wmempcpy.c
index cdfa9133..6803ecb4 100644
--- a/gl/lib/wmempcpy.c
+++ b/gl/lib/wmempcpy.c
@@ -1,5 +1,5 @@
/* Copy wide character array, return pointer after last written wide character.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 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/gl/lib/xalloc-die.c b/gl/lib/xalloc-die.c
index 5b947f10..7605eee1 100644
--- a/gl/lib/xalloc-die.c
+++ b/gl/lib/xalloc-die.c
@@ -1,6 +1,6 @@
/* Report a memory allocation failure and exit.
- Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2022 Free Software
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/xalloc-oversized.h b/gl/lib/xalloc-oversized.h
index aefa6fd8..5dbdfb55 100644
--- a/gl/lib/xalloc-oversized.h
+++ b/gl/lib/xalloc-oversized.h
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2023 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/gl/lib/xalloc.h b/gl/lib/xalloc.h
index 9f4bf8d4..fb44f420 100644
--- a/gl/lib/xalloc.h
+++ b/gl/lib/xalloc.h
@@ -1,6 +1,6 @@
/* xalloc.h -- malloc with out-of-memory checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2023 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
@@ -18,18 +18,20 @@
#ifndef XALLOC_H_
#define XALLOC_H_
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _Noreturn,
+ _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_MALLOC,
+ _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stddef.h>
#include <stdlib.h>
-#include <stdint.h>
#if GNULIB_XALLOC
# include "idx.h"
-# include "intprops.h"
#endif
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XALLOC_INLINE
# define XALLOC_INLINE _GL_INLINE
@@ -48,7 +50,7 @@ extern "C" {
or by using gnulib's xalloc-die module. This is the
function to call when one wants the program to die because of a
memory allocation failure. */
-/*extern*/ _Noreturn void xalloc_die (void);
+_Noreturn void xalloc_die (void);
#endif /* GNULIB_XALLOC_DIE */
diff --git a/gl/lib/xasprintf.c b/gl/lib/xasprintf.c
index 01ad8785..5bd8684e 100644
--- a/gl/lib/xasprintf.c
+++ b/gl/lib/xasprintf.c
@@ -1,5 +1,5 @@
/* vasprintf and asprintf with out-of-memory checking.
- Copyright (C) 1999, 2002-2004, 2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1999, 2002-2004, 2006, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/xgetcwd.c b/gl/lib/xgetcwd.c
index 619c7703..6c7c3d31 100644
--- a/gl/lib/xgetcwd.c
+++ b/gl/lib/xgetcwd.c
@@ -1,6 +1,6 @@
/* xgetcwd.c -- return current directory with unlimited length
- Copyright (C) 2001, 2003-2004, 2006-2007, 2009-2022 Free Software
+ Copyright (C) 2001, 2003-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/lib/xgetcwd.h b/gl/lib/xgetcwd.h
index 65f16352..59d225e6 100644
--- a/gl/lib/xgetcwd.h
+++ b/gl/lib/xgetcwd.h
@@ -1,5 +1,5 @@
/* prototype for xgetcwd
- Copyright (C) 1995, 2001, 2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001, 2003, 2009-2023 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
@@ -14,6 +14,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* This file uses _GL_ATTRIBUTE_MALLOC. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdlib.h>
extern char *xgetcwd (void)
diff --git a/gl/lib/xmalloc.c b/gl/lib/xmalloc.c
index 993c1eeb..289cbd05 100644
--- a/gl/lib/xmalloc.c
+++ b/gl/lib/xmalloc.c
@@ -1,6 +1,6 @@
/* xmalloc.c -- malloc with out of memory checking
- Copyright (C) 1990-2000, 2002-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2002-2006, 2008-2023 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
@@ -22,10 +22,11 @@
#include "xalloc.h"
#include "ialloc.h"
-#include "intprops.h"
#include "minmax.h"
+#include <stdckdint.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
static void * _GL_ATTRIBUTE_PURE
@@ -195,7 +196,7 @@ x2nrealloc (void *p, size_t *pn, size_t s)
else
{
/* Set N = floor (1.5 * N) + 1 to make progress even if N == 0. */
- if (INT_ADD_WRAPV (n, (n >> 1) + 1, &n))
+ if (ckd_add (&n, n, (n >> 1) + 1))
xalloc_die ();
}
@@ -236,7 +237,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
N_MAX, and what the C language can represent safely. */
idx_t n;
- if (INT_ADD_WRAPV (n0, n0 >> 1, &n))
+ if (ckd_add (&n, n0, n0 >> 1))
n = IDX_MAX;
if (0 <= n_max && n_max < n)
n = n_max;
@@ -251,7 +252,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
size_t nbytes;
#endif
idx_t adjusted_nbytes
- = (INT_MULTIPLY_WRAPV (n, s, &nbytes)
+ = (ckd_mul (&nbytes, n, s)
? MIN (IDX_MAX, SIZE_MAX)
: nbytes < DEFAULT_MXFAST ? DEFAULT_MXFAST : 0);
if (adjusted_nbytes)
@@ -263,9 +264,9 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
if (! pa)
*pn = 0;
if (n - n0 < n_incr_min
- && (INT_ADD_WRAPV (n0, n_incr_min, &n)
+ && (ckd_add (&n, n0, n_incr_min)
|| (0 <= n_max && n_max < n)
- || INT_MULTIPLY_WRAPV (n, s, &nbytes)))
+ || ckd_mul (&nbytes, n, s)))
xalloc_die ();
pa = xrealloc (pa, nbytes);
*pn = n;
diff --git a/gl/lib/xsize.c b/gl/lib/xsize.c
index 761e3434..279ae824 100644
--- a/gl/lib/xsize.c
+++ b/gl/lib/xsize.c
@@ -1,6 +1,6 @@
/* Checked size_t computations.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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/gl/lib/xsize.h b/gl/lib/xsize.h
index 0bfa4c88..5b08d61f 100644
--- a/gl/lib/xsize.h
+++ b/gl/lib/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2023 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,6 +18,11 @@
#ifndef _XSIZE_H
#define _XSIZE_H
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, HAVE_STDINT_H. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get size_t. */
#include <stddef.h>
@@ -30,9 +35,6 @@
/* Get ATTRIBUTE_PURE. */
#include "attribute.h"
-#ifndef _GL_INLINE_HEADER_BEGIN
- #error "Please include config.h first."
-#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XSIZE_INLINE
# define XSIZE_INLINE _GL_INLINE
diff --git a/gl/lib/xstdopen.c b/gl/lib/xstdopen.c
index 844512a3..76d47815 100644
--- a/gl/lib/xstdopen.c
+++ b/gl/lib/xstdopen.c
@@ -1,5 +1,5 @@
/* Ensure that stdin, stdout, stderr are open.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/xstdopen.h b/gl/lib/xstdopen.h
index 0c18209e..c317bff6 100644
--- a/gl/lib/xstdopen.h
+++ b/gl/lib/xstdopen.h
@@ -1,5 +1,5 @@
/* Ensure that stdin, stdout, stderr are open.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 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/gl/lib/xstrndup.c b/gl/lib/xstrndup.c
index a420212d..2c3796e7 100644
--- a/gl/lib/xstrndup.c
+++ b/gl/lib/xstrndup.c
@@ -1,6 +1,6 @@
/* Duplicate a bounded initial segment of a string, with out-of-memory
checking.
- Copyright (C) 2003, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2023 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/gl/lib/xstrndup.h b/gl/lib/xstrndup.h
index fdd65736..58447310 100644
--- a/gl/lib/xstrndup.h
+++ b/gl/lib/xstrndup.h
@@ -1,6 +1,6 @@
/* Duplicate a bounded initial segment of a string, with out-of-memory
checking.
- Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2009-2023 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
@@ -15,6 +15,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdlib.h>
/* Return a newly allocated copy of at most N bytes of STRING.
diff --git a/gl/lib/xvasprintf.c b/gl/lib/xvasprintf.c
index faca818e..1cedfbf1 100644
--- a/gl/lib/xvasprintf.c
+++ b/gl/lib/xvasprintf.c
@@ -1,5 +1,5 @@
/* vasprintf and asprintf with out-of-memory checking.
- Copyright (C) 1999, 2002-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2004, 2006-2023 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/gl/lib/xvasprintf.h b/gl/lib/xvasprintf.h
index e5d76fd6..6a5952fa 100644
--- a/gl/lib/xvasprintf.h
+++ b/gl/lib/xvasprintf.h
@@ -1,5 +1,5 @@
/* vasprintf and asprintf with out-of-memory checking.
- Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2006-2023 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
@@ -17,6 +17,11 @@
#ifndef _XVASPRINTF_H
#define _XVASPRINTF_H
+/* This file uses _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_MALLOC. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Get va_list. */
#include <stdarg.h>