]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agoquotearg tests: Avoid test failures on Solaris 11.3.
Bruno Haible [Mon, 4 Jan 2021 03:00:51 +0000 (04:00 +0100)]
quotearg tests: Avoid test failures on Solaris 11.3.

* tests/test-quotearg.sh: Copy the fr/ directory using 'cp -R', not
'cp -a'.

4 years agotests: Fix link errors on Solaris, when libunistring-optional is in use.
Bruno Haible [Mon, 4 Jan 2021 02:48:24 +0000 (03:48 +0100)]
tests: Fix link errors on Solaris, when libunistring-optional is in use.

* modules/wcwidth (Link): New section.
* modules/wcswidth (Link): New section.
* modules/mbchar (Link): New section.
* modules/mbfile (Link): Link against libunistring.
* modules/mbiter (Link): Likewise.
* modules/mbuiter (Link): Likewise.
* modules/mbmemcasecmp (Link): Likewise.
* modules/mbscasecmp (Link): Likewise.
* modules/mbscasestr (Link): Likewise.
* modules/mbschr (Link): Likewise.
* modules/mbscspn (Link): Likewise.
* modules/mbslen (Link): Likewise.
* modules/mbsncasecmp (Link): Likewise.
* modules/mbsnlen (Link): Likewise.
* modules/mbspbrk (Link): Likewise.
* modules/mbspcasecmp (Link): Likewise.
* modules/mbsrchr (Link): Likewise.
* modules/mbssep (Link): Likewise.
* modules/mbsspn (Link): Likewise.
* modules/mbsstr (Link): Likewise.
* modules/mbstok_r (Link): Likewise.
* modules/mbswidth (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Link the test program
against libunistring.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/exclude-tests (Makefile.am): Likewise.
* modules/regex-quote-tests (Makefile.am): Likewise.

4 years agoc32ispunct tests: Avoid test failures on FreeBSD.
Bruno Haible [Mon, 4 Jan 2021 01:12:46 +0000 (02:12 +0100)]
c32ispunct tests: Avoid test failures on FreeBSD.

* tests/test-c32ispunct.c (main): On FreeBSD, disable tests that fail on
FreeBSD 12.1.1.

4 years agoFix last ChangeLog entry.
Bruno Haible [Mon, 4 Jan 2021 00:59:57 +0000 (01:59 +0100)]
Fix last ChangeLog entry.

4 years agodoc: Repeat warning that --with-tests cannot be used twice.
Simon Josefsson [Mon, 4 Jan 2021 00:06:21 +0000 (01:06 +0100)]
doc: Repeat warning that --with-tests cannot be used twice.

* doc/gnulib-tool.texi (Multiple instances): Remind reader of
--with-tests limitation.

4 years agoiconv, iconv_open: Improve documentation.
Bruno Haible [Sun, 3 Jan 2021 19:46:04 +0000 (20:46 +0100)]
iconv, iconv_open: Improve documentation.

Reported by Noah Misch <noah@leadboat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00172.html>.

* doc/posix-functions/iconv_open.texi: Add new paragraph "Portability
problems handled by Gnulib".
* doc/posix-functions/iconv.texi: Likewise. Update info about AIX.
* m4/iconv.m4 (AM_ICONV_LINK): Improve comments.

4 years agoiconv-h: Fix module description.
Bruno Haible [Sun, 3 Jan 2021 18:19:01 +0000 (19:19 +0100)]
iconv-h: Fix module description.

* modules/iconv-h (Include): Check HAVE_ICONV_H.

4 years agoiconv_open: Fix module description.
Noah Misch [Sun, 3 Jan 2021 18:17:52 +0000 (19:17 +0100)]
iconv_open: Fix module description.

* modules/iconv_open (Include): Check HAVE_ICONV, like modules/iconv.

4 years agoautoupdate
Karl Berry [Sun, 3 Jan 2021 18:40:57 +0000 (10:40 -0800)]
autoupdate

4 years agostddef: Override wrong max_align_t on AIX 7 with xlc in 64-bit mode.
Bruno Haible [Sun, 3 Jan 2021 12:38:03 +0000 (13:38 +0100)]
stddef: Override wrong max_align_t on AIX 7 with xlc in 64-bit mode.

* m4/stddef_h.m4 (gl_STDDEF_H): Make check for good max_align_t
stricter: Add tests for offsetof-based alignof.
* lib/stddef.in.h (max_align_t): Override on AIX in 64-bit mode.
* doc/posix-headers/stddef.texi: Document the AIX max_align_t bug.

4 years agofree-posix: Work around GCC mis-optimization bug.
Bruno Haible [Sun, 3 Jan 2021 10:19:22 +0000 (11:19 +0100)]
free-posix: Work around GCC mis-optimization bug.

Code by Bernhard Voelker <mail@bernhard-voelker.de>.

* lib/free.c (rpl_free): Add alternative complicated code for GCC.

4 years agovalgrind-tests: Disable valgrind if it would cause all tests to fail.
Bruno Haible [Sun, 3 Jan 2021 01:14:16 +0000 (02:14 +0100)]
valgrind-tests: Disable valgrind if it would cause all tests to fail.

Suggested by Simon Josefsson <simon@josefsson.org> in
<https://lists.gnu.org/archive/html/help-gsasl/2021-01/msg00004.html>.

* m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Test $VALGRIND on an
executable produced by the current compiler. Set VALGRIND to empty if it
does not work. Don't set VALGRIND to empty if it merely does not accept
the --error-exitcode=1 --leak-check=full options.

4 years agovalgrind-tests: Really enable the valgrind options test.
Bruno Haible [Sun, 3 Jan 2021 01:03:33 +0000 (02:03 +0100)]
valgrind-tests: Really enable the valgrind options test.

* m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Don't assume that the
valgrind options --error-exitcode=1 --leak-check=full always work.

4 years agoutimensat: Fix test failures on macOS 10.13.
Bruno Haible [Sat, 2 Jan 2021 18:31:45 +0000 (19:31 +0100)]
utimensat: Fix test failures on macOS 10.13.

* lib/utimensat.c: Include <string.h>, <sys/stat.h>.
(rpl_utimensat): Check against invalid tv_nsec values. Before calling
utimensat, recognize a filename ending in a slash that does not point
to a directory.

4 years agoutimens: Fix test failure on macOS 10.13.
Bruno Haible [Sat, 2 Jan 2021 18:21:35 +0000 (19:21 +0100)]
utimens: Fix test failure on macOS 10.13.

* lib/utimens.c: Include <string.h>.

4 years agoutimens: Fix test failure on macOS 10.13.
Bruno Haible [Sat, 2 Jan 2021 17:59:12 +0000 (18:59 +0100)]
utimens: Fix test failure on macOS 10.13.

* lib/utimens.c (fdutimens): Before calling utimensat, recognize a
filename ending in a slash that does not point to a directory.

4 years agoutimens: Avoid test failures on macOS 10.13.
Bruno Haible [Sat, 2 Jan 2021 17:57:10 +0000 (18:57 +0100)]
utimens: Avoid test failures on macOS 10.13.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00003.html>.

* tests/test-utimens-common.h (check_ctime): Define to -1 on macOS.
* tests/test-utimens.h (test_utimens): Don't expect a ctime change when
only the atime is requested to change.
* tests/test-futimens.h (test_futimens): Likewise.
* tests/test-lutimens.h (test_lutimens): Likewise.

4 years agorenameatu: Fix test failures on macOS.
Bruno Haible [Sat, 2 Jan 2021 15:54:21 +0000 (16:54 +0100)]
renameatu: Fix test failures on macOS.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00003.html>.

* lib/renameatu.c (renameatu): Don't call renameatx_np right away.
Instead, treat it as a variant of renameat, with all possible bugs that
renameat might have.

4 years agogetgroups test: Avoid warning with glibc >= 2.32 and gcc >= 10.
Bruno Haible [Sat, 2 Jan 2021 12:48:43 +0000 (13:48 +0100)]
getgroups test: Avoid warning with glibc >= 2.32 and gcc >= 10.

Reported by Bernhard Voelker <mail@bernhard-voelker.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00090.html>.

* tests/test-getgroups.c: Silence gcc warnings of type
-Wstringop-overflow.

4 years agotimespec_get: Add tests.
Bruno Haible [Sat, 2 Jan 2021 12:15:06 +0000 (13:15 +0100)]
timespec_get: Add tests.

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

4 years agotimespec_get: New module.
Bruno Haible [Sat, 2 Jan 2021 12:14:08 +0000 (13:14 +0100)]
timespec_get: New module.

* lib/time.in.h (timespec_get): New declaration.
* lib/timespec_get.c: New file.
* m4/timespec_get.m4: New file.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize
GNULIB_TIMESPEC_GET, HAVE_TIMESPEC_GET.
* modules/time (Makefile.am): Substitute GNULIB_TIMESPEC_GET,
HAVE_TIMESPEC_GET.
* modules/timespec_get: New file.
* tests/test-time-c++.cc (timespec_get): Check signature.
* doc/glibc-functions/timespec_get.texi: Mention the new module.

4 years agotime: Define TIME_UTC.
Bruno Haible [Fri, 1 Jan 2021 23:14:05 +0000 (00:14 +0100)]
time: Define TIME_UTC.

* lib/time.in.h (TIME_UTC, GNULIB_defined_TIME_UTC): New macros.
* m4/time_h.m4 (gl_HEADER_TIME_H_BODY): Set TIME_H_DEFINES_TIME_UTC.
* modules/time (Makefile.am): Substitute TIME_H_DEFINES_TIME_UTC.
* tests/test-time.c: Check that TIME_UTC is defined and a positive
integer.
* doc/posix-headers/time.texi: Mention TIME_UTC.

4 years agostddef: Try harder to get max_align_t defined on OpenBSD, part 2.
Bruno Haible [Sat, 2 Jan 2021 00:14:17 +0000 (01:14 +0100)]
stddef: Try harder to get max_align_t defined on OpenBSD, part 2.

* modules/stddef (Depends-on): Add extensions.

4 years agocanonicalize: remove NARROW_ADDRESSES optimization
Paul Eggert [Fri, 1 Jan 2021 23:54:43 +0000 (15:54 -0800)]
canonicalize: remove NARROW_ADDRESSES optimization

* lib/canonicalize-lgpl.c, lib/canonicalize.c (NARROW_ADDRESSES):
Remove, and remove all uses, as the optimization is arguably not
worth the extra complexity.  Suggested by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121203.html

4 years agostddef: Try harder to get max_align_t defined on OpenBSD.
Bruno Haible [Fri, 1 Jan 2021 22:07:24 +0000 (23:07 +0100)]
stddef: Try harder to get max_align_t defined on OpenBSD.

* m4/stddef_h.m4 (gl_STDDEF_H): Require gl_USE_SYSTEM_EXTENSIONS.

4 years agoaligned_alloc: Fix test failure on OpenBSD 6.8.
Bruno Haible [Fri, 1 Jan 2021 22:04:52 +0000 (23:04 +0100)]
aligned_alloc: Fix test failure on OpenBSD 6.8.

* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Require gl_USE_SYSTEM_EXTENSIONS.

4 years agoaligned_alloc: Fix test failure on OpenBSD 6.8.
Bruno Haible [Fri, 1 Jan 2021 21:50:58 +0000 (22:50 +0100)]
aligned_alloc: Fix test failure on OpenBSD 6.8.

* m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): On OpenBSD, define
_ISOC11_SOURCE.
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update comment.

