]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agohamt: Fix coding errors.
Marc Nieper-Wißkirchen [Mon, 5 Apr 2021 13:24:32 +0000 (15:24 +0200)]
hamt: Fix coding errors.

Reported by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00047.html>
after a Coverity run.
* lib/hamt.c (bucket_do_while, hamt_iterator): Add missing
derefencing operator and silence a bogus warning on uninitialized
variables.
* tests/test-hamt.c (test_general): Replace two errorneous
assignment operators with comparison operators.

4 years agopthread-cond: Fix compilation error.
Fabrice Fontaine [Mon, 5 Apr 2021 10:44:41 +0000 (12:44 +0200)]
pthread-cond: Fix compilation error.

* lib/pthread-cond.c (pthread_cond_wait): Use tv.nsec instead of
tv.usec.

4 years agopthread-cond: Fix wrong configure results when <pthread.h> is absent.
Fabrice Fontaine [Sun, 4 Apr 2021 23:13:29 +0000 (01:13 +0200)]
pthread-cond: Fix wrong configure results when <pthread.h> is absent.

* m4/pthread-cond.m4 (gl_PTHREAD_COND): When <pthread.h> does not exist,
set HAVE_PTHREAD_COND_* to 0, not to 1.

4 years agobackupfile, backup-rename: Trim dependencies.
Bruno Haible [Sun, 4 Apr 2021 12:54:33 +0000 (14:54 +0200)]
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.

4 years agodoc: Fix syntax error (regression from 2021-04-02).
Bruno Haible [Sun, 4 Apr 2021 10:14:59 +0000 (12:14 +0200)]
doc: Fix syntax error (regression from 2021-04-02).

* doc/posix-functions/strtol.texi: Put @item inside @itemize block.

4 years agohamt: Document the module in the Gnulib manual.
Marc Nieper-Wißkirchen [Sun, 4 Apr 2021 08:35:42 +0000 (10:35 +0200)]
hamt: Document the module in the Gnulib manual.

Suggested by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00026.html>.
* doc/containers.texi: Add a subsection to section 15.11 Container
data types.
* lib/hamt.h: Improve documentation on how Hamt_entry is supposed
to be used.

4 years agosavedir: avoid unlikely undefined behavior
Paul Eggert [Sun, 4 Apr 2021 03:14:36 +0000 (20:14 -0700)]
savedir: avoid unlikely undefined behavior

* lib/savedir.c (streamsavedir): Prefer idx_to size_t where
either will do.  Simplify reallocation of entries.
Use xpalloc to reallocate name_space, to avoid some unlikely
integer overflows.

4 years agoquotearg: avoid undefined and/or O(N**2)
Paul Eggert [Sun, 4 Apr 2021 02:59:10 +0000 (19:59 -0700)]
quotearg: avoid undefined and/or O(N**2)

Avoid undefined and O(N**2) behavior in some very unlikely cases.
* lib/quotearg.c (quotearg_n_options): Document that N must
be less than MIN (INT_MAX, IDX_MAX), and add this to the
abort test; this also avoids a conditional branch.
Use xpalloc instead of xrealloc, to avoid O(N**2) behavior in
very-unlikely cases.

4 years agoxgethostname: reorganize / simplify
Paul Eggert [Sat, 3 Apr 2021 23:07:21 +0000 (16:07 -0700)]
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.

4 years ago*-list tests: Add more tests.
Bruno Haible [Sat, 3 Apr 2021 16:25:56 +0000 (18:25 +0200)]
*-list tests: Add more tests.

* tests/test-array_list.c (check_equals_by_forward_iteration,
check_equals_by_backward_iteration): New functions.
(main): Invoke them.
* tests/test-carray_list.c: Likewise.
* tests/test-linked_list.c: Likewise.
* tests/test-linkedhash_list.c: Likewise.
* tests/test-avltree_list.c: Likewise.
* tests/test-avltreehash_list.c: Likewise.
* tests/test-rbtree_list.c: Likewise.
* tests/test-rbtreehash_list.c: Likewise.

