lib


Log

Author Commit Date CI Message
Paul Eggert 3d15181e 2021-03-01T00:27:25 unlocked-io: do not redefine getc_unlocked etc. I ran into this problem on AIX 7.1 with GNU Tar, which enables visibility of getc_unlocked etc. after testing whether they’re declared, causing argp-namefrob.h and unlocked-io.h to redefine the macros. * lib/argp-namefrob.h, lib/unlocked-io.h: (clearerr_unlocked, feof_unlocked ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked) (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked) (putc_unlocked, putchar_unlocked): Do not define if already defined.
Paul Eggert 4e7f59b2 2021-03-01T00:24:05 parse-datetime2: new module This splits the old parse-datetime into two parts; the first is parse-datetime2 which supports all the new bells and whistles, the second is parse-datetime, which reverts to its original intent. This avoids some bogus diagnostics when build GNU Tar with gcc -flto -fanalyze and with --enable-gcc-warnings. And it slims down the executable a bit. * NEWS: Mention this. * lib/parse-datetime.y (parser_control) [!GNULIB_PARSE_DATETIME2]: Omit parse_datetime_debug member. (debugging): New function. Use it everywhere the old code would load parse_datetime_debug. (parse_datetime_body): New static function, with the body of the old parse_datetime2. Set pc.parse_datetime_debug only if GNULIB_PARSE_DATETIME2. (parse_datetime2, parse_datetime): Use this new function. (parse_datetime2) [!GNULIB_PARSE_DATETIME2]: Remove.
Paul Eggert 5c7fc16b 2021-02-24T11:36:06 glob: include libc-config.h only if needed
Paul Eggert 494fea03 2021-02-24T10:52:59 glob: include libc-config.h in a more-standard way Inspired by Tom Tromey’s report for RHEL 6 in: https://lists.gnu.org/r/bug-gnulib/2021-02/msg00088.html * lib/glob.c [!_LIBC]: Include libc-config.h, not just config.h
Bruno Haible 75461c74 2021-02-21T21:39:07 string-buffer: New module. * lib/string-buffer.h: New file. * lib/string-buffer.c: New file. * modules/string-buffer: New file. * doc/posix-functions/open_memstream.texi: Mention the new module.
Bruno Haible df2105c7 2021-02-21T19:32:36 scratch_buffer: Document the exported API. * lib/scratch_buffer.h: Add comments, taken from lib/malloc/scratch_buffer.h.
Bruno Haible 4d4fb2be 2021-02-17T03:22:58 passfd: Fix test failure on FreeBSD >= 12 and NetBSD in 64-bit mode. * lib/passfd.c (recvfd): Use the CMSG_SPACE macro to compute the value for msg_controllen.
Paul Eggert 4b5bc7fd 2021-02-16T11:41:19 Port better to macOS Mojave Problem reported by Tom Shields in: https://lists.gnu.org/r/bug-gnulib/2021-02/msg00064.html * config/srclist.txt: Comment out dynarray_finalize.c. * lib/dynarray.h (__libc_dynarray_at_failure): Don’t include libc-config.h here, as that’s the includer’s responsibility. * lib/malloc/dynarray_at_failure.c: * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_finalize.c: * lib/malloc/dynarray_resize.c: * lib/malloc/dynarray_resize_clear.c: If _LIBC is not defined, include libc-config.h.
Bruno Haible 0a6dc302 2021-02-15T04:25:38 simple-atomic: New module. * lib/simple-atomic.h: New file. * lib/simple-atomic.c: New file, based on lib/asyncsafe-spin.c. * modules/simple-atomic: New file.
Bruno Haible 74a0cdfe 2021-02-15T03:41:12 Fix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX. * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI, gl_HOST_CPU_C_ABI_32BIT): Test __LP64__ instead of _ARCH_PPC64. * m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise. * lib/stddef.in.h: Likewise.
Bruno Haible 0b38e1d6 2021-02-08T23:18:34 stddef: Fix test-stddef compilation error on MidnightBSD/x86. * lib/stddef.in.h (_GL_STDDEF_ALIGNAS, rpl_max_align_t, max_align_t): Don't ignore HAVE_MAX_ALIGN_T if the compiler is clang.
Paul Eggert a002cbb9 2021-02-05T17:08:45 regex: fix comment location * lib/regexec.c (update_regs): Move comment.
Paul Eggert 7256c713 2021-02-05T17:08:29 regex: debug check for set member duplicates * lib/regex_internal.c (re_node_set_insert): Add a DEBUG_ASSERT that would have caught some recently-fixed performance bugs that caused sets to contain duplicate members.
Paul Eggert 70b673eb 2021-02-05T17:08:10 regex: fix longstanding backref match bug This fixes a longstanding glibc bug concerning backreferences <https://sourceware.org/11053> (2009-12-04). * lib/regexec.c (proceed_next_node, push_fail_stack) (pop_fail_stack): Push and pop the previous registers as well as the current ones. All callers changed. (set_regs): Also pop if CUR_NODE has already been checked, so that it does not get added as a duplicate set entry. (update_regs): Fix comment location. * tests/test-regex.c (tests): New constant. (bug_regex11): New test function. (main): Bump alarm value. Call new test function.
Paul Eggert f5596242 2021-02-05T16:35:46 regex: avoid duplicate in espilon closure * lib/regcomp.c (calc_eclosure_iter): Insert NODE into epsilon closure first rather than last. Otherwise, the epsilon closure might contain a duplicate of NODE.
Paul Eggert 388d9432 2021-02-05T16:35:46 regex: make it easier to merge into glibc * lib/regex_internal.h [_LIBC]: Do not include Gnulib’s dynarray.h.
Paul Eggert d6f9ba54 2021-02-05T16:35:45 regex: minor refactoring * lib/regexec.c (proceed_next_node): Use more-local decls.
Paul Eggert 37f2bbbe 2021-02-05T16:35:45 regex: avoid undefined behavior * lib/regexec.c (pop_fail_stack): If the stack is empty, return -1 instead of indulging in undefined behavior. This simplifies callers, and avoids undefined behavior in some cases (see glibc bug 11053, though this change does not fix that overall bug).
Paul Eggert 607c71a6 2021-02-05T16:35:45 regex: improve comments * lib/regexec.c: Add and correct comments about return values.
Bruno Haible 24446f2d 2021-01-31T12:42:47 relocatable-prog-wrapper: Update after recent changes. * lib/relocwrapper.c: Update comments. * modules/relocatable-prog-wrapper (Files): Add lib/scratch_buffer.h, lib/malloc/scratch_buffer*, lib/malloc.c, lib/realloc.c, lib/free.c, lib/mempcpy.c, lib/rawmemchr.c, m4/lstat.m4. Remove lib/lstat.c. (Depends-on): Add c99, eloop-threshold, fcntl-h, idx, intprops, libc-config, stddef, sys_stat. Remove alloca-opt. (configure.ac): Invoke gl_FUNC_MALLOC_POSIX, gl_FUNC_REALLOC_POSIX, gl_FUNC_FREE, gl_FUNC_MEMPCPY, gl_FUNC_RAWMEMCHR. * lib/canonicalize-lgpl.c (memmove): Undefine in the relocwrapper. * build-aux/install-reloc (func_create_wrapper): Compile also malloc/scratch_buffer_*.c, malloc.c, realloc.c, free.c, mempcpy.c, rawmemchr.c. Don't compile lstat.c.
Bruno Haible a12d5baf 2021-01-31T12:42:33 Make it possible to compile rawmemchr.c separately, unconditionally. * lib/rawmemchr.c: Don't define rawmemchr if not needed.
Bruno Haible 9c86ea67 2021-01-31T12:42:21 Make it possible to compile mempcpy.c separately, unconditionally. * lib/mempcpy.c: Don't define mempcpy if not needed.
Bruno Haible 3dfe86d1 2021-01-31T12:41:33 Make it possible to compile free.c separately, unconditionally. * m4/free.m4 (gl_FUNC_FREE): Define HAVE_FREE_POSIX. * lib/free.c: Don't define rpl_free if not needed.
Bruno Haible 64bdee09 2021-01-31T12:39:31 Make it possible to compile realloc.c separately, unconditionally. * modules/realloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/realloc.c: Don't define rpl_realloc if not needed.
Bruno Haible eae672eb 2021-01-31T12:30:18 Make it possible to compile malloc.c separately, unconditionally. * modules/malloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/malloc.c: Don't define rpl_malloc if not needed.
Bruno Haible fd71d76a 2021-01-31T12:35:45 canonicalize-lgpl: Simplify. * lib/canonicalize-lgpl.c (_GL_USE_STDLIB_ALLOC): Remove macro.
Paul Eggert 195a10b5 2021-01-23T10:19:24 libc-config: port to Xcode 7 Problem reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2021-01/msg01089.html * lib/cdefs.h (__nonnull): If already defined but glibc is not in use, override the definition with Gnulib’s _GL_ATTRIBUTE_NONNULL. This is needed for Xcode 7, which has a ‘#define __nonnull _Nonnull’ builtin for backwards-compatibility with an older Xcode syntax that GNUish code never uses.
Bastien Roucariès cd1b752f 2021-01-23T14:31:44 explicit_bzero: Add fallback for other compilers. * lib/explicit_bzero.c (explicit_bzero): For other compilers, invoke memset through a volatile function pointer.
Bastien Roucariès ac8adb39 2021-01-23T11:22:10 explicit_bzero: Add support for clang. * lib/explicit_bzero.c (explicit_bzero): Add a compiler barrier for clang.
Paul Eggert 605e20a6 2021-01-21T13:40:16 Port FALLTHROUGH to clang 3.4 and earlier Problem reported by Akim Demaille in: https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html * lib/cdefs.h (__glibc_has_attribute): * m4/gnulib-common.m4 (gl_COMMON_BODY): Do not trust __has_attribute in clang 3.4 and earlier, as <https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html> says that __has_attribute is unreliable in these old versions.
Simon Josefsson 44ed0db8 2021-01-20T11:50:21 gc-random: Replace implementation with call to getrandom. * lib/gc-gnulib.c [GNULIB_GC_RANDOM]: Replace #include's with those needed for getrandom. (gc_init): Remove old randomness code. (gc_done): Likewise. (randomize): Rewrite using getrandom, inspired by getentropy. * m4/gc-random.m4: Remove file. * modules/crypto/gc-random: Drop gc-random.m4, gl_GC_RANDOM, and LIB_GC_RANDOM. Add conditional dependency on getrandom. * modules/crypto/gc-tests (test_gc_LDADD): Drop LIB_GC_RANDOM.
Paul Eggert 5c52f00c 2021-01-19T18:35:30 fnmatch, regex, fts: FALLTHROUGH consistency Be more consistent about how FALLTHROUGH is defined. For Gnulib, use attribute.h. For glibc, use __GNUC__ >= 7. Problem for glibc reported by Vaseeharan Vinayagamoorthy in: https://sourceware.org/pipermail/libc-alpha/2021-January/121778.html * lib/fnmatch.c (FALLTHROUGH) [_LIBC]: * lib/regex_internal.h (FALLTHROUGH) [_LIBC]: Don’t worry about Clang, as it’s not needed and provokes GCC. * lib/fts.c (FALLTHROUGH) [!_LIBC]: * lib/regex_internal.h (FALLTHROUGH) [!_LIBC]: Rely on attribute.h for FALLTHROUGH * modules/regex: Depend on attribute module.
KO Myung-Hun 2ef5a9b4 2021-01-19T01:40:13 spawn-pipe: Fix SIGSEGV on OS/2 kLIBC. * lib/spawn-pipe.c [OS/2 kLIBC]: Check directory correctly if it means a current directory.
KO Myung-Hun 9cd9d631 2021-01-19T19:23:39 dirent: Fix compilation error in C++ mode on OS/2 kLIBC. * lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function always.
KO Myung-Hun 4abfff40 2021-01-19T01:40:09 stddef: Fix compilation for max_align_t on OS/2 kLIBC. * lib/stddef.in.h [OS/2 kLIBC]: Include <cstddef> in C++ mode.
KO Myung-Hun 516eb87e 2021-01-19T18:41:09 sched_yield: Implement for OS/2 kLIBC. * lib/sched_yield.c (sched_yield) [OS/2 kLIBC]: New implementation.
KO Myung-Hun 6d07b345 2021-01-19T01:40:07 spawn: Use special invocation for <spawn.h> on OS/2 kLIBC. * lib/spawn.in.h: Use special invocation to include <spawn.h> properly on OS/2 kLIBC.
Bruno Haible ee634876 2021-01-18T00:32:52 immutable: Implement on native Windows. * lib/immutable.h (IMMUTABLE_EFFECTIVE): Set to 1 on native Windows. * lib/immutable.c: Include <windows.h>. (CreateFileMapping): New macro. (init_pagesize, init_mmap_file, alloc_pages, free_pages): Add implementation for native Windows.
Bruno Haible 6ee6c718 2021-01-17T22:07:14 canonicalize-lgpl: Work around // handling in realpath() of musl 1.2.2. Reported by Natanael Copa <ncopa@alpinelinux.org> in <https://lists.gnu.org/archive/html/bug-gettext/2021-01/msg00021.html>. * m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Add a test whether // is the same as /, on Linux only. * lib/canonicalize-lgpl.c: Correct indentation of preprocessor directives. * doc/posix-functions/realpath.texi: Mention the musl 1.2.2 bug.
Bruno Haible ee313987 2021-01-16T19:14:35 vma-iter: Port to 64-bit Haiku. * lib/vma-iter.c (vma_iterate): Adapt to changed signature of get_next_area_info.
Paul Eggert af586b72 2021-01-13T15:46:33 verify: simplify static_assert configuration * lib/verify.h (_GL_HAVE__STATIC_ASSERT, _GL_HAVE__STATIC_ASSERT1): Do not define for C++. This should be good enough nowadays, since recent-enough C++ compilers have static_assert. (_GL_HAVE_STATIC_ASSERT_CXX11, _GL_HAVE_STATIC_ASSERT_CXX17): Remove. All uses replaced by simply checking __cpp_static_assert.
Bruno Haible 8a10202d 2021-01-12T21:11:13 verify: Use C++11 static_assert when available. Reported by Alexandre Duret-Lutz <adl@lrde.epita.fr> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00177.html>. * lib/verify.h (_GL_HAVE_STATIC_ASSERT_CXX11): New macro. (_GL_HAVE_STATIC_ASSERT_CXX17): Renamed from _GL_HAVE_STATIC_ASSERT1. (_GL_VERIFY): Use static_assert when available with C++11 syntax.
Paul Eggert 854fbb81 2021-01-11T16:46:12 tempname: consume less entropy Derived from a glibc patch proposed by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2021-January/121302.html * lib/tempname.c: Include stdbool.h. (random_bits): New arg use_getrandom. (try_tempname_len): Skip getrandom on the first try, unless __GT_NOCREATE. * modules/tempname (Depends-on): Add stdbool.
Bruno Haible 9f87c80a 2021-01-10T01:13:04 immutable: New module. * lib/immutable.h: New file. * lib/immutable.c: New file. * m4/immutable.m4: New file. * m4/mprotect.m4: New file, based on libffcall/m4/codeexec.m4. * modules/immutable: New file.
Paul Eggert 077ffc1e 2021-01-09T14:17:32 snippet/_Noreturn: port to pedantic clang Problem reported by Joe Nelson in: https://lists.gnu.org/r/bug-gnulib/2021-01/msg00152.html * doc/noreturn.texi: Improve. * lib/_Noreturn.h (_Noreturn): * m4/gnulib-common.m4 (gl_COMMON_BODY): Do not assume _Noreturn works as-is when __STRICT_ANSI__ is defined, unless __STDC_VERSION__ indicates C11 or later. * lib/_Noreturn.h (_Noreturn): Fall back on __attribute__ ((__noreturn__)) if Clang; this merges the 2020-08-10T23:53:13Zbruno@clisp.org patch to m4/gnulib-common.m4.
Bruno Haible c738b11c 2021-01-09T08:20:17 fchmodat: Work around trailing slash bug in fchmodat() on AIX 7.2. * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): In the test whether fchmodat works, also test for the trailing slashes behaviour. Define HAVE_NEARLY_WORKING_FCHMODAT if this is the only missing feature. * lib/fchmodat.c (fchmodat): If HAVE_NEARLY_WORKING_FCHMODAT, handle trailing slashes here. * modules/fchmodat (Depends-on): Sort by condition, not alphabetically. * doc/posix-functions/fchmodat.texi: Document the AIX bug.
Paul Eggert 6a00fdb4 2021-01-08T19:50:16 dynarray: work even if ‘free’ is replaced Problem reported by Darshit Shah in: https://lists.gnu.org/r/bug-gnulib/2021-01/msg00140.html * lib/malloc/dynarray-skeleton.c (DYNARRAY_FREE): New macro. Use it everywhere instead of DYNARRAY_NAME (free).
Paul Eggert b0ebaf83 2021-01-08T17:54:30 tempname: don’t block for minutes Derived from a patch proposed by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2021-January/121302.html * lib/tempname.c (random_bits): Use GRND_NONBLOCK.
Paul Eggert 551b70f4 2021-01-08T17:31:28 tempname: sync with proposed glibc patch This is from Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2021-January/121301.html * lib/tempname.c (__lxstat64): Remove. (__lstat64, __stat64): New replacement macros. All uses changed.
Paul Eggert 87ed1f9c 2021-01-08T17:17:32 regex: stop using alloca * lib/regex_internal.h: Do not include <alloca.h> or define __libc_use_alloca or alloca. Patch written by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121374.html * modules/regex (Depends-on): Remove alloca-opt.
Paul Eggert 1731fef3 2021-01-08T14:22:15 regexec: remove alloca usage in build_trtable Prompted by this different change proposed by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121373.html * lib/regexec.c (build_trtable): Prevent inlining, so that it doesn’t bloat the caller’s stack. Use auto variables instead of alloca/malloc. After these changes, build_trtable’s total stack allocation is only 20 KiB on a 64-bit machine, and this is less than glibc’s 64 KiB cutoff so there’s little point to using alloca to shrink it. Although Gnulib traditionally has used a 4 KiB cutoff, going to 20 KiB here should not be a significant problem in practice; Gnulib-using packages concerned about overflow of tiny stacks can compile with something like gcc -fstack-clash-protection. * config/srclist.txt: Comment out regexec.c for now.
Paul Eggert b0e441b8 2021-01-08T12:01:37 scratch_buffer: add scratch_buffer_dupfree macro * lib/scratch_buffer.h (__libc_scratch_buffer_dupfree): New macro, needed to support recent changes in this module.
Paul Eggert b6207ab3 2021-01-08T12:00:09 regex: remove alloca usage on regex set_regs Derived from this patch by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121372.html * lib/regex_internal.h: Include dynarray.h, for Gnulib. * lib/regexec.c (DYNARRAY_STRUCT, DYNARRAY_ELEMENT) (DYNARRAY_PREFIX): New macros. Include malloc/dynarray-skeleton.c. (set_regs): Use dynarray rather than alloca. * modules/regex (Depends-on): Add dynarray.
Paul Eggert 921d2ea1 2021-01-08T11:44:19 dynarray: new module * config/srclist.txt: Mention the new files. * lib/cdefs.h (__attribute_maybe_unused__): New macro, like Gnulib’s _GL_ATTRIBUTE_MAYBE_UNUSED but with glibc naming conventions. * lib/libc-config.h: Use it instead of __glibc_likely. * lib/dynarray.h, modules/dynarray: New files. * lib/malloc/dynarray-skeleton.c, lib/malloc/dynarray.h: * lib/malloc/dynarray_at_failure.c: * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_finalize.c, lib/malloc/dynarray_resize.c: * lib/malloc/dynarray_resize_clear.c, modules/dynarray: New files, from glibc with the following changes needed for portability to compilers that are not recent-enough GCC. * lib/malloc/dynarray_at_failure.c: Include stdlib.h, for abort. (__libc_dynarray_at_failure) [!_LIBC]: Simply abort. * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_resize.c: Include intprops.h, and use INT_MULTIPLY_WRAPV instead of __builtin_mul_overflow. * lib/malloc/dynarray.h (__libc_dynarray_at_failure): Use _Noreturn instead of __attribute__ ((noreturn)). * lib/malloc/dynarray_resize_clear.c: Do not include stdlib.h; it’s not needed. (__libc_dynarray_resize_clear): Do not do arithmetic on void *. * lib/malloc/dynarray-skeleton.c (struct DYNARRAY_STRUCT): Do not use anonymous unions, as they are not in C99. All uses changed. Use __nonnull (X) instead of __attribute__ ((nonnull X)), and __attribute_maybe_unused__ instead of __attribute__ ((unused)).
Bruno Haible 6047713a 2021-01-07T22:55:41 localename: Fix link error with duplocale on AIX 7.2 (regr. 2019-12-18). * m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Initialize LOCALENAME_ENHANCE_LOCALE_FUNCS. * m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): Set gt_working_uselocale. (gt_INTL_THREAD_LOCALE_NAME): Set gt_fake_locales, gt_good_uselocale, gt_localename_enhances_locale_funcs, LOCALENAME_ENHANCE_LOCALE_FUNCS. Define HAVE_GOOD_USELOCALE, LOCALENAME_ENHANCE_LOCALE_FUNCS. * m4/localename.m4 (gl_LOCALENAME): Test gt_localename_enhances_locale_funcs instead of gt_nameless_locales. * modules/locale (Makefile.am): Substitute LOCALENAME_ENHANCE_LOCALE_FUNCS. * lib/locale.in.h (newlocale, duplocale, freelocale): Don't override if module 'localename' is in use but LOCALENAME_ENHANCE_LOCALE_FUNCS is 0. * lib/localename.c (HAVE_GOOD_USELOCALE): Don't define here. (get_locale_t_name, newlocale, duplocale, freelocale): Define if LOCALENAME_ENHANCE_LOCALE_FUNCS.
Paul Eggert a4be4b42 2021-01-06T10:02:33 libc-config: simplify clang __has_* macros cdefs.h sometimes used names like __glibc_clang_has_attribute and sometimes __glibc_has_attribute. There is no need in glibc or Gnulib to distinguish clang from other compilers here, so be consistent and use the simpler names. * lib/cdefs.h (__glibc_has_builtin, __glibc_has_extension): Rename from __glibc_clang_has_builtin, __glibc_clang_has_extension. All uses changed. (__glibc_clang_has_attribute): Remove. All uses replaced by __glibc_has_attribute. * lib/libc-config.h [!__glibc_likely]: Undef them here too. This fixes a problem where __glibc_has_attribute was not undeffed.
Bruno Haible 9b8b302f 2021-01-06T11:59:57 ilogbl: Fix compilation error with xlclang on AIX 7.2. * lib/math.in.h (ilogbl): Undefine macro before declaration.
Bruno Haible c6d61838 2021-01-06T07:23:14 pipe-filter-gi: Fix test failure on AIX 7.2. * lib/pipe-filter-aux.h (SSIZE_MAX) [AIX]: Set to 4096.
Bruno Haible 05bee3e8 2021-01-06T06:16:22 utimens, utimensat, fdutimensat: Avoid test failures on AIX 7.2. * lib/utimecmp.c (utimecmpat): On AIX, declare equality when the two times differ by less than 0.01 seconds. * tests/test-futimens.h (test_futimens): Pass UTIMECMP_TRUNCATE_SOURCE flag.
Bruno Haible 9333dcf6 2021-01-06T02:08:41 utimensat: Work around trailing slash bug in utimensat() on AIX 7.2. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Require AC_CANONICAL_HOST. Add a test for trailing slash handling. Improve cross-compilation guesses. Conditionally define HAVE_NEARLY_WORKING_UTIMENSAT. * lib/utimensat.c (rpl_utimensat): Add alternative implementation when HAVE_NEARLY_WORKING_UTIMENSAT is defined. * lib/utimens.c: Use the overridden utimensat when HAVE_NEARLY_WORKING_UTIMENSAT is defined. * doc/posix-functions/utimensat.texi: Mention the AIX bug.
Paul Eggert 776af40e 2021-01-05T13:12:39 libc-config: merge from glibc Use a better way of keeping glibc <sys/cdefs.h> and gnulib lib/cdefs.h mostly in sync, by using lib/cdefs.h only on platforms where <sys/cdefs.h> does not work well enough for Gnulib. * lib/cdefs.h: Go back to using _SYS_CDEFS_H rather than _GL_DEFS_H as an include guard. (__THROW, __THROWNL, __NTH, __NTHNL): Define to noexcept for C++11 and later. (__glibc_objsize, __glibc_objsize0): New, for _FORTIFY_SOURCE=3. (__warndecl): Remove. (__attribute_copy__): New macro, for GCC 9 support. (__LDBL_REDIR, __LDBL_REDIR_DECL, __LDBL_REDIR1) (__LDBL_REDIR1_DECL, __LDBL_REDIR1_NTH, __REDIRECT_NTH_LDBL) (__REDIRECT_LDBL, __LDBL_REDIR_NTH): Redirections for IEEE long double on powerpc64le. (__LDBL_REDIR2_DECL): New macro. (__attr_access): New macro, for GCC 10 bounds checking. (__attribute_returns_twice__): New macro, for setjmp etc. * lib/libc-config.h: Include <cdefs.h> only if __glibc_likely is undefined. The following changes apply only if __glibc_likely is not defined. (__LDBL_REDIR2_DECL, __attr_access, __attribute_returns_twice__) (__glibc_clang_has_attribute, __glibc_clang_has_extension) (__glibc_objsize, __glibc_objsize0): Undef these new (or newer) <cdefs.h> macros. (__P, __PMT, __always_inline): Do not undef, since cdefs.h does that. (__glibc_likely): Do not undef, since this is inside ifndef __glibc_likely. (__warndecl): Do not undef; no longer defined.
Bruno Haible 25a7d014 2021-01-05T07:55:01 truncate: Work around trailing slash bug in truncate() on AIX 7.2. * m4/truncate.m4 (gl_FUNC_TRUNCATE): Add a test whether truncate rejects trailing slashes. Set REPLACE_TRUNCATE and define TRUNCATE_TRAILING_SLASH_BUG if not. * lib/truncate.c (orig_truncate): New function. (truncate): Add alternative implementation when TRUNCATE_TRAILING_SLASH_BUG is defined. * modules/truncate (Depends-on): Add sys_stat, stat.
Bruno Haible e182feb2 2021-01-05T07:15:09 ffsll: Override completely broken implementation on AIX in 32-bit mode. * m4/ffsll.m4 (gl_FUNC_FFSLL): Test whether ffsll minimally works. If not, set REPLACE_FFSLL. * lib/string.in.h (ffsll): Consider REPLACE_FFSLL. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Initialize REPLACE_FFSLL. * modules/string (Makefile.am): Substitute REPLACE_FFSLL. * modules/ffsll (Depends-on, configure.ac): Consider REPLACE_FFSLL. * doc/glibc-functions/ffsll.texi: Mention the AIX 7.2 bug.
Bruno Haible 3d1894d8 2021-01-05T05:37:50 symlinkat: Fix trailing slash handling. * lib/symlinkat.c (rpl_symlinkat): Don't follow symlinks during the trailing slash handling. * modules/symlinkat (Depends-on): Update conditions.
Bruno Haible 34b407ca 2021-01-05T05:22:54 link: Improve trailing slash handling on native Windows. * lib/link.c (link): If stat() fails, provide a better errno.
Bruno Haible f120c3d0 2021-01-05T04:48:20 mkfifoat: Work around trailing slash bug in mknodat() on AIX 7.2. * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Set also REPLACE_MKNODAT. * lib/sys_stat.in.h (mknodat): Consider REPLACE_MKNODAT. * lib/mknodat.c: Add an overriding implementation of mknodat(). * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_MKNODAT. * modules/sys_stat (Makefile.am): Substitute REPLACE_MKNODAT. * modules/mkfifoat (Depends-on, configure.ac): Consider REPLACE_MKNODAT. * doc/posix-functions/mknodat.texi: Mention the AIX bug.
Bruno Haible 5e6fdcd6 2021-01-05T04:23:48 mkfifoat: Work around trailing slash bug in mkfifoat() on AIX 7.2. * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Add a test whether mkfifoat rejects trailing slashes. Set REPLACE_MKFIFOAT if not. * lib/sys_stat.in.h (mkfifoat): Consider REPLACE_MKFIFOAT. * lib/mkfifoat.c: Add an overriding implementation of mkfifoat(). * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_MKFIFOAT. * modules/sys_stat (Makefile.am): Substitute REPLACE_MKFIFOAT. * modules/mkfifoat (Depends-on): Add fstatat. (configure.ac): Consider REPLACE_MKFIFOAT. * doc/posix-functions/mkfifoat.texi: Mention the AIX bug.
Bruno Haible 9a6782ac 2021-01-05T04:12:08 libc-config: Avoid overriding the headers from an installed newer glibc. Reported by Paul E Murphy <murphyp@linux.ibm.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00106.html>. * lib/cdefs.h: Use a different include guard than glibc's <sys/cdefs.h>. * lib/libc-config.h: Update accordingly.
Bruno Haible 1dd848e8 2021-01-05T02:02:36 libc-config: Avoid overriding the headers from an installed newer glibc. Reported by Paul E Murphy <murphyp@linux.ibm.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00106.html>. * lib/cdefs.h: Use a different include guard than glibc's <sys/cdefs.h>.
Bruno Haible e1e8bf6b 2021-01-04T22:39:23 nstrftime, time_rz: Avoid using an obsolete Autoconf macro. Reported by Mike Gran <spk121@yahoo.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00067.html>. * lib/time-internal.h: Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE. * lib/time_rz.c: Likewise. * lib/nstrftime.c: Set and test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE. * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Update comments.
Bruno Haible ae9fb3d6 2021-01-04T08:02:18 ffsl, ffsll: Work around AIX 7.2 problem. * lib/string.in.h: On AIX, include <strings.h> for the declarations of ffsl and ffsll. * doc/glibc-functions/ffsl.texi: Document the AIX 7.2 problem. * doc/glibc-functions/ffsll.texi: Likewise.
Bruno Haible 7a30314c 2021-01-04T07:58:03 ssfmalloc: Fix includes. * lib/ssfmalloc.h: Include <strings.h>, for ffs(). * tests/test-ssfmalloc.c: Include <string.h>, for memset().
Karl Berry c6c44fdd 2021-01-03T10:40:57 autoupdate
Bruno Haible 8f8078d7 2021-01-03T13:38:03 stddef: Override wrong max_align_t on AIX 7 with xlc in 64-bit mode. * m4/stddef_h.m4 (gl_STDDEF_H): Make check for good max_align_t stricter: Add tests for offsetof-based alignof. * lib/stddef.in.h (max_align_t): Override on AIX in 64-bit mode. * doc/posix-headers/stddef.texi: Document the AIX max_align_t bug.
Bruno Haible 5d1dafd8 2021-01-03T11:19:22 free-posix: Work around GCC mis-optimization bug. Code by Bernhard Voelker <mail@bernhard-voelker.de>. * lib/free.c (rpl_free): Add alternative complicated code for GCC.
Bruno Haible ebaa53c5 2021-01-02T19:31:45 utimensat: Fix test failures on macOS 10.13. * lib/utimensat.c: Include <string.h>, <sys/stat.h>. (rpl_utimensat): Check against invalid tv_nsec values. Before calling utimensat, recognize a filename ending in a slash that does not point to a directory.
Bruno Haible ada3ec93 2021-01-02T19:21:35 utimens: Fix test failure on macOS 10.13. * lib/utimens.c: Include <string.h>.
Bruno Haible 86c8ff74 2021-01-02T18:59:12 utimens: Fix test failure on macOS 10.13. * lib/utimens.c (fdutimens): Before calling utimensat, recognize a filename ending in a slash that does not point to a directory.
Bruno Haible b4ef486f 2021-01-02T16:54:21 renameatu: Fix test failures on macOS. Reported by Martin Storsjö <martin@martin.st> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00003.html>. * lib/renameatu.c (renameatu): Don't call renameatx_np right away. Instead, treat it as a variant of renameat, with all possible bugs that renameat might have.
Bruno Haible caf114a3 2021-01-02T13:14:08 timespec_get: New module. * lib/time.in.h (timespec_get): New declaration. * lib/timespec_get.c: New file. * m4/timespec_get.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_TIMESPEC_GET, HAVE_TIMESPEC_GET. * modules/time (Makefile.am): Substitute GNULIB_TIMESPEC_GET, HAVE_TIMESPEC_GET. * modules/timespec_get: New file. * tests/test-time-c++.cc (timespec_get): Check signature. * doc/glibc-functions/timespec_get.texi: Mention the new module.
Bruno Haible 2d4f9d5c 2021-01-02T00:14:05 time: Define TIME_UTC. * lib/time.in.h (TIME_UTC, GNULIB_defined_TIME_UTC): New macros. * m4/time_h.m4 (gl_HEADER_TIME_H_BODY): Set TIME_H_DEFINES_TIME_UTC. * modules/time (Makefile.am): Substitute TIME_H_DEFINES_TIME_UTC. * tests/test-time.c: Check that TIME_UTC is defined and a positive integer. * doc/posix-headers/time.texi: Mention TIME_UTC.
Paul Eggert fb681271 2021-01-01T15:54:43 canonicalize: remove NARROW_ADDRESSES optimization * lib/canonicalize-lgpl.c, lib/canonicalize.c (NARROW_ADDRESSES): Remove, and remove all uses, as the optimization is arguably not worth the extra complexity. Suggested by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2020-December/121203.html
Karl Berry 364b7a2c 2021-01-01T10:08:05 autoupdate
Paul Eggert ccaeb4ac 2021-01-01T09:27:54 libc-config: port to Sun C 5.9 * lib/libc-config.h (libc_hidden_proto): Omit ", ..." in macro definition. It’s not needed for Gnulib and elicits a diagnostic from Sun C 5.9 Patch 124867-12 2009/11/22.
Bruno Haible be147a9b 2021-01-01T12:50:28 maint: Update copyright notices in --version output. List the most recent year in which changes were made, per <https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html>. * build-aux/declared.sh (func_version): Say 2019. * build-aux/libtool-next-version (func_version): Likewise. * build-aux/run-test (func_version): Likewise. * check-module (COPYRIGHT_NOTICE): Say 2012. * lib/git-merge-changelog.c (main): Say 2020.
Paul Eggert 4b948321 2021-01-01T07:28:52 maint: run 'make update-copyright'
Paul Eggert e0f5efe2 2020-12-31T23:24:28 autoupdate
Paul Eggert 2305758b 2020-12-31T19:29:08 filename: change filename.h comment to LGPLv2.1+ * lib/filename.h: Change license notice to match what should be in glibc, and what modules/filename specifies. This is to simplify syncing with glibc.
Bruno Haible 3ea6fc6e 2021-01-01T01:12:08 ptsname_r: Fix test failure on Solaris. * lib/ptsname_r.c (__ptsname_r) [__sun]: Don't test the major number of the device.
Paul Eggert 453d130d 2020-12-31T13:35:53 fnmatch: merge from glibc + proposal This merges the change proposed by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2020-December/121212.html which fixes a Gnulib bug that led to a failed assert. * lib/fnmatch_loop.c (EXT): Use signed level, not unsigned, and check that it stays nonnegative. Use __flexarr instead of FLEXIBLE_ARRAY_MEMBER, to port better to glibc. * tests/test-fnmatch.c (main): New test cases, taken from glibc.
Paul Eggert 4e609740 2020-12-31T09:05:13 glob: merge proposed glibc changes This merges the change proposed by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2020-December/121211.html * lib/glob.c (__lstat64, __stat64) [_LIBC]: Remove.
Bruno Haible 3374e597 2020-12-31T22:18:05 memalign: Work around Solaris bug. * lib/memalign.c: New file. * m4/memalign.m4: New file. * modules/memalign (Files): Add them. (Depends-on): Add malloc-h. (configure.ac): Invoke gl_FUNC_MEMALIGN. Conditionally compile memalign.c. Set module indicator. (Include): Include <malloc.h> unconditionally. * doc/glibc-functions/memalign.texi: Mention the Solaris issues.
Bruno Haible ee523efd 2020-12-31T22:16:52 malloc-h: New module. * lib/malloc.in.h: New file. * m4/malloc_h.m4: New file. * modules/malloc-h: New file. * doc/glibc-headers/malloc.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it.
Bruno Haible d943f7dc 2020-12-31T19:41:32 unistd: Fix portability warnings. * lib/unistd.in.h (fchownat, unlinkat): Fix module name in warning.
Karl Berry 4e4a6390 2020-12-31T08:41:43 autoupdate
Karl Berry 6c5b0e02 2020-12-31T08:40:57 autoupdate
Bruno Haible 6a76832d 2020-12-31T17:16:57 utime: Fix compilation error on macOS and Solaris 9 (regr. 2020-12-24). Reported by Tom G. Christensen <tgc@jupiterrise.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00295.html>. * lib/utime.c: Include <errno.h>.
Paul Eggert 93e0186d 2020-12-29T22:17:46 * lib/canonicalize-lgpl.c (realpath_stk): Set errno properly.
Jim Meyering 7fa20301 2020-12-29T19:34:55 hash: add casts-to-float to avoid clang-10 warnings * lib/hash.c (compute_bucket_size): Cast SIZE_MAX to float to avoid this warning from clang-10 (for use in grep): hash.c:501:11: error: implicit conversion from 'unsigned long' \ to 'float' changes value from 18446744073709551615 to \ 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] if (SIZE_MAX <= new_candidate) (hash_insert_if_absent): Likewise.
Paul Eggert 649e713c 2020-12-29T19:34:59 canonicalize: fix size overflow treatment This also has some minor cleanups. * lib/canonicalize-lgpl.c, lib/canonicalize.c: No need to include stddef.h, since the code no longer refers directly to ptrdiff_t. * lib/canonicalize-lgpl.c (realpath_stk): * lib/canonicalize.c (canonicalize_filename_mode_stk): Treat size overflow like other out-of-memory. * lib/canonicalize.c: No need to include stdlib.h, since the code no longer refers to stdlib.h functions (other than those that canonicalize.h must declare). * lib/canonicalize.c (canonicalize_filename_mode_stk): Do not bother terminating the string result on error.