4 years agoposixtm tests: Disable part of the test on plaforms where it fails.
Bruno Haible [Fri, 1 Jan 2021 20:03:31 +0000 (21:03 +0100)]
posixtm tests: Disable part of the test on plaforms where it fails.

* tests/test-posixtm.c (T): Disable two tests on macOS as well.

4 years agoautoupdate
Karl Berry [Fri, 1 Jan 2021 18:08:05 +0000 (10:08 -0800)]
autoupdate

4 years agoc32isgraph/c32isprint/c32ispunct tests: Avoid test failures on OmniOS.
Bruno Haible [Fri, 1 Jan 2021 17:39:28 +0000 (18:39 +0100)]
c32isgraph/c32isprint/c32ispunct tests: Avoid test failures on OmniOS.

* tests/test-c32isgraph.c (main): On Solaris, disable tests that fail on
Solaris 11 OmniOS.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.

4 years agolibc-config: port to Sun C 5.9
Paul Eggert [Fri, 1 Jan 2021 17:27:54 +0000 (09:27 -0800)]
libc-config: port to Sun C 5.9

* lib/libc-config.h (libc_hidden_proto): Omit ", ..." in macro
definition.  It’s not needed for Gnulib and elicits a diagnostic
from Sun C 5.9 Patch 124867-12 2009/11/22.

