modules


Log

Author Commit Date CI Message
Paul Eggert 2533aa89 2021-08-06T15:08:27 glob: merge from glibc * lib/glob-libc.h, lib/glob.c: Merge changes from glibc 2.34. The result should be copyable directly into glibc. * modules/glob-h (glob-libc.gl.h): Also omit __THROWNL.
Paul Eggert 786bb6fb 2021-07-30T12:56:24 gnulib-common: update for C2x 2020-12-11 draft Use blessed-by-draft-standard way to test for [[__deprecated__]] etc.; this is supported by GCC 11 and the fallback code should work fine with GCC 10 and earlier, clang, etc. * NEWS, doc/attribute.texi: Mention that DEPRECATED etc. must now come first. * lib/fflush.c, lib/unistr.in.h: Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER (after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before parameters). Although perhaps we need a shorter name for _GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in gnulib-common.m4, due to the ubiquity of this issue. And perhaps the snippet/unused-parameter module should be marked obsolete since it's no longer compatible with its old use. * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro _GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in deciding whether to use C2x attributes like [[__deprecated__]]. (_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED. (_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x [[maybe_unused]] do not work. (_GL_UNUSED, _GL_UNUSED_LABEL): Use it. * modules/fflush, modules/unistr/base (Depends-on): Remove snippet/unused-parameter. * modules/fflush (selinux/selinux.h, selinux/context.h) (selinux/label.h): Do not use $(UNUSED_PARAMETER). Remove useless chmod a-x.
Bruno Haible ec87cff2 2021-07-25T13:18:20 Assume GNU gettext >= 0.17. * modules/vasprintf (Notice): Remove. * modules/xvasprintf (Notice): Remove. * modules/xprintf (Notice): Remove. * modules/error (Notice): Remove. * modules/verror (Notice): Remove. * modules/argp (Notice): Remove. * modules/propername (Notice): Remove. * lib/propername.h: Remove outdated comment.
Paul Eggert 07be6b74 2021-07-17T17:55:18 posixtm: pacify latest GCC Also, modernize while I’m at it. * lib/posixtm.c: Include c-ctype.h, idx.h, intprops.h, verify.h instead of stdlib.h. (ISDIGIT): Remove. All uses replaced by c_isdigit. (year, posix_time_parse): Prefer idx_t to size_t. Use assume instead of abort. (posixtime): Do not parse twice; once is enough. That way, we needn’t worry about a bogus warning about strcpy overrunning a buffer from GCC 11.1.1 20210531 (Red Hat 11.1.1-3) x86-64 when coreutils is configured with --enable-gcc-warnings. * modules/posixtm (Depends-on): Add c-ctype, intprops, verify. Remove stpcpy.
Paul Eggert dc09dc08 2021-07-01T19:29:57 year2038: support glibc 2.34 _TIME_BITS=64 In glibc 2.34 on Linux kernels where time_t is traditionally 32-bit, defining _FILE_OFFSET_BITS=64 and _TIME_BITS=64 makes time_t 64-bit. Apps must define both macros. Gnulib applications that use either the largefile or the year2038 modules will want this behavior; largefile because it deals with the off_t and ino_t components of struct stat already, and so should also deal with time_t. * NEWS, doc/largefile.texi, doc/posix-headers/time.texi: Mention this. * m4/largefile.m4: Override two macros even in Autoconf 2.70 and later. (_AC_SYS_LARGEFILE_MACRO_VALUE): #undef $1 before #defining it, in case some other Gnulib macro has #defined it. (AC_SYS_LARGEFILE): Use AS_IF and AS_CASE to propagate AC_REQUIREs. Invoke gl_YEAR2038_BODY if we need to set _FILE_OFFSET_BITS=64. * m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): New macro. (gl_YEAR2038_BODY): New macro, with gl_YEAR2038’s old body; this macro is designed to be used directly instead of being AC_REQUIREd. It takes an argument specifying whether 64-bit is required. Set _TIME_BITS=64 if this makes a difference in time_t width when setting _FILE_OFFSET_BITS=64. Do not warn about 32-bit time_t more than once. * modules/largefile (Files): Add year2038.m4. (Depends-on): Require gl_YEAR2038_EARLY.
Paul Eggert a1b12914 2021-07-01T11:26:13 relocatable-prog-wrapper: add m4 files Add .m4 files needed for standalone relocatable-prog-wrapper, so that ‘./gnulib-tool --test relocatable-prog-wrapper’ does not fail with diagnostics like ‘configure.ac:63: error: possibly undefined macro: gl_FUNC_MALLOC_POSIX’. * modules/relocatable-prog-wrapper (Files): Add m4/free.m4, m4/malloc.m4, m4/mempcpy.m4, m4/rawmemchr.m4, m4/realloc.m4.
Bruno Haible 3f9e15ab 2021-06-20T03:14:22 unitypes: Fix trouble caused by installed older versions of unitypes.h. * modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.
Bruno Haible 325ee4c2 2021-06-16T15:17:17 tsearch: Relicense under LGPLv2+. * modules/tsearch (License): Change to LGPLv2+. * lib/tsearch.c: Update license notice.
Bruno Haible d2d3a619 2021-06-15T13:14:58 xnanosleep: Improve module description. * modules/xnanosleep (Description): Improve. * lib/xnanosleep.h: Add comment. Make includable from C++. * lib/xnanosleep.c: Update comment.
Bruno Haible 8275fa2e 2021-06-15T13:07:51 xfreopen: Improve module description. * modules/xfreopen (Description): Improve. * lib/xfreopen.h: Add comments. Make includable from C++. * lib/xfreopen.c: Update comment.
Bruno Haible f44eb378 2021-06-13T22:31:03 Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11). Reported by Paul Eggert. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize GNULIB_UNISTD_H_GETOPT variable. * modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT variable. * modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix} processing done by gnulib-tool since 2021-04-11. * gnulib-tool: Revert last change. * pygnulib/GLEmiter.py: Likewise.
Paul Eggert 2a8a1e30 2021-06-11T17:18:57 linebuffer: prefer idx_t for indexes * lib/linebuffer.c (readlinebuffer_delim): * lib/linebuffer.h (struct linebuffer): Prefer idx_t to size_t for indexes, using idx_t-related allocators. * lib/linebuffer.h: Include idx.h. * modules/linebuffer (Depends-on): Add idx.
Paul Eggert 40a031df 2021-06-11T17:18:57 dirname: prefer idx_t for some indexes * lib/basename.c (base_name): Prefer idx_t to size_t for indexes, and use idx_t-related allocators. * lib/basename.c: Do not include xstrndup.h. (basename): Simplify by always using memcpy. * modules/dirname (Depends-on): Removbe xstrndup.
Paul Eggert 61d86624 2021-06-11T17:18:57 xalloc: new idx_t-based allocators This is for code that prefers to use idx_t for sizes. * lib/xalloc.h (ximalloc, xizalloc, xicalloc, xirealloc) (xireallocarray, ximemdup, ximemdup0) [GNULIB_XALLOC]: New decls. (x2nrealloc): Now just a decl, as the body is moved into xmalloc.c. * lib/xmalloc.c: Include ialloc.h. Rename some local parameters to be consistent with the .h files. (nonnull): New static function. (xmalloc, xcalloc): Simplify by using nonnull. (ximalloc, xirealloc, xireallocarray, xizalloc, xicalloc) (ximemdup, ximemdup0): New functions. (x2nrealloc): Moved here from xalloc.h. * modules/xalloc (Depends-on): Add ialloc.
Paul Eggert f1698a70 2021-06-11T17:18:57 ialloc: new module * lib/ialloc.c, lib/ialloc.h, modules/ialloc: New files.
Bruno Haible 51657ac8 2021-06-08T02:32:41 dynarray, scratch_buffer: Fix VPATH builds (regression from yesterday). * modules/dynarray (configure.ac): Invoke AC_PROG_MKDIR_P. (Makefile.am): Create malloc/ directory before creating malloc/dynarray.gl.h and malloc/dynarray-skeleton.gl.h. * modules/scratch_buffer (configure.ac): Invoke AC_PROG_MKDIR_P. (Makefile.am): Create malloc/ directory before creating malloc/scratch_buffer.gl.h.
Bruno Haible 469f9f36 2021-06-07T00:56:50 scratch_buffer: Avoid conflict with prepr. macros owned by the system. * lib/scratch_buffer.h: Don't include <libc-config.h>. Define _GL_LIKELY, _GL_UNLIKELY. Include malloc/scratch_buffer.gl.h instead of malloc/scratch_buffer.h. * modules/scratch_buffer (Depends-on): Add builtin-expect. (Makefile.am): Arrange to create malloc/scratch_buffer.gl.h from malloc/scratch_buffer.h.
Bruno Haible 0c907f7d 2021-06-07T00:54:25 dynarray: Avoid conflict with preprocessor macros owned by the system. * lib/dynarray.h: Don't include <libc-config.h>. Define _GL_LIKELY, _GL_UNLIKELY. Include malloc/dynarray.gl.h instead of malloc/dynarray.h. Include malloc/dynarray-skeleton.gl.h instead of malloc/dynarray-skeleton.c. * modules/dynarray (Depends-on): Add builtin-expect. (Makefile.am): Arrange to create malloc/dynarray.gl.h from malloc/dynarray.h and malloc/dynarray-skeleton.gl.h from malloc/dynarray-skeleton.c.
Bruno Haible 82ad8518 2021-06-07T01:18:01 glob-h: Make last patch work with Solaris 10 cc. * modules/glob-h (Makefile.am): Also transform the '__restrict' macro.
Bruno Haible a5b7194c 2021-06-07T00:34:54 glob-h: Avoid conflict with preprocessor macros owned by the system. This fixes a compilation error on DragonFly BSD 6.0. * lib/glob.in.h: Don't include <libc-config.h>. Don't define __USE_GNU. Include glob-libc.gl.h instead of glob-libc.h. * modules/glob-h (Makefile.am): Arrange to create glob-libc.gl.h from glob-libc.h. * lib/libc-config.h: Add comment.
Bruno Haible 555bd9ca 2021-06-04T22:13:43 git-merge-changelog: Fix license. * modules/git-merge-changelog (License): Change back to GPL. * lib/git-merge-changelog.c: Use a GPLv3+ notice.
Bruno Haible a8f2dda7 2021-06-04T20:42:44 gnupload, git-merge-changelog: Fix module description. * gnulib-tool (func_import, func_create_testdir): Treat 'GPLv2+ build tool' like 'GPLed build tool'. * pygnulib/GLImport.py (prepare): Likewise. * modules/gnupload (License): Change to 'GPLv2+ build tool'. * modules/git-merge-changelog (License): Change to GPLv2+.
Bruno Haible 6d1cba37 2021-05-30T14:37:06 Write 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'. * modules/* (License): Change. * gnulib-tool (func_import, func_create_testdir): Likewise.
Bruno Haible 40e416dd 2021-05-17T03:36:35 c-stack: Support catching stack overflow on most platforms without libsigsegv. * lib/c-stack.c: Remove all Solaris-specific code. Include <sigsegv.h> always. * m4/c-stack.m4: Remove all Solaris-specific code. (gl_C_STACK): Test $with_libsigsegv from module 'sigsegv'. * modules/c-stack (Files): Remove m4/libsigsegv.m4. (Depends-on): Add sigsegv. Remove havelib, intprops, inttypes, mempcpy, sigaction, stdbool.
Bruno Haible a6a6528d 2021-05-16T18:29:48 sigsegv: Add tests. * tests/test-sigsegv-catch-segv1.c: New file, from GNU libsigsegv with modifications. * tests/test-sigsegv-catch-segv2.c: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise. * tests/altstack-util.h: Likewise. * tests/mmap-anon-util.h: Likewise. * modules/sigsegv-tests: New file.
Bruno Haible e54aa619 2021-05-16T15:20:12 sigsegv: New module. * lib/sigsegv.in.h: New file, from GNU libsigsegv with modifications. * lib/sigsegv.c: Likewise. * lib/stackvma.h: Likewise. * lib/stackvma.c: Likewise. * m4/sigaltstack.m4: Likewise. * m4/stack-direction.m4: Likewise. * modules/sigsegv: New file.
Bruno Haible b0211da4 2021-05-14T23:32:08 linked-list-unportable-test: New module. * modules/linked-list-unportable-tests: New file, based on modules/linked-list-tests. * modules/linked-list-tests: Remove the unportable tests from here. Depend on linked-list-unportable-tests.
Bruno Haible f6b9c586 2021-05-14T15:35:24 *alloc-gnu tests: Use ASSERT macro. * tests/test-malloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-calloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-realloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-reallocarray.c: Include "macros.h". (main): Use ASSERT. * modules/malloc-gnu-tests (Files): Add tests/macros.h. * modules/calloc-gnu-tests (Files): Likewise. * modules/realloc-gnu-tests (Files): Likewise. * modules/reallocarray-tests (Files): Likewise.
Bruno Haible 4e147587 2021-05-09T04:19:48 Fix build error when libintl is installed. * modules/posix_spawn_file_actions_addchdir-tests (Makefile.am): Link test-posix_spawn-chdir with libintl. * modules/posix_spawn_file_actions_addfchdir-tests (Makefile.am): Link test-posix_spawn-fchdir with libintl.
Bruno Haible 7cc8d8aa 2021-05-07T12:51:47 Fix build when an older libunistring is installed (regr. 2020-02-23). * modules/unitypes (configure.ac): Arrange to generate the .h file if the installed one is from a version < 0.9.11. * modules/unicase/base (configure.ac): Likewise. * modules/uniconv/base (configure.ac): Likewise. * modules/unilbrk/base (configure.ac): Likewise. * modules/uninorm/base (configure.ac): Likewise. * modules/unistdio/base (configure.ac): Likewise. * modules/unistr/base (configure.ac): Likewise. * modules/uniwbrk/base (configure.ac): Likewise. * modules/uniwidth/base (configure.ac): Likewise. * modules/unictype/base (configure.ac): Arrange to generate the .h file if the installed one is from a version < 0.9.8. * modules/unigbrk/base (configure.ac): Likewise.
Paul Eggert 354b9691 2021-04-25T23:11:15 reallocarray: a bit more tuning * lib/reallocarray.c: Include intprops.h. (reallocarray): Use INT_MULTIPLY_WRAPV instead of xalloc_oversized, as it now suffices and is likely a bit more efficient (five fewer machine insns on Ubuntu 20.10 x86-64). * modules/reallocarray (Depends-on): Depend on intprops, not xalloc-oversized. Use conditional dependencies to avoid building realloc-gnu when not needed.
Paul Eggert cc98a5e2 2021-04-24T17:59:53 xmalloca, etc.: fix some xalloc-oversized issues * lib/malloca.h (nmalloca): * lib/xmalloca.h (xnmalloca): Convert S to ptrdiff_t to avoid arithmetic overflow if N and S are both narrower than ptrdiff_t. * lib/xalloc-oversized.h (xalloc_oversized): Don’t say that args must be ptrdiff_t or size_t or wider. The macro returns the correct answer even when that is not the case, and it’s the caller’s responsibility to avoid howlers like (xalloc_oversized (n, s) ? NULL : malloc (n * s)) when N and S are both narrower than ptrdiff_t and size_t. Add a comment to that effect. * lib/xmalloca.h: Include xalloc-oversized.h, since this file uses xalloc_oversized. Add comments about side effects and avoid unnecessary parens. * modules/xmalloca (Depends-on): Add xalloc-oversized.
Paul Eggert a7477abe 2021-04-24T10:45:45 reallocarray: check for ptrdiff_t overflow * doc/glibc-functions/reallocarray.texi (reallocarray): Mention ptrdiff_t overflow. * lib/reallocarray.c (reallocarray): Reindent as per usual GNU. * lib/stdlib.in.h (reallocarray): Allow reallocarray to be replaced. * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Check for ptrdiff_t overflow. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Set up REPLACE_REALLOCARRAY. * modules/reallocarray (Files): Add malloc.m4. (configure.ac): Also test REPLACE_REALLOCARRAY. * modules/reallocarray-tests (Depends-on): Add stdint. * modules/stdlib (stdlib.h): Substitute REPLACE_REALLOCARRAY. * tests/test-reallocarray.c: Include stdint.h. (main): Check for ptrdiff_t overflow.
Paul Eggert 7e605302 2021-04-21T11:07:18 malloca: avoid ptrdiff_t overflow * lib/malloca.c: Include idx.h, intprops.h. (mmalloca): Check for ptrdiff_t overflow. Since this module uses _GL_USE_STDLIB_ALLOC, it cannot assume GNU malloc semantics. * modules/malloca (Depends-on): Add idx, intprops.
Paul Eggert 87e2ea35 2021-04-21T11:03:39 careadlinkat: avoid ptrdiff_t overflow * lib/careadlinkat.c: Include idx.h, minmax.h. (readlink_stk): Avoid ptrdiff_t overflow in object allocation. Since this module uses arbitrary allocators (including stdlib_allocator), it cannot assume GNU malloc semantics. * modules/careadlinkat (Depends-on): Add idx, minmax.
Paul Eggert 5d5120d7 2021-04-18T20:50:55 safe-alloc: fix pointer implementation The old implementation assumed that all pointers use the same internal representation, but the C standard doesn’t guarantee this. Use void * (pointer) not void ** (pointer-to-pointer) for the internal functions’ API. The internal functions now return NULL if and only if they failed, and the macros translate that into -1 or 0 to satisfy the existing API. * doc/safe-alloc.texi (Safe Allocation Macros): Mention overflow. * lib/safe-alloc.c: Major rewrite. Now this simply defines SAFE_ALLOC_INLINE and includes safe-alloc.h. * lib/safe-alloc.h: Include stddef.h, not stdlib.h. (SAFE_ALLOC_INLINE): New macro; use Gnulib inline function style. (safe_alloc_realloc_n): New API, which passes and returns the pointer, and which returns NULL if and only if failure occurs. (safe_alloc_check): New function. (ALLOC, ALLOC_N, ALLOC_N_UNINITIALIZED, REALLOC_N): Redo using the new API for internal functions, and using calloc which is good enough since it’s GNU-compatible now. (FREE): Expand to an expression rather than merely to something that needs a following ‘;’ to become a statement. * modules/safe-alloc (Depends-on): Add calloc-gnu.
Paul Eggert 751b5840 2021-04-18T20:52:29 calloc-gnu: now LGPLv2+ * modules/calloc-gnu (License): Change from GPL to LGPLv2+. The old value was evidently a longstanding typo, and calloc will be needed by LGPLv2+ modules that will want to rely on GNU behavior.
Paul Eggert d4e52e5e 2021-04-18T16:53:11 safe-alloc: simplify via reallocarray * lib/safe-alloc.c: Do not include xalloc-oversized.h. (safe_alloc_alloc_n, safe_alloc_realloc_n): Use reallocarray to check for size or ptrdiff_t overflow. * modules/reallocarray (License): Switch from LGPL to LGPLv2+, as this is needed for safe-alloc and anyway is more appropriate for this library function common with BSD. * modules/safe-alloc (Depends-on): Depend on reallocarray rather than xalloc-oversized.
Paul Eggert 109f6d1f 2021-04-18T16:24:51 xalloc: new function xreallocarray This effectively replaces xnmalloc, which perhaps should be deprecated. The name xreallocarray should be easier to remember now that reallocarray is a standard GNU function. * lib/xalloc.h [GNULIB_XALLOC]: Do not include xalloc-oversized.h. (xnmalloc, xnrealloc, x2nrealloc): Simplify by using xreallocarray. * lib/xmalloc.c (xreallocarray): New function. * modules/xalloc (Depends-on): Add reallocarray; remove xalloc-oversized.
Paul Eggert 9fd0a1de 2021-04-18T16:08:31 group-member: simplify via realloc-gnu * lib/group-member.c, modules/group-member: Simplify similarly to backupfile.
Paul Eggert 650f0a6c 2021-04-18T16:05:30 backupfile: simplify via realloc-gnu * lib/backupfile.c: Do not include xalloc-oversized.h. (numbered_backup): Simplify now that realloc will do the right thing about ptrdiff_t overflow. * modules/backupfile (Depends-on): Add realloc-gnu; remove xalloc-oversized.
Paul Eggert abe94812 2021-04-18T15:29:54 malloc-gnu-tests, etc.: test ptrdiff_t overflow * modules/calloc-gnu-tests (Depends-on): * modules/malloc-gnu-tests (Depends-on): * modules/realloc-gnu-tests (Depends-on): Add stdint. * tests/test-calloc-gnu.c (main): * tests/test-malloc-gnu.c (main):, * tests/test-realloc-gnu.c (main): Test for ptrdiff_t overflow.
Bruno Haible 1905bf66 2021-04-18T13:26:43 More systematic file naming. * m4/ctype_h.m4: Renamed from m4/ctype.m4. * m4/threads_h.m4: Renamed from m4/threads.m4. * m4/uchar_h.m4: Renamed from m4/uchar.m4.
Paul Eggert 77735dde 2021-04-17T18:48:38 xalloc: adjust to malloc ptrdiff_t change * lib/xmalloc.c (HAVE_GNU_CALLOC, HAVE_GNU_MALLOC, HAVE_GNU_REALLOC): Remove. (xmalloc, xrealloc, xcalloc): Simplify by assuming GNU behavior. * modules/xalloc (Depends-on): Add calloc-gnu, malloc-gnu, realloc-gnu.
Paul Eggert 58fe1054 2021-04-17T18:44:25 malloc, etc.: check for ptrdiff_t overflow In glibc 2.30 and later, malloc, realloc and calloc reject attempts to create objects larger than PTRDIFF_MAX bytes. This patch changes malloc-gnu etc. to support this behavior on non-GNU hosts. It also makes this change for malloc-posix etc. since it’s a safety measure that ought to be in POSIX (perhaps we can talk them into that...). In writing this patch I found a complicated set of code that had accumulated over the years, some written by yours truly. I got rid of the code I couldn’t see the need for nowadays. Among other things, the GNU realloc behavior is no longer incompatible with the C standard, because in C17 the latter was relaxed to allow the former. If I went too far in cleaning up, the old stuff can be resurrected. This change is mostly for 32-bit platforms, since practical 64-bit platforms cannot create objects larger than PTRDIFF_MAX bytes anyway. * doc/posix-functions/calloc.texi: * doc/posix-functions/malloc.texi: * doc/posix-functions/realloc.texi: Mention ptrdiff_t issues, and go into more detail about what the gnu extension module does. * doc/posix-functions/realloc.texi: Fix now-obsolete commentary about C99 vs glibc, as C17 allows the glibc behavior and POSIX will follow suit when it gets around to it. * lib/calloc.c, lib/malloc.c, lib/realloc.c: Simplify by always supplying a GNU-compatible version, as that suffices for correctness and is good enough for performance. Include xalloc-oversized.h, and use xalloc_oversized to check for ptrdiff_t overflow. (NEED_CALLOC_GNU, NEED_MALLOC_GNU, NEED_REALLOC_GNU): Remove. * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Don’t start with a newline. Fix message to match behavior. * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Don’t test for size_t overflow, as the ptrdiff_t test is good enough. * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Do not define HAVE_CALLOC_GNU, HAVE_MALLOC_GNU, HAVE_REALLOC_GNU. It’s not worth the aggravation of maintaining these, as they are confusing (they don’t really mean GNU-compatible anyway). Don’t bother testing for GNU behavior if we have already decided to replace the function, since the replacement is always GNUish. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Defer to gl_FUNC_MALLOC_POSIX. * m4/malloc.m4 (gl_FUNC_MALLOC_PTRDIFF, gl_CHECK_MALLOC_PTRDIFF): New macros. (gl_FUNC_MALLOC_POSIX): Use them to check for ptrdiff_t overflow. * modules/calloc-gnu, modules/malloc-gnu, modules/realloc-gnu: Remove no-longer-needed module indicators. * modules/calloc-posix, modules/malloc-posix, modules/realloc-posix: Depend on xalloc-oversized. * modules/malloc-posix: Require gl_FUNC_MALLOC_POSIX instead of calling it directly, so that other code can require it. * modules/realloc-posix: Depend on free-posix and malloc-posix.
Bruno Haible bc61151f 2021-04-17T17:17:06 stdio: Fix build error in some configurations (regression 2021-04-11). * m4/stdio_h.m4 (gl_STDIO_H): Move gl_STDIO_MODULE_INDICATOR and gl_MODULE_INDICATOR invocations from here... * modules/stdio (configure.ac): ... to here.
Bruno Haible 9ca36006 2021-04-15T02:19:24 hamt tests: Fix link error. * modules/hamt-tests (Makefile.am): Link test-hamt against @LIBINTL@.
Bruno Haible 80a344e3 2021-04-11T21:25:54 Support several gnulib-tool invocations under the same configure.ac. Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00104.html>. This is done by defining the Gnulib module indicator variables per gnulib-tool invocation. So that a generated .h file is no longer influenced by the set of modules used in other gnulib-tool invocations. * gnulib-tool (func_compute_include_guard_prefix): Set module_indicator_prefix. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Use it to modify $(GNULIB_*) variable references in the Automake snippets. (func_emit_initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (func_emit_initmacro_end): Pop these macro definitions. * pygnulib/GLConfig.py (GLConfig.getIncludeGuardPrefix): New method. * pygnulib/GLEmiter.py (GLEmiter.initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (GLEmiter.initmacro_end): Pop these macro definitions. (GLEmiter.lib_Makefile_am, GLEmiter.tests_Makefile_am): Use the module indicator prefix to modify $(GNULIB_*) variable references in the Automake snippets. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE, gl_MODULE_INDICATOR_SET_VARIABLE): Use the value of GL_MODULE_INDICATOR_PREFIX. * m4/arpa_inet_h.m4: Use new idiom for header files that contain references to Gnulib module indicator variables: - Define the main macro through AC_DEFUN_ONCE. - Define a macro gl_*_H_REQUIRE_DEFAULTS that initializes the Gnulib module indicator variables (each prefixed with GL_MODULE_INDICATOR_PREFIX). - Invoke this macro in the gl_*_MODULE_INDICATOR macro. * m4/ctype.m4: Likewise. * m4/dirent_h.m4: Likewise. * m4/fcntl_h.m4: Likewise. * m4/fnmatch_h.m4: Likewise. * m4/glob_h.m4: Likewise. * m4/iconv_h.m4: Likewise. * m4/inttypes.m4: Likewise. * m4/langinfo_h.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/malloc_h.m4: Likewise. * m4/math_h.m4: Likewise. * m4/monetary_h.m4: Likewise. * m4/netdb_h.m4: Likewise. * m4/poll_h.m4: Likewise. * m4/pthread_h.m4: Likewise. * m4/pty_h.m4: Likewise. * m4/sched_h.m4: Likewise. * m4/search_h.m4: Likewise. * m4/signal_h.m4: Likewise. * m4/spawn_h.m4: Likewise. * m4/stddef_h.m4: Likewise. * m4/stdio_h.m4: Likewise. * m4/stdlib_h.m4: Likewise. * m4/string_h.m4: Likewise. * m4/strings_h.m4: Likewise. * m4/sys_file_h.m4: Likewise. * m4/sys_ioctl_h.m4: Likewise. * m4/sys_random_h.m4: Likewise. * m4/sys_resource_h.m4: Likewise. * m4/sys_select_h.m4: Likewise. * m4/sys_socket_h.m4: Likewise. * m4/sys_stat_h.m4: Likewise. * m4/sys_time_h.m4: Likewise. * m4/sys_times_h.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/sys_uio_h.m4: Likewise. * m4/sys_utsname_h.m4: Likewise. * m4/sys_wait_h.m4: Likewise. * m4/termios_h.m4: Likewise. * m4/threads.m4: Likewise. * m4/time_h.m4: Likewise. * m4/uchar.m4: Likewise. * m4/unistd_h.m4: Likewise. * m4/utime_h.m4: Likewise. * m4/wchar_h.m4: Likewise. * m4/wctype_h.m4: Likewise. * modules/arpa_inet (configure.ac): Invoke the macro gl_*_H_REQUIRE_DEFAULTS explicitly. * modules/ctype (configure.ac): Likewise. * modules/dirent (configure.ac): Likewise. * modules/fcntl-h (configure.ac): Likewise. * modules/fnmatch-h (configure.ac): Likewise. * modules/glob-h (configure.ac): Likewise. * modules/iconv-h (configure.ac): Likewise. * modules/inttypes-incomplete (configure.ac): Likewise. * modules/langinfo (configure.ac): Likewise. * modules/locale (configure.ac): Likewise. * modules/malloc-h (configure.ac): Likewise. * modules/math (configure.ac): Likewise. * modules/monetary (configure.ac): Likewise. * modules/netdb (configure.ac): Likewise. * modules/poll-h (configure.ac): Likewise. * modules/pthread-h (configure.ac): Likewise. * modules/pty (configure.ac): Likewise. * modules/sched (configure.ac): Likewise. * modules/search (configure.ac): Likewise. * modules/signal-h (configure.ac): Likewise. * modules/spawn (configure.ac): Likewise. * modules/stddef (configure.ac): Likewise. * modules/stdio (configure.ac): Likewise. * modules/stdlib (configure.ac): Likewise. * modules/string (configure.ac): Likewise. * modules/strings (configure.ac): Likewise. * modules/sys_file (configure.ac): Likewise. * modules/sys_ioctl (configure.ac): Likewise. * modules/sys_random (configure.ac): Likewise. * modules/sys_resource (configure.ac): Likewise. * modules/sys_select (configure.ac): Likewise. * modules/sys_socket (configure.ac): Likewise. * modules/sys_stat (configure.ac): Likewise. * modules/sys_time (configure.ac): Likewise. * modules/sys_times (configure.ac): Likewise. * modules/sys_types (configure.ac): Likewise. * modules/sys_uio (configure.ac): Likewise. * modules/sys_utsname (configure.ac): Likewise. * modules/sys_wait (configure.ac): Likewise. * modules/termios (configure.ac): Likewise. * modules/threads-h (configure.ac): Likewise. * modules/time (configure.ac): Likewise. * modules/uchar (configure.ac): Likewise. * modules/unistd (configure.ac): Likewise. * modules/utime-h (configure.ac): Likewise. * modules/wchar (configure.ac): Likewise. * modules/wctype-h (configure.ac): Likewise. * m4/af_alg.m4: Update after a macro name changed. * m4/ctime.m4: Likewise. * m4/explicit_bzero.m4: Likewise. * m4/ffs.m4: Likewise. * m4/ffsl.m4: Likewise. * m4/ffsll.m4: Likewise. * m4/flock.m4: Likewise. * m4/fstat.m4: Likewise. * m4/getaddrinfo.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/gettimeofday.m4: Likewise. * m4/hostent.m4: Likewise. * m4/ioctl.m4: Likewise. * m4/localtime.m4: Likewise. * m4/mbslen.m4: Likewise. * m4/memchr.m4: Likewise. * m4/memmem.m4: Likewise. * m4/mempcpy.m4: Likewise. * m4/memrchr.m4: Likewise. * m4/mktime.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/passfd.m4: Likewise. * m4/pselect.m4: Likewise. * m4/rawmemchr.m4: Likewise. * m4/select.m4: Likewise. * m4/servent.m4: Likewise. * m4/sigabbrev_np.m4: Likewise. * m4/sigdescr_np.m4: Likewise. * m4/sockpfaf.m4: Likewise. * m4/stat.m4: Likewise. * m4/stpcpy.m4: Likewise. * m4/stpncpy.m4: Likewise. * m4/strcase.m4: Likewise. * m4/strcasestr.m4: Likewise. * m4/strchrnul.m4: Likewise. * m4/strdup.m4: Likewise. * m4/strerror.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/strerrorname_np.m4: Likewise. * m4/strftime-fixes.m4: Likewise. * m4/strncat.m4: Likewise. * m4/strndup.m4: Likewise. * m4/strnlen.m4: Likewise. * m4/strpbrk.m4: Likewise. * m4/strptime.m4: Likewise. * m4/strsep.m4: Likewise. * m4/strsignal.m4: Likewise. * m4/strstr.m4: Likewise. * m4/strtok_r.m4: Likewise. * m4/strverscmp.m4: Likewise. * m4/time_r.m4: Likewise. * m4/time_rz.m4: Likewise. * m4/timegm.m4: Likewise. * m4/timespec_get.m4: Likewise. * m4/tzset.m4: Likewise. * modules/accept (configure.ac): Likewise. * modules/bind (configure.ac): Likewise. * modules/connect (configure.ac): Likewise. * modules/flock (configure.ac): Likewise. * modules/getpeername (configure.ac): Likewise. * modules/getsockname (configure.ac): Likewise. * modules/getsockopt (configure.ac): Likewise. * modules/listen (configure.ac): Likewise. * modules/recv (configure.ac): Likewise. * modules/recvfrom (configure.ac): Likewise. * modules/send (configure.ac): Likewise. * modules/sendto (configure.ac): Likewise. * modules/setsockopt (configure.ac): Likewise. * modules/shutdown (configure.ac): Likewise. * modules/socket (configure.ac): Likewise. Use the gl_*_H_REQUIRE_DEFAULTS macros. * modules/nonblocking (configure.ac): Use the gl_*_H_REQUIRE_DEFAULTS and gl_MODULE_INDICATOR_INIT_VARIABLE macros. * modules/sigpipe (configure.ac): Likewise. * modules/windows-stat-override (configure.ac): Likewise. * m4/nonblocking.m4: Update a comment. * m4/sigpipe.m4: Likewise.
Bruno Haible 8b857ed1 2021-04-11T15:54:18 Rename GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T. * GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from GNULIB_OVERRIDES_CHAR16_T. * GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from GNULIB_OVERRIDES_CHAR32_T.
Bruno Haible db16856a 2021-04-11T15:50:35 Rename GNULIB_OVERRIDES_WINT_T. * GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T.
Bruno Haible 2a7948aa 2021-04-08T01:37:05 execute tests: Avoid test failure in certain environments. Reported by Dmitry V. Levin <ldv@altlinux.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00082.html>. * tests/test-execute-main.c (main): Close file descriptors 3..19. * tests/test-execute-child.c (main): Remove NetBSD workaround. * modules/execute-tests (configure.ac): Test for close_range function.
Paul Eggert 7e90795b 2021-04-06T17:45:33 group-member: minor tweak to omit a * * lib/group-member.c: Include intprops.h. (get_group_info): Use INT_MULTIPLY_WRAPV instead of xalloc_oversized (which does a multiplication) followed by the same multiplication. The code was OK as-is; this is just conceptual simplification, possible now that we have xalloc_count_t. * modules/group-member: Depend on intprops.
Paul Eggert 4392cab3 2021-04-06T17:39:31 backupfile: less-aggressive buffer growth * lib/backupfile.c: Include intprops.h. (numbered_backup): Grow buffer by the usual 50%, not 100%. This is easier to do now that we have xalloc_count_t. * modules/backup-rename, modules/backupfile: Depend on intprops.
Bruno Haible 8676a431 2021-04-04T14:54:33 backupfile, backup-rename: Trim dependencies. * lib/backupfile.h: Add comment. * lib/backupfile.c: Include <dirent.h>, for readdir() declaration. * modules/backup-rename (Depends-on): Remove dirent-safer, fcntl. Add fcntl-h. * modules/backupfile (Depends-on): Likewise. Remove xalloc. Add xalloc-die.
Paul Eggert f30ed230 2021-04-03T16:07:21 xgethostname: reorganize / simplify xgethostname and xgetdomainname were essentially copies long ago, but they’ve diverged. Bring them back together again by implementing the (rarely used) latter in terms of the former. And avoid some unnecessary realloc calls while we’re at it. * lib/xgetdomainname.c: Rewrite from scratch so that it merely includes xgethostname.c with a few preliminaries. * lib/xgethostname.c: Generalize so that it can be included from xgetdomainname.c. (GETANAME, XGETANAME): New macros. (INITIAL_HOSTNAME_LENGTH): Remove. No need for this parameter. Use 100 instead, as few hostnames are longer than that. (XGETANAME): Try getting the hostname into the stack first, as that avoids a malloc call in the usual case. Check for both POSIX-style truncation and SunOS 5.5 bug in a cleaner way, by simply checking string length. Don’t use x2realloc, which wastes time preserving buffer garbage; use xpalloc with NULL instead. Don’t bother shrinking buffer in the very rare case where the hostname is longer than sizeof buf; it’s not worth the aggravation. * modules/xgetdomainname (Depends-on): Remove free-posix, xalloc. Add xgethostname.
Bruno Haible b7a807df 2021-04-03T17:41:18 xalloc-die: Fix compilation error (regression from 2021-03-28). * lib/xalloc.h: Don't include idx.h and xalloc-oversized.h if the module 'xalloc' is not in use. * modules/xalloc-die (Depends-on): Remove xalloc-oversized.
Marc Nieper-Wißkirchen 006275ff 2021-04-03T11:23:00 hamt: New module. This module provides (persistent) hash array mapped tries. * MODULES.html.sh: Add hamt. * lib/hamt.c: New file. * lib/hamt.h: New file. * modules/hamt: New file. * modules/hamt-tests: New file. * tests/test-hamt.c: New file.
Bruno Haible ea1816fd 2021-04-02T20:46:15 strtoll: Work around a bug on native Windows and Minix. * lib/stdlib.in.h (strtoll): Override if REPLACE_STRTOLL is 1. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOLL. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Test whether strtoll works. Set REPLACE_STRTOLL. * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOLL. * modules/strtoll (configure.ac): Test REPLACE_STRTOLL. * tests/test-strtoll.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoll.texi: Mention the bug.
Bruno Haible 705c2369 2021-04-02T20:42:13 strtol: Work around a bug on native Windows and Minix. * lib/stdlib.in.h (strtol): New declaration. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtol is declared. (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOL, HAVE_STRTOL, REPLACE_STRTOL. * m4/strtol.m4 (gl_FUNC_STRTOL): Require gl_STDLIB_H_DEFAULTS. Test whether strtol works. Set REPLACE_STRTOL. * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOL, HAVE_STRTOL, REPLACE_STRTOL. * modules/strtol (Status, Notice): Remove. (Depends-on): Add stdlib. (configure.ac): Test HAVE_STRTOL and REPLACE_STRTOL. Invoke gl_STDLIB_MODULE_INDICATOR. * tests/test-strtol.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtol.texi: Mention the bug.
Bruno Haible 837ffb5e 2021-04-02T20:14:28 strtoull: Work around a bug on native Windows and Minix. * lib/stdlib.in.h (strtoull): Override if REPLACE_STRTOULL is 1. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOULL. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Test whether strtoull works. Set REPLACE_STRTOULL. * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOULL. * modules/strtoull (configure.ac): Test REPLACE_STRTOULL. * tests/test-strtoull.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoull.texi: Mention the bug.
Bruno Haible cbff21f9 2021-04-02T19:56:28 strtoul: Work around a bug on native Windows and Minix. Reported by Eric Blake <eblake@redhat.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00082.html>. * lib/stdlib.in.h (strtoul): New declaration. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtoul is declared. (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOUL, HAVE_STRTOUL, REPLACE_STRTOUL. * m4/strtoul.m4 (gl_FUNC_STRTOUL): Require gl_STDLIB_H_DEFAULTS. Test whether strtoul works. Set REPLACE_STRTOUL. * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOUL, HAVE_STRTOUL, REPLACE_STRTOUL. * modules/strtoul (Status, Notice): Remove. (Depends-on): Add stdlib. (configure.ac): Test HAVE_STRTOUL and REPLACE_STRTOUL. Invoke gl_STDLIB_MODULE_INDICATOR. * tests/test-strtoul.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoul.texi: Mention the bug.
Paul Eggert e54b645f 2021-03-28T20:02:21 xalloc: new function xpalloc, from dfa Move xpalloc from dfa.c to xmalloc.c and change it from static to extern. The function is useful in other contexts; I’m about to use it in coreutils. * lib/dfa.c: Include idx.h, instead of rolling our own idx_t and IDX_MAX. Do not include intprops.h; no longer needed. (xpalloc): Move from here ... * lib/xmalloc.c (xpalloc): ... to here, and make it extern. Include intprops.h and minmax.h, needed by xpalloc. * lib/xalloc.h: Include idx.h, for idx_t. * modules/dfa (Depends-on): Add idx; remove intprops. * modules/xalloc (Depends-on): Add idx, intprops, minmax.
Bruno Haible f19e3cff 2021-03-28T20:10:43 linked-list tests: Add another test for SIGNAL_SAFE_LIST. * tests/test-asyncsafe-linked_list-strong.c: Renamed from tests/test-asyncsafe-linked_list.c. * tests/test-asyncsafe-linked_list-strong.sh: Renamed from tests/test-asyncsafe-linked_list.sh. * tests/test-asyncsafe-linked_list-weak.c: New file, based on tests/test-asyncsafe-linked_list.c. * tests/test-asyncsafe-linked_list-weak.sh: New file, based on tests/test-asyncsafe-linked_list.sh. * modules/linked-list-tests (Files): Add tests/test-asyncsafe-linked_list-weak.*, tests/test-asyncsafe-linked_list-strong.*. (Makefile.am): Arrange to test also tests/test-asyncsafe-linked_list-weak.sh. Mark test-asyncsafe-linked_list-weak.sh and test-asyncsafe-linked_list-strong.sh as expected failures.
Bruno Haible 237cb354 2021-03-27T01:14:33 unistdio/*-vasnprintf: Fix errno value (regression from yesterday). * modules/unistdio/u8-vasnprintf (Depends-on): Add free-posix. * modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise. * modules/unistdio/u16-vasnprintf (Depends-on): Likewise. * modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise. * modules/unistdio/u32-vasnprintf (Depends-on): Likewise. * modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise. * modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.
Akim Demaille e639e557 2021-03-26T06:40:06 fprintf-posix: fix typo * modules/fprintf-posix (Depends-on): Fix typo.
Paul Eggert 5b3a6f94 2021-03-25T12:41:41 free-posix: use more often in other modules This lets us simplify cleanup code that calls ‘free’. * lib/amemxfrm.c (amemxfrm): * lib/areadlink-with-size.c (areadlink_with_size): * lib/areadlinkat-with-size.c (areadlinkat_with_size): * lib/astrxfrm.c (astrxfrm): * lib/dprintf.c (dprintf): * lib/execute.c (execute): * lib/execvpe.c (execvpe): * lib/fchdir.c (get_name): * lib/file-has-acl.c (file_has_acl): * lib/fprintf.c (fprintf): * lib/getcwd-lgpl.c (rpl_getcwd): * lib/getgroups.c (rpl_getgroups): * lib/link.c (link, rpl_link): * lib/linkat.c (link_immediate, link_follow, linkat_follow): * lib/localename.c (newlocale, duplocale): * lib/mgetgroups.c (mgetgroups): * lib/mountlist.c (read_file_system_list): * lib/pipe-filter-gi.c (pipe_filter_gi_close): * lib/putenv.c (_unsetenv, putenv): * lib/read-file.c (read_file): * lib/rename.c (rpl_rename): * lib/savedir.c (streamsavedir, savedir): * lib/spawni.c (do_open, __spawni): * lib/spawn-pipe.c (create_pipe): * lib/striconv.c (mem_cd_iconv, str_cd_iconv, str_iconv): * lib/striconveh.c (mem_cd_iconveh_internal, str_cd_iconveh) (mem_iconveh, str_iconveh): * lib/supersede.c (open_supersede, close_supersede): * lib/vasnprintf.c (VASNPRINTF): * lib/vdprintf.c (vdprintf): * lib/vfprintf.c (vfprintf): * lib/wcscoll-impl.h (wcscoll): * lib/wcsxfrm-impl.h (wcsxfrm): * lib/xgetdomainname.c (xgetdomainname): * lib/xgethostname.c (xgethostname): Simplify by assuming that ‘free’ preserves errno. * lib/localename.c: Do not include errno.h. * modules/amemxfrm, modules/areadlink-with-size: * modules/areadlinkat-with-size, modules/astrxfrm: * modules/c-vasnprintf, modules/dprintf, modules/execute: * modules/execvpe, modules/fchdir, modules/file-has-acl: * modules/fprintf-posix, modules/getcwd-lgpl, modules/getgroups: * modules/link, modules/linkat, modules/localename: * modules/mgetgroups, modules/mountlist, modules/pipe-filter-gi: * modules/posix_spawn-internal, modules/putenv, modules/read-file: * modules/rename, modules/savedir, modules/spawn-pipe: * modules/striconv, modules/striconveh, modules/supersede: * modules/vasnprintf, modules/vdprintf, modules/vfprintf-posix: * modules/wcscoll, modules/wcsxfrm, modules/xgetdomainname: * modules/xgethostname: Depend on free-posix.
Bruno Haible 2e29da63 2021-03-23T00:16:15 clean-temp-simple: Relicense under LGPLv2+. * modules/clean-temp-simple (License): Change to LGPLv2+.
Bruno Haible 391c29f5 2021-03-23T00:08:38 clean-temp-simple: Remove dependency upon xalloc, xalloc-die, xlist. * lib/clean-temp-private.h (clean_temp_init): Change return type to 'int'. * lib/clean-temp-simple.h (register_temporary_file): Change return type to 'int'. * lib/clean-temp-simple.c: Don't include xalloc.h, gl_xlist.h. Include gl_list.h instead. (init_failed): New variable. (do_clean_temp_init): Set it. (clean_temp_init): Return an error indicator. (register_temporary_file): Invoke gl_list_nx_create_empty instead of gl_list_create_empty. Invoke strdup instead of xstrdup. Invoke gl_list_nx_add_first instead of gl_list_add_first. Return an error indicator. * lib/clean-temp.c (create_temp_dir, gen_register_open_temp): Call xalloc_die() if clean_temp_init or register_temporary_file failed. * modules/clean-temp-simple (Depends-on): Remove xalloc, xalloc-die, xlist.
Bruno Haible 83c222f7 2021-03-22T22:48:23 clean-temp-simple: New module. * lib/clean-temp-simple.h: New file, based on lib/clean-temp.h. * lib/clean-temp-private.h: New file, based on lib/clean-temp.c. * lib/clean-temp-simple.c: New file, based on lib/clean-temp.c. * lib/clean-temp.h: Include clean-temp-simple.h. (register_temporary_file, unregister_temporary_file, cleanup_temporary_file): Remove declarations. * lib/clean-temp.c: Don't include <limits.h>, <stdint.h>. Include <signal.h>, <stdio.h>, clean-temp-simple.h, clean-temp-private.h. (file_cleanup_list_lock, file_cleanup_list): Moved to clean-temp-simple.c. (struct tempdir, dir_cleanup_list, struct closeable_fd, descriptors): Moved to clean-temp-private.h. (string_equals, SIZE_BITS, string_hash, fatal_signal_set, init_fatal_signal_set, asyncsafe_close): Moved to clean-temp-simple.c. (asyncsafe_fclose_variant): Use get_fatal_signal_set() here. (cleanup_action, do_init_clean_temp, clean_temp_once, init_clean_temp, register_temporary_file, unregister_temporary_file, do_unlink, cleanup_temporary_file): Moved to clean-temp-simple.c. (create_temp_dir, cleanup_temp_file, cleanup_temp_dir_contents, gen_register_open_temp, close_temp): Update for changed function names. (fclose_variant_temp): Don't call init_fatal_signal_set(). * modules/clean-temp-simple: New file, based on modules/clean-temp. * modules/clean-temp (Depends-on): Add clean-temp-simple, list. Remove stdint. (configure.ac): Don't define SIGNAL_SAFE_LIST here.
Bruno Haible fe8e6696 2021-03-22T18:28:02 error: Relicense under LGPLv2+. Pino Toscano's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00109.html>. Paul Eggert's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00110.html>. * modules/error (License): Change to LGPLv2+.
Bruno Haible d2a00b28 2021-03-22T18:25:09 getprogname: Relicense under LGPLv2+. Pino Toscano's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00109.html>. Paul Eggert's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00110.html>. Jim Meyering's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00107.html>. Gisle Vanem's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00115.html>. Daniel Richard G's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00112.html>. John David Anglin's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00108.html>. Benji Wiebe's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00114.html>. * modules/getprogname (License): Change to LGPLv2+.
Bruno Haible f491e394 2021-03-22T17:52:17 fatal-signal: Relicense under LGPLv2+. Eric Blake's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00111.html>. * modules/fatal-signal (License): Change to LGPLv2+.
Bruno Haible 4f42fc4d 2021-03-22T09:34:09 linkedhash-list: Relicense under LGPLv2+. Paul Eggert's approval is in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00102.html>. * modules/linkedhash-list (License): Change to LGPLv2+.
Bruno Haible 9ad38b46 2021-03-22T02:50:07 fatal-signal: Remove dependency upon xalloc. * lib/fatal-signal.h (at_fatal_signal): Change return type to 'int'. * lib/fatal-signal.c: Don't include xalloc.h. (at_fatal_signal): Return an error indicator. * modules/fatal-signal (Depends-on): Remove xalloc. * NEWS: Mention the change. * lib/term-style-control.c: Include xalloc.h. (ensure_other_signal_handlers): Test return value of at_fatal_signal. * lib/clean-temp.c (do_init_clean_temp): Likewise. * lib/wait-process.c (register_slave_subprocess): Likewise. * modules/term-style-control (Depends-on): Add xalloc-die. * modules/clean-temp (Depends-on): Likewise. * modules/wait-process (Depends-on): Likewise.
Paul Eggert ea2ccc2e 2021-03-21T17:37:00 diacrit: remove * MODULES.html.sh (func_all_modules), NEWS: Remove diacrit. * lib/diacrit.c, lib/diacrit.h, modules/diacrit: Remove.
Bruno Haible a646e362 2021-03-21T03:46:05 ftello: Work around bug in macOS >= 10.15. Reported by Martin Storsjö <martin@martin.st> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00002.html>. * m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): On macOS, don't define FUNC_UNGETC_BROKEN. Instead, set gl_ftello_broken_after_ungetc to yes. * m4/ftello.m4 (gl_FUNC_FTELLO): Invoke gl_FUNC_UNGETC_WORKS, and arrange to provide the workaround if ftello is broken after ungetc. * lib/ftello.c: Include <errno.h>, intprops.h. (ftello) [FTELLO_BROKEN_AFTER_UNGETC]: Implement from scratch. * modules/ftello (Files): Add m4/ungetc.m4. (Depends-on): Add intprops. * doc/posix-functions/ftello.texi: Mention the macOS bug.
Bruno Haible 02a474ef 2021-03-14T19:22:07 time_rz: Put reference documentation into the .h file. * lib/time.in.h (timezone_t, tzalloc, tzfree, localtime_rz, mktime_z): Add comments, based on modules/time_rz. * modules/time_rz (Comment): Remove section.
Bruno Haible f4bf3936 2021-03-07T02:42:24 exclude: Allow stdio optimization independently of 'unlocked-io'. * lib/exclude.c: Test GNULIB_EXCLUDE_SINGLE_THREAD instead of USE_UNLOCKED_IO. * modules/exclude (Depends-on): Add unlocked-io-internal. * doc/multithread.texi: Document GNULIB_EXCLUDE_SINGLE_THREAD.
Bruno Haible d26b0a26 2021-03-07T02:36:31 readutmp: Optimize stdio accesses. * lib/readutmp.c: Include unlocked-io.h unconditionally. * modules/readutmp (Depends-on): Add unlocked-io-internal.
Bruno Haible 895c6f06 2021-03-07T02:31:45 mountlist: Optimize stdio accesses. * lib/mountlist.c: Include unlocked-io.h unconditionally. * modules/mountlist (Depends-on): Add unlocked-io-internal.
Bruno Haible 92052c44 2021-03-07T02:21:49 getusershell: Optimize stdio accesses when possible. * lib/getusershell.c: Test GNULIB_GETUSERSHELL_SINGLE_THREAD instead of USE_UNLOCKED_IO. * modules/getusershell (Depends-on): Add unlocked-io-internal. * doc/multithread.texi: Document GNULIB_GETUSERSHELL_SINGLE_THREAD.
Bruno Haible 212f0b69 2021-03-07T01:58:10 unlocked-io-internal: New module. * m4/unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO): Don't define USE_UNLOCKED_IO here. * modules/unlocked-io-internal: New file, based on modules/unlocked-io. * modules/unlocked-io (Description): Clarify. (Files, Depends-on): Just use the unlocked-io-internal module. (configure.ac): Define GNULIB_STDIO_SINGLE_THREAD and USE_UNLOCKED_IO here. * doc/multithread.texi: Clarify when the 'unlocked-io' module can be used.
Bruno Haible 84b97a73 2021-03-07T00:41:44 dynarray: Add tests. * tests/test-dynarray.c: New file. * modules/dynarray-tests: New file.
Bruno Haible 7ce163b7 2021-03-07T00:40:27 dynarray: Make the module usable on its own. * lib/dynarray.h: Document the exported API. Comments taken from lib/malloc/dynarray-skeleton.c and lib/malloc/dynarray.h. Distinguish an internal include from an include for instantiation. In the latter case, include <libc-config.h> and <malloc/dynarray-skeleton.c>. * modules/dynarray (Depends-on): Add intprops. (Include): Reduce to just "dynarray.h".
Paul Eggert 92fb5eec 2021-03-01T00:48:47 * modules/parse-datetime2: New file.
Bruno Haible 783f2967 2021-02-27T18:12:09 string-buffer: Fixes. * modules/string-buffer (License): Change to LGPL. * tests/test-string-buffer.c (main): Add another sb_appendf call, that is more likely to fail.
Bruno Haible c9b44f21 2021-02-21T21:41:53 string-buffer: Add tests. * tests/test-string-buffer.c: New file. * modules/string-buffer-tests: New file.
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 7563be91 2021-02-20T14:13:17 parse-datetime: Fix comment. * modules/parse-datetime (Makefile.am): Fix comment.
Bruno Haible 29a3fb3e 2021-02-16T01:31:39 linked-list test: Add test for SIGNAL_SAFE_LIST. (It currently fails.) * tests/test-asyncsafe-linked_list.sh: New file. * tests/test-asyncsafe-linked_list.c: New file. * modules/linked-list-tests (Files): Add them. (Depends-on): Add thread, yield, nanosleep, sigaction, sigprocmask. (Makefile.am): Arrange to compile test-asyncsafe-linked_list.c and run test-asyncsafe-linked_list.sh.
Bruno Haible 43e5eca6 2021-02-15T04:29:18 simple-atomic: Add tests. * tests/test-simple-atomic.c: New file. * modules/simple-atomic-tests: New file.
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 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 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 b9bb7e33 2021-01-31T12:29:47 canonicalize, canonicalize-lgpl: Straighten dependencies. * modules/canonicalize-lgpl (Depends-on): Remove free-posix, malloc-posix. Add unistd. * modules/canonicalize (Depends-on): Remove free-posix, xalloc. Add unistd.
Bruno Haible 5c79e150 2021-01-30T16:16:04 scratch_buffer: Fix dependencies. * modules/scratch_buffer (Depends-on): Add malloc-posix, realloc-posix, free-posix.
Bruno Haible 3b732e78 2021-01-25T10:12:51 posix_spawn_file_actions_* tests: Fix module dependencies. * modules/posix_spawn_file_actions_addclose-tests (Depends-on): Add posix_spawn_file_actions_destroy. * modules/posix_spawn_file_actions_addopen-tests (Depends-on): Likewise. * modules/posix_spawn_file_actions_adddup2-tests (Depends-on): Likewise. * modules/posix_spawn_file_actions_addchdir-tests (Depends-on): Likewise. * modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Likewise.
Bruno Haible 65f62234 2021-01-20T21:44:36 gc-random: Fix link error in tests. * modules/crypto/gc-random (Link): New section. * modules/crypto/gc-tests (Makefile.am): Link test-gc with $(LIB_GETRANDOM).
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.