4 years agolist: Add operations first_node, last_node.
Bruno Haible [Sat, 3 Apr 2021 15:59:47 +0000 (17:59 +0200)]
list: Add operations first_node, last_node.

Reported by Marc Nieper-Wißkirchen in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00005.html>.

* lib/gl_list.h (gl_list_first_node, gl_list_last_node): New functions.
(struct gl_list_implementation): Add members first_node, last_node.
* lib/gl_array_list.c (gl_array_first_node, gl_array_last_node): New
functions.
(gl_array_list_implementation): Add the new operations.
* lib/gl_carray_list.c (gl_carray_first_node, gl_carray_last_node): New
functions.
(gl_carray_list_implementation): Add the new operations.
* lib/gl_anylinked_list2.h (gl_linked_first_node, gl_linked_last_node):
New functions.
* lib/gl_linked_list.c (gl_linked_list_implementation): Add the new
operations.
* lib/gl_linkedhash_list.c (gl_linkedhash_list_implementation):
Likewise.
* lib/gl_anytree_list2.h (gl_tree_first_node, gl_tree_last_node): New
functions.
* lib/gl_avltree_list.c (gl_avltree_list_implementation): Add the new
operations.
* lib/gl_avltreehash_list.c (gl_avltreehash_list_implementation):
Likewise.
* lib/gl_rbtree_list.c (gl_rbtree_list_implementation): Likewise.
* lib/gl_rbtreehash_list.c (gl_rbtreehash_list_implementation):
Likewise.
* lib/gl_sublist.c (gl_sublist_first_node, gl_sublist_last_node): New
functions.
(gl_sublist_list_implementation): Add the new operations.
* lib/gl_list.hh (class gl_List): Add member functions first_node,
last_node.
* doc/containers.texi: Update table.

4 years agoxalloc-die: Fix compilation error (regression from 2021-03-28).
Bruno Haible [Sat, 3 Apr 2021 15:41:18 +0000 (17:41 +0200)]
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.

4 years agohamt: New module.
Marc Nieper-Wißkirchen [Sat, 3 Apr 2021 09:23:00 +0000 (11:23 +0200)]
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.

4 years agostrtoul, strtoll, strtoull: Fix compilation warning.
Bruno Haible [Fri, 2 Apr 2021 18:56:28 +0000 (20:56 +0200)]
strtoul, strtoll, strtoull: Fix compilation warning.

* lib/strtol.c (strtol): Undefine before defining as a macro.

4 years agostrtoll: Work around a bug on native Windows and Minix.
Bruno Haible [Fri, 2 Apr 2021 18:46:15 +0000 (20:46 +0200)]
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.

4 years agostrtol: Work around a bug on native Windows and Minix.
Bruno Haible [Fri, 2 Apr 2021 18:42:13 +0000 (20:42 +0200)]
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.

4 years agostrtoull: Work around a bug on native Windows and Minix.
Bruno Haible [Fri, 2 Apr 2021 18:14:28 +0000 (20:14 +0200)]
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.

4 years agostrtoul: Work around a bug on native Windows and Minix.
Bruno Haible [Fri, 2 Apr 2021 17:56:28 +0000 (19:56 +0200)]
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.

4 years agostrtol, strtoul, strtoll, strtoull: Optimize.
Bruno Haible [Fri, 2 Apr 2021 17:50:19 +0000 (19:50 +0200)]
strtol, strtoul, strtoll, strtoull: Optimize.

* lib/strtol.c (GROUP_PARAM_PROTO): New macro.
(INTERNAL): Define differently if !USE_NUMBER_GROUPING.
(INTERNAL (strtol)): Define without 'int group' parameter if
!USE_NUMBER_GROUPING.
(strtol): Don't define if !USE_NUMBER_GROUPING.

4 years agostrto*l: Don't pass invalid arguments to isspace, isalnum, toupper.
Bruno Haible [Fri, 2 Apr 2021 17:47:53 +0000 (19:47 +0200)]
strto*l: Don't pass invalid arguments to isspace, isalnum, toupper.

* lib/strtol.c (ISSPACE, ISALPHA, TOUPPER): Cast argument to
'unsigned char' before passing it to the functions isspace(), isalpha(),
toupper().