4 years agoquotearg tests: Avoid test failures on Solaris 11.
Bruno Haible [Fri, 1 Jan 2021 14:00:48 +0000 (15:00 +0100)]
quotearg tests: Avoid test failures on Solaris 11.

* modules/quotearg-tests (Makefile.am): Set host_os in
TESTS_ENVIRONMENT.
* tests/test-quotearg.sh: On Solaris 11 systems, make a copy of the fr/
directory that contains the .mo file.

4 years agomaint: Update copyright notices in --version output.
Bruno Haible [Fri, 1 Jan 2021 11:50:28 +0000 (12:50 +0100)]
maint: Update copyright notices in --version output.

List the most recent year in which changes were made, per
<https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html>.

* build-aux/declared.sh (func_version): Say 2019.
* build-aux/libtool-next-version (func_version): Likewise.
* build-aux/run-test (func_version): Likewise.
* check-module (COPYRIGHT_NOTICE): Say 2012.
* lib/git-merge-changelog.c (main): Say 2020.

4 years agomaint: run 'make update-copyright'
Paul Eggert [Fri, 1 Jan 2021 07:28:52 +0000 (07:28 +0000)]
maint: run 'make update-copyright'

4 years agoautoupdate
Paul Eggert [Fri, 1 Jan 2021 07:24:28 +0000 (23:24 -0800)]
autoupdate

4 years agofilename: change filename.h comment to LGPLv2.1+
Paul Eggert [Fri, 1 Jan 2021 03:29:08 +0000 (19:29 -0800)]
filename: change filename.h comment to LGPLv2.1+

* lib/filename.h: Change license notice to match what should be in
glibc, and what modules/filename specifies.  This is to simplify
syncing with glibc.

4 years agodoc: mention year-0 bugs in Solaris etc.
Paul Eggert [Fri, 1 Jan 2021 03:14:49 +0000 (19:14 -0800)]
doc: mention year-0 bugs in Solaris etc.

* doc/posix-functions/gmtime.texi, doc/posix-functions/gmtime_r.texi:
* doc/posix-functions/localtime.texi:
* doc/posix-functions/localtime_r.texi:
* doc/posix-functions/mktime.texi:
Mention year-0 bugs in localtime etc.

4 years agoptsname_r: Fix test failure on Solaris.
Bruno Haible [Fri, 1 Jan 2021 00:12:08 +0000 (01:12 +0100)]
ptsname_r: Fix test failure on Solaris.

* lib/ptsname_r.c (__ptsname_r) [__sun]: Don't test the major number of
the device.

4 years agoposixtm tests: Disable part of the test on plaforms where it fails.
Bruno Haible [Thu, 31 Dec 2020 23:42:34 +0000 (00:42 +0100)]
posixtm tests: Disable part of the test on plaforms where it fails.

* tests/test-posixtm.c (T): Disable two tests on Solaris.

4 years agopoll tests: Avoid test failure on AIX.
Bruno Haible [Thu, 31 Dec 2020 22:49:25 +0000 (23:49 +0100)]
poll tests: Avoid test failure on AIX.

* tests/test-poll.c (test_pipe): Disable the "expecting POLLHUP after
shutdown" test on AIX.
* doc/posix-functions/poll.texi: Mention the AIX bug.

4 years agopoll tests: Avoid test failure on BSD and Solaris systems.
Bruno Haible [Thu, 31 Dec 2020 22:38:16 +0000 (23:38 +0100)]
poll tests: Avoid test failure on BSD and Solaris systems.

* tests/test-poll.c (test_accept_first, test_socket_pair): Disable the
"expecting POLLHUP after shutdown" test on all platforms except Linux.

4 years agofnmatch: merge from glibc + proposal
Paul Eggert [Thu, 31 Dec 2020 21:35:53 +0000 (13:35 -0800)]
fnmatch: merge from glibc + proposal

This merges the change proposed by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121212.html
which fixes a Gnulib bug that led to a failed assert.
* lib/fnmatch_loop.c (EXT): Use signed level, not unsigned, and
check that it stays nonnegative.  Use __flexarr instead of
FLEXIBLE_ARRAY_MEMBER, to port better to glibc.
* tests/test-fnmatch.c (main): New test cases, taken from glibc.

4 years agoglob: merge proposed glibc changes
Paul Eggert [Thu, 31 Dec 2020 17:05:13 +0000 (09:05 -0800)]
glob: merge proposed glibc changes

This merges the change proposed by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121211.html
* lib/glob.c (__lstat64, __stat64) [_LIBC]: Remove.

4 years agomemalign: Work around Solaris bug.
Bruno Haible [Thu, 31 Dec 2020 21:18:05 +0000 (22:18 +0100)]
memalign: Work around Solaris bug.

* lib/memalign.c: New file.
* m4/memalign.m4: New file.
* modules/memalign (Files): Add them.
(Depends-on): Add malloc-h.
(configure.ac): Invoke gl_FUNC_MEMALIGN. Conditionally compile
memalign.c. Set module indicator.
(Include): Include <malloc.h> unconditionally.
* doc/glibc-functions/memalign.texi: Mention the Solaris issues.

4 years agomalloc-h: Add tests.
Bruno Haible [Thu, 31 Dec 2020 21:17:31 +0000 (22:17 +0100)]
malloc-h: Add tests.

* tests/test-malloc-h.c: New file.
* modules/malloc-h-tests: New file.
* tests/test-malloc-h-c++.cc: New file.
* modules/malloc-h-c++-tests: New file.

4 years agomalloc-h: New module.
Bruno Haible [Thu, 31 Dec 2020 21:16:52 +0000 (22:16 +0100)]
malloc-h: New module.

* lib/malloc.in.h: New file.
* m4/malloc_h.m4: New file.
* modules/malloc-h: New file.
* doc/glibc-headers/malloc.texi: New file.
* doc/gnulib.texi (Glibc Header File Substitutes): Include it.

4 years agounistd: Fix portability warnings.
Bruno Haible [Thu, 31 Dec 2020 18:41:32 +0000 (19:41 +0100)]
unistd: Fix portability warnings.

* lib/unistd.in.h (fchownat, unlinkat): Fix module name in warning.

4 years agoautoupdate
Karl Berry [Thu, 31 Dec 2020 16:41:43 +0000 (08:41 -0800)]
autoupdate

4 years agoautoupdate
Karl Berry [Thu, 31 Dec 2020 16:40:57 +0000 (08:40 -0800)]
autoupdate

4 years agoutime: Fix compilation error on macOS and Solaris 9 (regr. 2020-12-24).
Bruno Haible [Thu, 31 Dec 2020 16:16:57 +0000 (17:16 +0100)]
utime: Fix compilation error on macOS and Solaris 9 (regr. 2020-12-24).

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

* lib/utime.c: Include <errno.h>.

4 years agosrclistvars.sh doc unusual repo urls
Karl Berry [Wed, 30 Dec 2020 15:27:14 +0000 (07:27 -0800)]
srclistvars.sh doc unusual repo urls

4 years agogetlogin tests, getlogin_r tests: Avoid failure on Solaris OpenIndiana.
Bruno Haible [Wed, 30 Dec 2020 13:58:41 +0000 (14:58 +0100)]
getlogin tests, getlogin_r tests: Avoid failure on Solaris OpenIndiana.

* tests/test-getlogin.c (main): Don't fail if getlogin() returns NULL
with no errno.
* tests/test-getlogin_r.c (main): Don't fail if getlogin_r() returns
EINVAL.

4 years ago* lib/canonicalize-lgpl.c (realpath_stk): Set errno properly.
Paul Eggert [Wed, 30 Dec 2020 06:17:46 +0000 (22:17 -0800)]
* lib/canonicalize-lgpl.c (realpath_stk): Set errno properly.

4 years agoregex-tests: tweak to avoid a clang-10 warning
Jim Meyering [Wed, 30 Dec 2020 04:00:36 +0000 (20:00 -0800)]
regex-tests: tweak to avoid a clang-10 warning

* tests/test-regex.c: Compare with explicit zero, rather than
as boolean to avoid this from clang-10:
test-regex.c:315:9: error: converting the result of '<<' to a \
  boolean always evaluates to true \
  [-Werror,-Wtautological-constant-compare]
if (! REG_STARTEND)

4 years agohash: add casts-to-float to avoid clang-10 warnings
Jim Meyering [Wed, 30 Dec 2020 03:34:55 +0000 (19:34 -0800)]
hash: add casts-to-float to avoid clang-10 warnings