4 years agoglob: Reject ~user syntax, when flag GLOB_TILDE_CHECK is given.
Bruno Haible [Fri, 2 Apr 2021 15:34:46 +0000 (17:34 +0200)]
glob: Reject ~user syntax, when flag GLOB_TILDE_CHECK is given.

Reported and patch suggested by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00136.html>.

* lib/glob.c (__glob) [WINDOWS32]: If flag GLOB_TILDE_CHECK is given, do
error handling like when ~user is allowed by the user is unknown.

4 years agoxalloc: delay setting size until success
Paul Eggert [Thu, 1 Apr 2021 07:59:54 +0000 (00:59 -0700)]
xalloc: delay setting size until success

* lib/xalloc.h (x2nrealloc): Don’t change *PN until after xrealloc
succeeds, in case xalloc_die or one of its callees or longjmp
targets uses *PN.  Similar code in xpalloc already does this.

4 years agoxalloc: new function xpalloc, from dfa
Paul Eggert [Mon, 29 Mar 2021 03:02:21 +0000 (20:02 -0700)]
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.

4 years agolinked-list tests: Add another test for SIGNAL_SAFE_LIST.
Bruno Haible [Sun, 28 Mar 2021 18:10:43 +0000 (20:10 +0200)]
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.

4 years agorenameatu tests: Add unit test for bug found on macOS.
Bruno Haible [Sat, 27 Mar 2021 16:46:58 +0000 (17:46 +0100)]
renameatu tests: Add unit test for bug found on macOS.

* tests/test-renameatu.c (main): Add test for identical rename with
RENAME_NOREPLACE.