* lib/hash.c (compute_bucket_size): Cast SIZE_MAX to float
to avoid this warning from clang-10 (for use in grep):
  hash.c:501:11: error: implicit conversion from 'unsigned long' \
    to 'float' changes value from 18446744073709551615 to \
    18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
  if (SIZE_MAX <= new_candidate)
(hash_insert_if_absent): Likewise.

4 years agocanonicalize: fix size overflow treatment
Paul Eggert [Wed, 30 Dec 2020 03:34:59 +0000 (19:34 -0800)]
canonicalize: fix size overflow treatment

This also has some minor cleanups.
* lib/canonicalize-lgpl.c, lib/canonicalize.c: No need to include
stddef.h, since the code no longer refers directly to ptrdiff_t.
* lib/canonicalize-lgpl.c (realpath_stk):
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Treat size overflow like other out-of-memory.
* lib/canonicalize.c: No need to include stdlib.h, since
the code no longer refers to stdlib.h functions (other
than those that canonicalize.h must declare).
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Do not bother terminating the string result on error.

4 years agolist-c++, [o]map-c++, [o]set-c++: Fix conflict with 'free-posix' module.
Bruno Haible [Wed, 30 Dec 2020 01:12:33 +0000 (02:12 +0100)]
list-c++, [o]map-c++, [o]set-c++: Fix conflict with 'free-posix' module.

* lib/gl_list.hh: Include <stdlib.h>.
* lib/gl_map.hh: Likewise.
* lib/gl_omap.hh: Likewise.
* lib/gl_set.hh: Likewise.
* lib/gl_oset.hh: Likewise.

4 years agocanonicalize: fix ptrdiff_t overflow bug
Paul Eggert [Wed, 30 Dec 2020 01:08:11 +0000 (17:08 -0800)]
canonicalize: fix ptrdiff_t overflow bug

Problem reported by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121182.html
* lib/canonicalize-lgpl.c, lib/canonicalize.c:
Include intprops.h.
(NARROW_ADDRESSES): New constant.
* lib/canonicalize-lgpl.c (realpath_stk):m
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Work even if strlen (END) does not fit in idx_t, or if adding
N to it overflows.
* modules/canonicalize, modules/canonicalize-lgpl (Depends-on):
Add intprops.

4 years agohavelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.
Bruno Haible [Tue, 29 Dec 2020 03:00:53 +0000 (04:00 +0100)]
havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): In
acl_is_expected_elfclass, use 'expr', not 'test'.

4 years agoptsname_r: Fix a compiler warning on Solaris.
Bruno Haible [Tue, 29 Dec 2020 02:05:25 +0000 (03:05 +0100)]
ptsname_r: Fix a compiler warning on Solaris.

* lib/ptsname_r.c (__ptsname_r): Reduce the scope of variable 'err'.

4 years agognulib-tool: Fix logic whether to add a dummy.c.
Bruno Haible [Tue, 29 Dec 2020 01:48:31 +0000 (02:48 +0100)]
gnulib-tool: Fix logic whether to add a dummy.c.

* gnulib-tool (func_remove_if_blocks): New function.
(func_modules_add_dummy): Use it to eliminate all conditional statements
from the automake snippet.

4 years agofaccessat: revert recent EOVERFLOW change
Paul Eggert [Mon, 28 Dec 2020 20:38:52 +0000 (12:38 -0800)]
faccessat: revert recent EOVERFLOW change

I misunderstood the glibc source code.  Deduced from
Adhemerval Zanella’s proposed glibc patch in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121131.html
* doc/posix-functions/faccessat.texi: It is not a problem.
* lib/canonicalize-lgpl.c, lib/canonicalize.c, lib/faccessat.c:
(FACCESSAT_NEVER_OVERFLOWS): Remove. All uses removed.
* lib/faccessat.c: Revert to simpler version now that
LSTAT_FOLLOWS_SLASHED_SYMLINK must be false.
* m4/faccessat.m4 (gl_FUNC_FACCESSAT_EOVERFLOW):
Remove.  All uses removed.
* modules/canonicalize, modules/canonicalize-lgpl (Files):
Remove m4/faccessat.m4.

4 years agocanonicalize-lgpl: accommodate picky cpp
Paul Eggert [Mon, 28 Dec 2020 19:58:38 +0000 (11:58 -0800)]
canonicalize-lgpl: accommodate picky cpp

* lib/canonicalize-lgpl.c: Use "defined FUNC_REALPATH_WORKS" in
case preprocessor is picky.  Reported by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121130.html

4 years agocanonicalize: simplify via scratch_buffer_dupfree
Paul Eggert [Mon, 28 Dec 2020 19:38:58 +0000 (11:38 -0800)]
canonicalize: simplify via scratch_buffer_dupfree

* config/srclist.txt: Adjust accordingly.
* lib/canonicalize-lgpl.c (realpath_stk):
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Simplify by using scratch_buffer_dupfree.
* lib/malloc/scratch_buffer.h (scratch_buffer_dupfree): New function.
* lib/malloc/scratch_buffer_dupfree.c: New file.
* modules/scratch_buffer (Files, Depends-on):
Add malloc/scratch_buffer_dupfree.c.

4 years agoregex: remove glibc21.m4
Paul Eggert [Sun, 27 Dec 2020 19:22:11 +0000 (11:22 -0800)]
regex: remove glibc21.m4

It doesn’t seem to be needed any more; at least, I couldn’t
reproduce the circa-2013 problem.  Perhaps the recent
--conditional-dependencies fixes have removed the need for it.
* m4/glibc21.m4: Remove.  All uses removed.

4 years agognulib-tool: Make --conditional-dependencies work with --with-tests.
Bruno Haible [Sun, 27 Dec 2020 00:21:22 +0000 (01:21 +0100)]
gnulib-tool: Make --conditional-dependencies work with --with-tests.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00236.html>.

* gnulib-tool (func_emit_tests_Makefile_am): Handle conditional
dependencies like func_emit_lib_Makefile_am.

4 years agoexecvpe: Make dependency to stdbool explicit.
Bruno Haible [Sat, 26 Dec 2020 16:02:03 +0000 (17:02 +0100)]
execvpe: Make dependency to stdbool explicit.

* lib/execvpe.c: Include <stdbool.h>.
* modules/execvpe (Depends-on): Add stdbool.

4 years agoexeclp: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:43:58 +0000 (14:43 +0100)]
execlp: Add tests.

* tests/test-execlp-main.c: New file.
* tests/test-execlp.sh: New file.
* modules/execlp-tests: New file.

4 years agoexeclp: New module.
Bruno Haible [Sat, 26 Dec 2020 13:42:38 +0000 (14:42 +0100)]
execlp: New module.

* lib/execlp.c: New file.
* m4/execlp.m4: New file.
* modules/execlp: New file.
* doc/posix-functions/execlp.texi: Mention more Windows problems and the
new module.

4 years agoexecle: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:40:49 +0000 (14:40 +0100)]
execle: Add tests.

* tests/test-execle-main.c: New file.
* tests/test-execle.sh: New file.
* modules/execle-tests: New file.

4 years agoexecle: New module.
Bruno Haible [Sat, 26 Dec 2020 13:39:39 +0000 (14:39 +0100)]
execle: New module.

* lib/execle.c: New file.
* m4/execle.m4: New file.
* modules/execle: New file.
* doc/posix-functions/execle.texi: Mention more Windows problems and the
new module.

4 years agoexecl: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:37:54 +0000 (14:37 +0100)]
execl: Add tests.

* tests/test-execl-main.c: New file.
* tests/test-execl.sh: New file.
* modules/execl-tests: New file.

4 years agoexecl: New module.
Bruno Haible [Sat, 26 Dec 2020 13:36:35 +0000 (14:36 +0100)]
execl: New module.

* lib/execl.c: New file.
* m4/execl.m4: New file.
* modules/execl: New file.
* doc/posix-functions/execl.texi: Mention more Windows problems and the
new module.

4 years agoexecv: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:33:33 +0000 (14:33 +0100)]
execv: Add tests.

* tests/test-execv-main.c: New file.
* tests/test-execv.sh: New file.
* modules/execv-tests: New file.

4 years agoexecv: New module.
Bruno Haible [Sat, 26 Dec 2020 13:31:50 +0000 (14:31 +0100)]
execv: New module.

* lib/execv.c: New file.
* m4/execv.m4: New file.
* modules/execv: New file.
* doc/posix-functions/execv.texi: Mention more Windows problems and the
new module.

4 years agoexecvp: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:29:56 +0000 (14:29 +0100)]
execvp: Add tests.

* tests/test-execvp-main.c: New file.
* tests/test-execvp.sh: New file.
* modules/execvp-tests: New file.

4 years agoexecvp: New module.
Bruno Haible [Sat, 26 Dec 2020 13:28:16 +0000 (14:28 +0100)]
execvp: New module.

* lib/execvp.c: New file.
* m4/execvp.m4: New file.
* modules/execvp: New file.
* doc/posix-functions/execvp.texi: Mention more Windows problems and the
new module.

4 years agoexecvpe: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:25:06 +0000 (14:25 +0100)]
execvpe: Add tests.

* tests/test-execvpe-main.c: New file.
* tests/test-execvpe.sh: New file.
* modules/execvpe-tests: New file.

4 years agoexecvpe: New module.
Bruno Haible [Sat, 26 Dec 2020 13:23:10 +0000 (14:23 +0100)]
execvpe: New module.

* lib/execvpe.c: New file.
* m4/execvpe.m4: New file.
* modules/execvpe: New file.
* doc/glibc-functions/execvpe.texi: Mention the Windows problems and the
new module.

4 years agoexecve: Add tests.
Bruno Haible [Sat, 26 Dec 2020 13:19:29 +0000 (14:19 +0100)]
execve: Add tests.

* tests/test-exec-child.c: New file.
* tests/test-execve-main.c: New file.
* tests/test-execve.sh: New file.
* modules/execve-tests: New file.

4 years agoexecve: New module.
Bruno Haible [Sat, 26 Dec 2020 13:13:03 +0000 (14:13 +0100)]
execve: New module.

* lib/execve.c: New file.
* m4/execve.m4: New file.
* modules/execve: New file.
* doc/posix-functions/execve.texi: Mention more Windows problems and the
new module.

4 years agoexecve, execvpe, execvp, execv, execl, execle, execlp: Prepare modules.
Bruno Haible [Sat, 26 Dec 2020 13:09:29 +0000 (14:09 +0100)]
execve, execvpe, execvp, execv, execl, execle, execlp: Prepare modules.