4 years agounistdio/*-vasnprintf: Fix errno value (regression from yesterday).
Bruno Haible [Sat, 27 Mar 2021 00:14:33 +0000 (01:14 +0100)]
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.

4 years agovasnprintf: Fix memory leak (regression from yesterday).
Bruno Haible [Sat, 27 Mar 2021 00:12:07 +0000 (01:12 +0100)]
vasnprintf: Fix memory leak (regression from yesterday).

* lib/vasnprintf.c (VASNPRINTF): Restore omitted CLEANUP invocation.
Some more simplifications of errno around free().

4 years agofprintf-posix: fix typo
Akim Demaille [Fri, 26 Mar 2021 05:40:06 +0000 (06:40 +0100)]
fprintf-posix: fix typo

* modules/fprintf-posix (Depends-on): Fix typo.

4 years agofree-posix: use more often in other modules
Paul Eggert [Thu, 25 Mar 2021 19:41:41 +0000 (12:41 -0700)]
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.

4 years agorenameatu: work around macOS 11.2 renameatx_np bug
Paul Eggert [Thu, 25 Mar 2021 03:40:46 +0000 (20:40 -0700)]
renameatu: work around macOS 11.2 renameatx_np bug

* lib/renameatu.c (renameatu) [RENAME_EXCL]: Use lstatat test here too.

4 years agoclean-temp-simple: Fix a rare memory leak.
Bruno Haible [Tue, 23 Mar 2021 00:19:06 +0000 (01:19 +0100)]
clean-temp-simple: Fix a rare memory leak.

* lib/clean-temp-simple.c (register_temporary_file): Fix cleanup code.

4 years agoclean-temp-simple: Relicense under LGPLv2+.
Bruno Haible [Mon, 22 Mar 2021 23:16:15 +0000 (00:16 +0100)]
clean-temp-simple: Relicense under LGPLv2+.

* modules/clean-temp-simple (License): Change to LGPLv2+.

4 years agoclean-temp-simple: Remove dependency upon xalloc, xalloc-die, xlist.
Bruno Haible [Mon, 22 Mar 2021 23:08:38 +0000 (00:08 +0100)]
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.

4 years agoclean-temp-simple: New module.
Bruno Haible [Mon, 22 Mar 2021 21:48:23 +0000 (22:48 +0100)]
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.

4 years agoerror: Relicense under LGPLv2+.
Bruno Haible [Mon, 22 Mar 2021 17:28:02 +0000 (18:28 +0100)]
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+.

4 years agogetprogname: Relicense under LGPLv2+.
Bruno Haible [Mon, 22 Mar 2021 17:25:09 +0000 (18:25 +0100)]
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+.

4 years agofatal-signal: Relicense under LGPLv2+.
Bruno Haible [Mon, 22 Mar 2021 16:52:17 +0000 (17:52 +0100)]
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+.

4 years agodoc: Mention an open glibc bug.
Bruno Haible [Mon, 22 Mar 2021 12:47:44 +0000 (13:47 +0100)]
doc: Mention an open glibc bug.

* doc/posix-functions/mbrtowc.texi: Mention the possible out-of-range
wchar_t values returned by this function on glibc.
* doc/posix-functions/mbtowc.texi: Likewise.

4 years agombrtowc: Remove a redundant condition.
Benno Schulenberg [Mon, 22 Mar 2021 12:35:16 +0000 (13:35 +0100)]
mbrtowc: Remove a redundant condition.

* lib/mbrtowc-impl-utf8.h: There is no need to check for c == 0xf4
when !(c < 0xf4), as ten lines earlier c <= 0xf4 was established.

4 years agolinkedhash-list: Relicense under LGPLv2+.
Bruno Haible [Mon, 22 Mar 2021 08:34:09 +0000 (09:34 +0100)]
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+.

4 years agofatal-signal: Remove dependency upon xalloc.
Bruno Haible [Mon, 22 Mar 2021 01:50:07 +0000 (02:50 +0100)]
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.

4 years agodiacrit: remove
Paul Eggert [Mon, 22 Mar 2021 00:37:00 +0000 (17:37 -0700)]
diacrit: remove

* MODULES.html.sh (func_all_modules), NEWS: Remove diacrit.
* lib/diacrit.c, lib/diacrit.h, modules/diacrit: Remove.

4 years agotests: fix signed overflow issues
Paul Eggert [Sun, 21 Mar 2021 21:52:08 +0000 (14:52 -0700)]
tests: fix signed overflow issues

* tests/test-dynarray.c (value_at): Avoid undefined behavior
in signed integer multiplication.
* tests/test-scratch-buffer.c (byte_at): Likewise, for the
theoretically-possible case where size_t is narrower than int.

4 years agodoc: More updates.
Bruno Haible [Sun, 21 Mar 2021 15:03:57 +0000 (16:03 +0100)]
doc: More updates.

* doc/glibc-functions/sethostname.texi: Update regarding macOS.
* doc/glibc-functions/sethostname.texi: List the affected platforms.

4 years agodoc: Update for macOS 11.1.
Bruno Haible [Sun, 21 Mar 2021 13:56:02 +0000 (14:56 +0100)]
doc: Update for macOS 11.1.

* doc/posix-headers/*.texi: Update.
* doc/glibc-headers/*.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update cross-compilation
guess.

4 years agoftell: Document bug in macOS >= 10.15.
Bruno Haible [Sun, 21 Mar 2021 11:30:33 +0000 (12:30 +0100)]
ftell: Document bug in macOS >= 10.15.

* doc/posix-functions/ftell.texi: Mention the macOS bug.

4 years agoftello: Work around bug in macOS >= 10.15.
Bruno Haible [Sun, 21 Mar 2021 02:46:05 +0000 (03:46 +0100)]
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.

4 years agomath C++ tests: Fix compilation error on macOS 11.2.
Bruno Haible [Sat, 20 Mar 2021 21:34:16 +0000 (22:34 +0100)]
math C++ tests: Fix compilation error on macOS 11.2.

* lib/math.in.h (isnan): For clang >= 12 on macOS, declare 'rpl_isnan',
not 'isnan'.

4 years agosimple-atomic tests: Fix compilation error on Solaris 10.
Bruno Haible [Fri, 19 Mar 2021 02:47:23 +0000 (03:47 +0100)]
simple-atomic tests: Fix compilation error on Solaris 10.

Reported by Tom G. Christensen <tgc@jupiterrise.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00085.html>.

* tests/test-simple-atomic.c (yield): Define only after all #includes.

4 years agosimple-atomic: Fix compilation error on Solaris 10/x86_64 with cc.
Bruno Haible [Fri, 19 Mar 2021 02:38:53 +0000 (03:38 +0100)]
simple-atomic: Fix compilation error on Solaris 10/x86_64 with cc.

* lib/simple-atomic.c (atomic_compare_and_swap_ptr): Correct asm
instruction.

4 years agoargmatch: fix testing typo
Paul Eggert [Thu, 18 Mar 2021 18:00:53 +0000 (11:00 -0700)]
argmatch: fix testing typo

Problem and fix reported by Gisle Vanem in:
https://lists.gnu.org/r/bug-gnulib/2021-03/msg00083.html
* lib/argmatch.c (main) [TEST]: Fix address-of typo.

4 years agoautoupdate
Karl Berry [Tue, 16 Mar 2021 15:14:30 +0000 (08:14 -0700)]
autoupdate

4 years agointprops: improve commentary
Paul Eggert [Mon, 15 Mar 2021 04:28:40 +0000 (21:28 -0700)]
intprops: improve commentary

* lib/intprops.h: Improve comments about promotion etc.

4 years agotime_rz: Put reference documentation into the .h file.
Bruno Haible [Sun, 14 Mar 2021 18:22:07 +0000 (19:22 +0100)]
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.

4 years agoparse-datetime tests: Avoid a test failure on NetBSD.
Bruno Haible [Sun, 14 Mar 2021 18:19:07 +0000 (19:19 +0100)]
parse-datetime tests: Avoid a test failure on NetBSD.

Reported by Thomas Klausner <tk@giga.or.at> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00069.html>.

* tests/test-parse-datetime.c (main): Skip two tests on NetBSD.

4 years agoautoupdate
Karl Berry [Thu, 11 Mar 2021 19:26:27 +0000 (11:26 -0800)]
autoupdate

4 years agolibc-config: port to DragonFlyBSD 5.9
Paul Eggert [Wed, 10 Mar 2021 23:04:55 +0000 (15:04 -0800)]
libc-config: port to DragonFlyBSD 5.9

DragonFlyBSD defines __nonnull incompatibly with glibc,
so avoid the use of __nonnull in Gnulib code.
Problem reported by Gavin Smith in:
https://lists.gnu.org/r/bug-gnulib/2021-03/msg00066.html
* lib/cdefs.h (__attribute_nonnull__): Rename from __nonnull.
All uses in Gnulib changed.  There should be no need to change
glibc code that is not shared with Gnulib.
(__nonnull): New macro, defined in terms of __attribute_nonnull__,
and which can be used in glibc code that is not shared with Gnulib.

4 years agomanywarnings: modernize documentation
Paul Eggert [Sun, 7 Mar 2021 21:47:02 +0000 (13:47 -0800)]
manywarnings: modernize documentation

Problem reported by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2021-03/msg00046.html
* doc/manywarnings.texi (manywarnings): Update in
the light of recent changes to the manywarnings module.

4 years agosysexits: Fix for Haiku.
Bruno Haible [Sun, 7 Mar 2021 11:24:07 +0000 (12:24 +0100)]
sysexits: Fix for Haiku.

* lib/sysexits.in.h: Don't assume that <sysexits.h>, when it exists,
defines anything.
* doc/glibc-headers/sysexits.texi: Mention the Haiku bug.

4 years agoRename GNULIB_WCHAR_SINGLE to GNULIB_WCHAR_SINGLE_LOCALE.
Bruno Haible [Sun, 7 Mar 2021 09:45:58 +0000 (10:45 +0100)]
Rename GNULIB_WCHAR_SINGLE to GNULIB_WCHAR_SINGLE_LOCALE.

* lib/lc-charset-dispatch.c: Test GNULIB_WCHAR_SINGLE_LOCALE instead of
GNULIB_WCHAR_SINGLE.
* lib/wcwidth.c: Likewise.
* tests/test-wcwidth.c: Likewise.
* doc/multithread.texi: Document GNULIB_WCHAR_SINGLE_LOCALE instead of
GNULIB_WCHAR_SINGLE.
* NEWS: Document the change.

4 years agombrtowc: Allow locking optimization independently of 'unlocked-io'.
Bruno Haible [Sun, 7 Mar 2021 01:57:46 +0000 (02:57 +0100)]
mbrtowc: Allow locking optimization independently of 'unlocked-io'.

* lib/mbtowc-lock.h: Test GNULIB_MBRTOWC_SINGLE_THREAD instead of
USE_UNLOCKED_IO.
* doc/multithread.texi: Document GNULIB_MBRTOWC_SINGLE_THREAD.

4 years agoregex: Allow locking optimization independently of 'unlocked-io'.
Bruno Haible [Sun, 7 Mar 2021 01:47:03 +0000 (02:47 +0100)]
regex: Allow locking optimization independently of 'unlocked-io'.

* lib/regex_internal.h: Test GNULIB_REGEX_SINGLE_THREAD instead of
USE_UNLOCKED_IO.
* doc/multithread.texi: Document GNULIB_REGEX_SINGLE_THREAD.

4 years agoexclude: Allow stdio optimization independently of 'unlocked-io'.
Bruno Haible [Sun, 7 Mar 2021 01:42:24 +0000 (02:42 +0100)]
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.

4 years agoreadutmp: Optimize stdio accesses.
Bruno Haible [Sun, 7 Mar 2021 01:36:31 +0000 (02:36 +0100)]
readutmp: Optimize stdio accesses.

* lib/readutmp.c: Include unlocked-io.h unconditionally.
* modules/readutmp (Depends-on): Add unlocked-io-internal.

4 years agomountlist: Optimize stdio accesses.
Bruno Haible [Sun, 7 Mar 2021 01:31:45 +0000 (02:31 +0100)]
mountlist: Optimize stdio accesses.

* lib/mountlist.c: Include unlocked-io.h unconditionally.
* modules/mountlist (Depends-on): Add unlocked-io-internal.

4 years agogetusershell: Optimize stdio accesses when possible.
Bruno Haible [Sun, 7 Mar 2021 01:21:49 +0000 (02:21 +0100)]
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.

4 years agounlocked-io-internal: New module.
Bruno Haible [Sun, 7 Mar 2021 00:58:10 +0000 (01:58 +0100)]
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.

4 years agoposixtm: Remove unused includes.
Bruno Haible [Sun, 7 Mar 2021 00:39:16 +0000 (01:39 +0100)]
posixtm: Remove unused includes.

* lib/posixtm.c: Don't include <stdio.h>, <sys/types.h>, unlocked-io.h.

4 years agodynarray: Add tests.
Bruno Haible [Sat, 6 Mar 2021 23:41:44 +0000 (00:41 +0100)]
dynarray: Add tests.

* tests/test-dynarray.c: New file.
* modules/dynarray-tests: New file.

4 years agodynarray: Make the module usable on its own.
Bruno Haible [Sat, 6 Mar 2021 23:40:27 +0000 (00:40 +0100)]
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".

4 years agoscratch_buffer: Add comment.
Bruno Haible [Sat, 6 Mar 2021 23:27:13 +0000 (00:27 +0100)]
scratch_buffer: Add comment.

* lib/scratch_buffer.h: Add comment.

4 years agoparse-datetime2: fix licensing
Paul Eggert [Sat, 6 Mar 2021 16:23:48 +0000 (08:23 -0800)]
parse-datetime2: fix licensing

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-03/msg00017.html
* gnulib-tool (func_get_license): Treat parse-datetime2
(actually, anything starting with "parse-datetime")
like parse-datetime, as far as licenses go.

4 years agofree-posix: Update documentation.
Bruno Haible [Sat, 6 Mar 2021 12:49:52 +0000 (13:49 +0100)]
free-posix: Update documentation.

* doc/posix-functions/free.texi: Add platform details.

4 years agodoc: Update for glibc 2.33.
Bruno Haible [Sat, 6 Mar 2021 12:49:30 +0000 (13:49 +0100)]
doc: Update for glibc 2.33.

* doc/glibc-functions/mallinfo2.texi: New file.
* doc/gnulib.texi: Include it.
(Glibc sys/vtimes.h): Remove section.
* doc/glibc-functions/vtimes.texi: Remove file.
* doc/pastposix-functions/h_errno.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

4 years agostddef: Generalize tcc workaround to other compilers.
Bruno Haible [Thu, 4 Mar 2021 23:21:53 +0000 (00:21 +0100)]
stddef: Generalize tcc workaround to other compilers.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00027.html>.

* lib/stddef.in.h: Undefine the __need_* macros with all compilers.
* doc/posix-headers/stddef.texi: Mention that the TinyCC bug also exists
on macOS.

4 years agostdalign: port to tcc + glibc
Paul Eggert [Thu, 4 Mar 2021 08:47:19 +0000 (00:47 -0800)]
stdalign: port to tcc + glibc

* lib/stdalign.in.h (_Alignas): Do not define using __attribute__
if __attribute__ is defined as a macro, as __attribute__ surely a
no-op in that case and this is an area where __attribute__ cannot
simply be ignored.
* m4/stdalign.m4 (gl_STDALIGN_H): Include <stdint.h> so that
it #defines __attribute__(x) to nothing on glibc-based systems
when non-GNU-C-compatible compilers are used.
This exposes a bug in Tiny C Compiler 0.9.27’s implementation
of _Alignas on glibc platforms.

4 years agoasyncsafe-spin, simple-atomic: Add support for tcc/x86.
Bruno Haible [Thu, 4 Mar 2021 01:18:15 +0000 (02:18 +0100)]
asyncsafe-spin, simple-atomic: Add support for tcc/x86.

* lib/asyncsafe-spin.c (memory_barrier): With tcc/x86, don't use the
'mfence' instruction.
* lib/simple-atomic.c (memory_barrier): Likewise.

4 years agoasyncsafe-spin, simple-atomic: Add support for tcc.
Bruno Haible [Wed, 3 Mar 2021 12:32:41 +0000 (13:32 +0100)]
asyncsafe-spin, simple-atomic: Add support for tcc.

* lib/asyncsafe-spin.c (memory_barrier, atomic_compare_and_swap): On
i386 and x86_64, treat tcc like older GCC or clang.
* lib/simple-atomic.c (memory_barrier, atomic_compare_and_swap,
atomic_compare_and_swap_ptr): Likewise.

4 years agostddef: Work around an interoperability problem of tcc with glibc.
Bruno Haible [Wed, 3 Mar 2021 02:56:50 +0000 (03:56 +0100)]
stddef: Work around an interoperability problem of tcc with glibc.

Reported by Luca Saiu <positron@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00011.html>.

* lib/stddef.in.h [__TINYC__]: In case of the special invocation
convention, undefine the macros that TinyCC's <stddef.h> should undefine
but doesn't.
* doc/posix-headers/stddef.texi: Mention the TinyCC bug.

4 years agombrtowc: port to AIX 7.1 with xlc 12.1
Paul Eggert [Wed, 3 Mar 2021 00:27:39 +0000 (16:27 -0800)]
mbrtowc: port to AIX 7.1 with xlc 12.1

Fix a problem with locks when building GNU Tar (Savannah commit
55f2a0772e08b9febac3ac0de5cb048d4c60d2f5) on AIX 7.1 with IBM XL
C/C++ V12.1 using ‘./configure CC=xlc’.  The link fails due to
missing definitions of pthread_mutex_lock and
pthread_mutex_unlock.  GNU Tar uses unlocked-io and so
should not need to worry about multithreading or locks.
* lib/mbtowc-lock.h (mbtowc_with_lock) [USE_UNLOCKED_IO]:
Don’t bother with locks, since this app is single-threaded.
There may be similar linking problems with lib/nl_langinfo.c and
lib/setlocale_null.c but my GNU Tar build didn’t run into them, so
I left them alone for now.

4 years ago* modules/parse-datetime2: New file.
Paul Eggert [Mon, 1 Mar 2021 08:48:47 +0000 (00:48 -0800)]
* modules/parse-datetime2: New file.

4 years agounlocked-io: do not redefine getc_unlocked etc.
Paul Eggert [Mon, 1 Mar 2021 08:27:25 +0000 (00:27 -0800)]
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.

4 years agoparse-datetime2: new module
Paul Eggert [Mon, 1 Mar 2021 08:24:05 +0000 (00:24 -0800)]
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.

4 years agostring-buffer: Fixes.
Bruno Haible [Sat, 27 Feb 2021 17:12:09 +0000 (18:12 +0100)]
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.

4 years agogitlog-to-changelog: output SHA in "empty commit message" warning
Bernhard Voelker [Wed, 24 Feb 2021 23:58:25 +0000 (00:58 +0100)]
gitlog-to-changelog: output SHA in "empty commit message" warning

* build-aux/gitlog-to-changelog: Add $sha to above warning diagnostic.

4 years agoglob: include libc-config.h only if needed
Paul Eggert [Wed, 24 Feb 2021 19:36:06 +0000 (11:36 -0800)]
glob: include libc-config.h only if needed

4 years agoglob: include libc-config.h in a more-standard way
Paul Eggert [Wed, 24 Feb 2021 18:52:59 +0000 (10:52 -0800)]
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

4 years agoautoupdate
Karl Berry [Wed, 24 Feb 2021 17:40:33 +0000 (09:40 -0800)]
autoupdate

4 years agostring-buffer: Add tests.
Bruno Haible [Sun, 21 Feb 2021 20:41:53 +0000 (21:41 +0100)]
string-buffer: Add tests.

* tests/test-string-buffer.c: New file.
* modules/string-buffer-tests: New file.

4 years agostring-buffer: New module.
Bruno Haible [Sun, 21 Feb 2021 20:39:07 +0000 (21:39 +0100)]
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.

4 years agoscratch_buffer: Document the exported API.
Bruno Haible [Sun, 21 Feb 2021 18:32:36 +0000 (19:32 +0100)]
scratch_buffer: Document the exported API.

* lib/scratch_buffer.h: Add comments, taken from
lib/malloc/scratch_buffer.h.

4 years agoDEPENDENCIES: Update.
Bruno Haible [Sun, 21 Feb 2021 18:21:42 +0000 (19:21 +0100)]
DEPENDENCIES: Update.

* DEPENDENCIES: Require GCC >= 3.1. Tell where to find working GNU m4
tarballs. Mention awk. Point to pre-built packages for gettext, bison,
gperf, texinfo.

4 years agoparse-datetime: Fix comment.
Bruno Haible [Sat, 20 Feb 2021 13:13:17 +0000 (14:13 +0100)]
parse-datetime: Fix comment.

* modules/parse-datetime (Makefile.am): Fix comment.

4 years agopassfd: Fix test failure on FreeBSD >= 12 and NetBSD in 64-bit mode.
Bruno Haible [Wed, 17 Feb 2021 02:22:58 +0000 (03:22 +0100)]
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.

4 years agoPort better to macOS Mojave
Paul Eggert [Tue, 16 Feb 2021 19:41:19 +0000 (11:41 -0800)]
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.

4 years agolinked-list test: Add test for SIGNAL_SAFE_LIST. (It currently fails.)
Bruno Haible [Tue, 16 Feb 2021 00:31:39 +0000 (01:31 +0100)]
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.

4 years agosimple-atomic: Add tests.
Bruno Haible [Mon, 15 Feb 2021 03:29:18 +0000 (04:29 +0100)]
simple-atomic: Add tests.

* tests/test-simple-atomic.c: New file.
* modules/simple-atomic-tests: New file.

4 years agosimple-atomic: New module.
Bruno Haible [Mon, 15 Feb 2021 03:25:38 +0000 (04:25 +0100)]
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.

4 years agoFix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX.
Bruno Haible [Mon, 15 Feb 2021 02:41:12 +0000 (03:41 +0100)]
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.

4 years agoCorrect placement of last ChangeLog entry.
Bruno Haible [Mon, 15 Feb 2021 02:35:27 +0000 (03:35 +0100)]
Correct placement of last ChangeLog entry.