* lib/unistd.in.h (execl, execle, execlp, execv, execve, execvp,
execvpe): Add declarations for the new modules.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether execl, execle, execlp,
execv, execve, execvp, execvpe are declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_EXEC*, HAVE_EXECVPE,
REPLACE_EXEC*.
* modules/unistd (Makefile.am): Substitute GNULIB_EXEC*, HAVE_EXECVPE,
REPLACE_EXEC*.
* tests/test-unistd-c++.cc: Check the signature of execl, execle,
execlp, execv, execve, execvp, execvpe.

4 years agostack: Fix typo in comments.
Bruno Haible [Sat, 26 Dec 2020 12:54:09 +0000 (13:54 +0100)]
stack: Fix typo in comments.

* lib/stack.h: Fix typo in comments.

4 years agobitset: Fix conflict with 'free-posix' module.
Bruno Haible [Sat, 26 Dec 2020 12:48:37 +0000 (13:48 +0100)]
bitset: Fix conflict with 'free-posix' module.

* lib/bitset/base.h: Include <stdlib.h>.

4 years agoidx: change idx.h comment to LGPLv2.1+
Paul Eggert [Sat, 26 Dec 2020 01:26:51 +0000 (17:26 -0800)]
idx: change idx.h comment to LGPLv2.1+

* lib/idx.h: Change license notice to match what should be in glibc.
gnulib-tool will change it as appropriate anyway, so this is just
to simplify syncing with glibc.

4 years agoMODULES.html.sh: Update after 2020-12-19 change.
Thien-Thi Nguyen [Fri, 25 Dec 2020 23:27:37 +0000 (18:27 -0500)]
MODULES.html.sh: Update after 2020-12-19 change.

* MODULES.html.sh (func_all_modules): Do s/free/free-posix/.

4 years agoMake it possible to turn off the mkdir override on Windows.
Bruno Haible [Fri, 25 Dec 2020 17:39:47 +0000 (18:39 +0100)]
Make it possible to turn off the mkdir override on Windows.

* lib/sys_stat.in.h (mkdir): Conditionalize through GNULIB_MKDIR and
GNULIB_MDA_MKDIR. Also support GNULIB_POSIXCHECK.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_MKDIR,
GNULIB_MDA_MKDIR.
* modules/sys_stat (Makefile.am): Substitute GNULIB_MKDIR,
GNULIB_MDA_MKDIR.
* modules/mkdir (configure.ac): Invoke gl_SYS_STAT_MODULE_INDICATOR.
* doc/posix-functions/mkdir.texi: Mention also the 'sys_stat' module.

4 years agoMake it possible to turn off each of the Windows oldnames workarounds.
Bruno Haible [Fri, 25 Dec 2020 12:48:17 +0000 (13:48 +0100)]
Make it possible to turn off each of the Windows oldnames workarounds.

* lib/fcntl.in.h (creat, open):  Conditionalize each of the Windows
oldnames workarounds through a GNULIB_MDA_<func> symbol.
* lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise.
* lib/search.in.h (lfind, lsearch): Likewise.
* lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
Likewise.
* lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise.
* lib/string.in.h (memccpy, strdup): Likewise.
* lib/sys_stat.in.h (chmod, umask): Likewise.
* lib/time.in.h (tzset): Likewise.
* lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle,
execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek,
read, rmdir, swab, unlink, write): Likewise.
* lib/utime.in.h (utime): Likewise.
* lib/wchar.in.h (wcsdup): Likewise.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these
GNULIB_MDA_<func> symbols.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
* m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise.
* modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func>
symbols.
* modules/math (Makefile.am): Likewise.
* modules/search (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/sys_stat (Makefile.am): Likewise.
* modules/time (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/utime-h (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.

4 years agocanonicalize, canonicalize-lgpl: remove lint
Paul Eggert [Fri, 25 Dec 2020 05:33:18 +0000 (21:33 -0800)]
canonicalize, canonicalize-lgpl: remove lint

Pacify GCC.  Some of these problems were reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-12/msg00217.html
* lib/canonicalize-lgpl.c, lib/canonicalize.c:
Sort shared include directives, for consistency.
(IF_LINT): New macro.
(suffix_requires_dir_check): Mark with _GL_ATTRIBUTE_PURE.
* lib/canonicalize-lgpl.c (GCC_LINT, _GL_ATTRIBUTE_PURE) [_LIBC]:
New macros.
(realpath_stk): Suppress bogus -Wmaybe-uninitialized warning.
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Omit unused local.  Suppress bogus -Wmaybe-uninitialized warning.

4 years agospawn-pipe: Use posix_spawn by default on native Windows.
Bruno Haible [Fri, 25 Dec 2020 01:16:22 +0000 (02:16 +0100)]
spawn-pipe: Use posix_spawn by default on native Windows.

* lib/spawn-pipe.c (SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN): New macro.
(create_pipe): Use it to decide among the two possible implementations.
* modules/spawn-pipe (Depends-on): Add posix_spawnattr_setpgroup.

4 years agounistd-safer: Implement pipe_safer on native Windows.
Bruno Haible [Fri, 25 Dec 2020 01:16:18 +0000 (02:16 +0100)]
unistd-safer: Implement pipe_safer on native Windows.

* lib/pipe-safer.c (pipe_safer): Don't test HAVE_PIPE.
* modules/unistd-safer (Depends-on): Add pipe-posix.

4 years agoexecute: Use posix_spawn by default on native Windows.
Bruno Haible [Fri, 25 Dec 2020 01:15:38 +0000 (02:15 +0100)]
execute: Use posix_spawn by default on native Windows.

* lib/execute.c (EXECUTE_IMPL_AVOID_POSIX_SPAWN): New macro.
(execute): Use it to decide among the two possible implementations.

4 years agocanonicalize-lgpl: merge proposed libc changes
Paul Eggert [Thu, 24 Dec 2020 22:47:31 +0000 (14:47 -0800)]
canonicalize-lgpl: merge proposed libc changes

This merges the changes proposed for glibc in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121085.html
https://sourceware.org/pipermail/libc-alpha/2020-December/121086.html
* lib/canonicalize-lgpl.c: Include idx.h and filename.h
unconditionally.
(idx_t, IDX_MAX, FILE_SYSTEM_PREFIX_LEN, IS_ABSOLUTE_FILE_NAME)
(ISSLASH) [_LIBC]: Remove.

4 years agoautoupdate
Paul Eggert [Thu, 24 Dec 2020 22:47:31 +0000 (14:47 -0800)]
autoupdate

4 years agoposix_spawn-internal: Implement for native Windows.
Bruno Haible [Thu, 24 Dec 2020 21:18:36 +0000 (22:18 +0100)]
posix_spawn-internal: Implement for native Windows.

* lib/spawni.c (grow_inheritable_handles, shrink_inheritable_handles,
close_inheritable_handles, memiszero, sigisempty, open_handle, do_open,
do_dup2, do_close): New functions.
(__spawni): Implement on native Windows.
* modules/posix_spawn-internal (Depends-on): Add filename,
concat-filename, findprog-in, malloca, windows-spawn.
* doc/posix-functions/posix_spawn.texi: Update.
* doc/posix-functions/posix_spawnp.texi: Likewise.

4 years agowindows-spawn: Export another auxiliary function.
Bruno Haible [Thu, 24 Dec 2020 21:18:27 +0000 (22:18 +0100)]
windows-spawn: Export another auxiliary function.

* lib/windows-spawn.h (convert_CreateProcess_error): New declaration.
* lib/windows-spawn.c (convert_CreateProcess_error): New function,
extracted from spawnpvech.
(spawnpvech): Use it.

4 years agowindows-spawn: Export some more auxiliary functions.
Bruno Haible [Thu, 24 Dec 2020 21:18:21 +0000 (22:18 +0100)]
windows-spawn: Export some more auxiliary functions.

* lib/windows-spawn.h: Include <stdbool.h>.
(struct inheritable_handles): New type.
(init_inheritable_handles, compose_handles_block,
free_inheritable_handles): New declarations.
* lib/windows-spawn.c (init_inheritable_handles, compose_handles_block):
New functions, based on spawnvech.
(free_inheritable_handles): New function.
(spawnpvech): Use them.

4 years agowindows-spawn: Export another auxiliary function.
Bruno Haible [Thu, 24 Dec 2020 21:18:18 +0000 (22:18 +0100)]
windows-spawn: Export another auxiliary function.

* lib/windows-spawn.h (compose_envblock): New declaration.
* lib/windows-spawn.c (compose_envblock): New function, extracted from
spawnpvech.
(spawnpvech): Use it.

4 years agowindows-spawn: Export an auxiliary function.
Bruno Haible [Thu, 24 Dec 2020 21:18:10 +0000 (22:18 +0100)]
windows-spawn: Export an auxiliary function.

* lib/windows-spawn.h (compose_command): New declaration.
* lib/windows-spawn.c (compose_command): New function, extracted from
spawnpvech.
(spawnpvech): Use it.

4 years agoposix_spawn* tests: Add support for native Windows.
Bruno Haible [Thu, 24 Dec 2020 21:14:38 +0000 (22:14 +0100)]
posix_spawn* tests: Add support for native Windows.

* tests/test-posix_spawn-open1.c (DATA_FILENAME): Treat native Windows
like Cygwin.
* tests/test-posix_spawn-dup2-stdin.c (main): Don't assume the signals
SIGHUP and SIGPIPE. On native Windows, don't call
posix_spawnattr_setsigmask.
* tests/test-posix_spawn-dup2-stdout.c (main): Likewise.
* tests/test-posix_spawn-fchdir.c (main): Likewise.
* tests/test-posix_spawn-chdir.c (test): Likewise. Accept the child
output from Cygwin's 'pwd' program.
* tests/test-posix_spawn-script.c (main): On native Windows, skip the
executable-shell-script part of the test.
* tests/test-posix_spawnp-script.c (main): Likewise.
* modules/posix_spawn-tests (Depends-on): Add freopen, waitpid.
(configure.ac): Don't define the POSIX_SPAWN_PORTED conditional.
(Makefile.am): Don't test the POSIX_SPAWN_PORTED conditional.
* modules/posix_spawnp-tests (Depends-on): Add  waitpid.
(configure.ac): Don't define the POSIX_SPAWN_PORTED conditional.
(Makefile.am): Don't test the POSIX_SPAWN_PORTED conditional.
* modules/posix_spawn_file_actions_addchdir-tests (Makefile.am): Don't
test the POSIX_SPAWN_PORTED conditional.
* modules/posix_spawn_file_actions_addfchdir-tests (configure.ac):
Define the POSIX_SPAWN_PORTED conditional here.