]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agofmal: Work around glibc 2.17 bug on x86_64.
Bruno Haible [Sun, 4 Sep 2022 02:48:31 +0000 (04:48 +0200)]
fmal: Work around glibc 2.17 bug on x86_64.

* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Test against bug seen on glibc 2.17
x86_64.
* doc/posix-functions/fmal.texi: Update info.

2 years agoFix a compilation error in C++ mode on Solaris 11.4.
Bruno Haible [Sun, 4 Sep 2022 00:52:14 +0000 (02:52 +0200)]
Fix a compilation error in C++ mode on Solaris 11.4.

* lib/uchar.in.h (c32rtomb): Enable the C++ alias warning only on
glibc ≥ 2.16 systems. Fix a GNULIB_POSIXCHECK mistake.
(mbrtoc32): Enable the C++ alias warning only on glibc ≥ 2.16 systems.

2 years agoFix compilation errors of C++ tests on Solaris 10 with Sun C++.
Bruno Haible [Sat, 3 Sep 2022 23:14:18 +0000 (01:14 +0200)]
Fix compilation errors of C++ tests on Solaris 10 with Sun C++.

* modules/string-c++-tests (Makefile.am): Link test-string-c++ with
$(LIBUNISTRING).
* modules/wchar-c++-tests (Makefile.am): Link test-wchar-c++ with
$(LIBUNISTRING).

2 years agoFix a compilation error in C++ mode on FreeBSD 13.1.
Bruno Haible [Sat, 3 Sep 2022 20:40:05 +0000 (22:40 +0200)]
Fix a compilation error in C++ mode on FreeBSD 13.1.

* lib/signal.in.h: Don't include <pthread.h> on FreeBSD ≥ 8.0.
* lib/sys_select.in.h: Don't include <sys/time.h> on FreeBSD.

2 years agogetrandom: Fix compilation error in C++ mode on FreeBSD 12.
Bruno Haible [Sat, 3 Sep 2022 00:48:38 +0000 (02:48 +0200)]
getrandom: Fix compilation error in C++ mode on FreeBSD 12.

* lib/sys_random.in.h (getrandom): Enable the C++ alias warning only on
glibc ≥ 2.25 systems.

2 years agomath C++ tests: Fix compilation error with clang on FreeBSD 13.
Bruno Haible [Fri, 2 Sep 2022 22:56:19 +0000 (00:56 +0200)]
math C++ tests: Fix compilation error with clang on FreeBSD 13.

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

2 years agostrerror_r-posix: Fix for Hurd.
Bruno Haible [Fri, 2 Sep 2022 21:45:21 +0000 (23:45 +0200)]
strerror_r-posix: Fix for Hurd.

* lib/strerror_r.c (strerror_r): Interpret return value of
__xpg_strerror_r correctly. Remove assumption about how strerror_r
behaves.

2 years agoptsname tests, ptsname_r tests: Fix test failures on Hurd.
Bruno Haible [Fri, 2 Sep 2022 20:47:49 +0000 (22:47 +0200)]
ptsname tests, ptsname_r tests: Fix test failures on Hurd.

* tests/test-ptsname.c (main): On Hurd, test only the BSD ptys that
actually exist on Hurd.
* tests/test-ptsname_r.c (main): Likewise.

2 years agostrtol, strtoul: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 18:34:44 +0000 (20:34 +0200)]
strtol, strtoul: Fix compilation error in C++ mode on Solaris 11.

* lib/stdlib.in.h (strtol, strtoul): Enable the C++ alias warning only
on glibc systems.

2 years agoaligned_alloc: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 18:07:03 +0000 (20:07 +0200)]
aligned_alloc: Fix compilation error in C++ mode on Solaris 11.

* lib/stdlib.in.h (aligned_alloc): Enable the C++ alias warning only on
glibc systems.

2 years agogetdomainname: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 17:48:09 +0000 (19:48 +0200)]
getdomainname: Fix compilation error in C++ mode on Solaris 11.

* lib/unistd.in.h (getdomainname): Enable the C++ alias warning only on
glibc systems.

2 years agoFix mistake in backporting "chmod: New module.".
Bruno Haible [Thu, 1 Sep 2022 01:46:05 +0000 (03:46 +0200)]
Fix mistake in backporting "chmod: New module.".

2 years ago* m4/gnulib-common.m4: Fix comment.
Paul Eggert [Tue, 23 Aug 2022 16:41:27 +0000 (09:41 -0700)]
* m4/gnulib-common.m4: Fix comment.

2 years agotempname: don't lose entropy in seed
Paul Eggert [Mon, 22 Aug 2022 20:43:18 +0000 (15:43 -0500)]
tempname: don't lose entropy in seed

* lib/tempname.c (random_bits): Don't lose entropy in S
in the rare case where where the template has more than 10 Xs.
From a suggestion by Bruno Haible in:
https://bugs.gnu.org/57129#149

2 years agotempname: fix multithreading, ASLR leak etc.
Paul Eggert [Mon, 22 Aug 2022 19:07:27 +0000 (12:07 -0700)]
tempname: fix multithreading, ASLR leak etc.

Fix problems with tempname and multithreading, entropy loss,
and missing clock data (this last on non-GNU platforms).
See analysis by Bruno Haible in:
https://bugs.gnu.org/57129#149
While looking into this, I noticed that tempname can leak
info derived from ASLR into publicly-visible file names,
which is a no-no.  Fix that too.
* lib/tempname.c: Don't include stdalign.h.
(HAS_CLOCK_ENTROPY): Remove.
(mix_random_values): New function.
(random_bits): Use it.  Args are now new value address and
old value, and this function now returns a success indicator.
Omit old USE_GETRANDOM argument: always try getrandom now, as
there is no good reason not to now that GRND_NONBLOCK is used.
Caller changed.  Use CLOCK_REALTIME for for ersatz entropy,
as CLOCK_MONOTONIC doesn't work on some platforms.
Also, mix in ersatz entropy from tv_sec and from clock ().
(try_tempname_len): Do not mix in ASLR-based entropy, as
the result is published to the world and ASLR should be private.
Do not try to use a static var as that has issues if multithreaded.
Instead, simply generate new random bits.
Worry about bias only with high-quality random bits.
* modules/tempname (Depends-on): Do not depend on stdalign.

2 years agotempname: merge 64-bit time_t fix from glibc
Paul Eggert [Mon, 22 Aug 2022 19:22:52 +0000 (12:22 -0700)]
tempname: merge 64-bit time_t fix from glibc

This merges glibc commit 52a5fe70a2c77935afe807fb6e904e512ddd894e
"Use 64 bit time_t stat internally".
* lib/tempname.c (struct_stat64) [_LIBC]: Use struct __stat64_t64.
(__lstat64_time64) [!_LIBC]: Rename from __lstat64.
All uses changed.
(direxists): Use __stat64_time64 instead of __stat64.

2 years agotempname: Add more tests.
Bruno Haible [Tue, 16 Aug 2022 19:50:11 +0000 (21:50 +0200)]
tempname: Add more tests.

Based on scenario described by Eli Zaretskii in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-08/msg00043.html>.

* tests/test-tempname.c (main): Add another test.
* modules/tempname-tests (Status): Mark the test as unportable.

2 years agotempname: generate better names for MinGW Emacs
Paul Eggert [Tue, 16 Aug 2022 19:06:48 +0000 (12:06 -0700)]
tempname: generate better names for MinGW Emacs

On MinGW, GNU Emacs disables clock_gettime, which reliably breaks
some of gen_tempname’s optimistic callers.  Work around the
problem by making the generated names less predictable.  We don’t
need cryptographic randomness here, just enough unpredictability
to keep Emacs happy most of the time.
* lib/tempname.c (HAS_CLOCK_ENTROPY): New macro.
(random_bits): Use it.
(try_tempname_len): On systems lacking clock entropy, maintain
state so that gen_filename generates less-predictable names on
successive successful calls.

2 years agotempname: Add tests.
Bruno Haible [Tue, 16 Aug 2022 13:27:50 +0000 (15:27 +0200)]
tempname: Add tests.

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

2 years agotempname: Fix a comment.
Bruno Haible [Mon, 15 Aug 2022 21:21:05 +0000 (23:21 +0200)]
tempname: Fix a comment.

* lib/tempname.c (try_tempname_len): Use of entropy makes the function
more, not less, secure.

2 years agotempname: remove incorrect comment
Paul Eggert [Mon, 15 Aug 2022 20:04:08 +0000 (13:04 -0700)]
tempname: remove incorrect comment

* lib/tempname.c, lib/tempname.h: Remove incorrect comment,
as the names are not necessarily hard to predict (Bug#57129).

2 years agostdbool: port to C23
Paul Eggert [Sun, 14 Aug 2022 03:00:02 +0000 (20:00 -0700)]
stdbool: port to C23

* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Copy from bleeding-edge
Autoconf.  Don’t define if Autoconf 2.72 or later.
* tests/test-stdbool.c (bool, false, true)
(__bool_true_false_are_defined): Do not require these to be
defined.  C23 still requires __bool_true_false_are_defined but
marks it as obsolescent, and it’s no longer worth testing.
(WORKING_BOOL): New macro, which also tests __STDC_VERSION__.
Use it in tests for working bool.
Test for bool instead of for _Bool, which C23 says is obsolescent.

2 years agohamt: fix technically undefined behavior
Marc Nieper-Wißkirchen [Fri, 12 Aug 2022 14:00:23 +0000 (16:00 +0200)]
hamt: fix technically undefined behavior

Bug reported by Bruno Haible in
<https://lists.gnu.org/r/bug-gnulib/2022-04/msg00023.html>.
* lib/hamt.c (entry_insert): Remove technically undefined
behavior when shifting an integer of N bits by N or more bits.

2 years agoverify: port ‘assume’ to C23 non-GCC
Paul Eggert [Wed, 10 Aug 2022 06:20:48 +0000 (23:20 -0700)]
verify: port ‘assume’ to C23 non-GCC

* lib/verify.h (assume): Use C23's unreachable if available
and if GCC and/or MSC primitives are not available.

2 years agogendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).
Bruno Haible [Sun, 31 Jul 2022 05:16:34 +0000 (07:16 +0200)]
gendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).

* build-aux/gendocs.sh (PERL): Use double-quotes, not single-quotes.

2 years agoautoupdate
Karl Berry [Tue, 26 Jul 2022 14:55:39 +0000 (07:55 -0700)]
autoupdate

2 years agoAvoid DoS vulnerability through unsafe default assignment.
Bruno Haible [Sat, 23 Jul 2022 10:01:35 +0000 (12:01 +0200)]
Avoid DoS vulnerability through unsafe default assignment.

See https://www.shellcheck.net/wiki/SC2223 .

* MODULES.html.sh (func_tmpdir): Surround default assignment with
double-quotes.
* build-aux/bootstrap: Likewise.
* build-aux/csharpcomp.sh.in (func_tmpdir): Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/libtool-next-version (func_tmpdir): Likewise.
* config/srclist-update: Likewise.
* gnulib-tool (func_tmpdir): Likewise.
* posix-modules (func_tmpdir): Likewise.
* tests/test-atexit.sh: Likewise.
* tests/test-btoc32-1.sh: Likewise.
* tests/test-btoc32-2.sh: Likewise.
* tests/test-btowc1.sh: Likewise.
* tests/test-btowc2.sh: Likewise.
* tests/test-c-dtoastr.sh: Likewise.
* tests/test-c-ldtoastr.sh: Likewise.
* tests/test-c-snprintf.sh: Likewise.
* tests/test-c-strcase.sh: Likewise.
* tests/test-c-vasprintf.sh: Likewise.
* tests/test-c-vsnprintf.sh: Likewise.
* tests/test-c-xvasprintf.sh: Likewise.
* tests/test-c32isalnum.sh: Likewise.
* tests/test-c32isalpha.sh: Likewise.
* tests/test-c32isblank.sh: Likewise.
* tests/test-c32iscntrl.sh: Likewise.
* tests/test-c32isdigit.sh: Likewise.
* tests/test-c32isgraph.sh: Likewise.
* tests/test-c32islower.sh: Likewise.
* tests/test-c32isprint.sh: Likewise.
* tests/test-c32ispunct.sh: Likewise.
* tests/test-c32isspace.sh: Likewise.
* tests/test-c32isupper.sh: Likewise.
* tests/test-c32isxdigit.sh: Likewise.
* tests/test-c32rtomb.sh: Likewise.
* tests/test-c32snrtombs-1.sh: Likewise.
* tests/test-c32snrtombs-2.sh: Likewise.
* tests/test-c32snrtombs-3.sh: Likewise.
* tests/test-c32snrtombs-4.sh: Likewise.
* tests/test-c32srtombs-1.sh: Likewise.
* tests/test-c32srtombs-2.sh: Likewise.
* tests/test-c32srtombs-3.sh: Likewise.
* tests/test-c32srtombs-4.sh: Likewise.
* tests/test-c32stombs-1.sh: Likewise.
* tests/test-c32stombs-2.sh: Likewise.
* tests/test-c32stombs-3.sh: Likewise.
* tests/test-c32stombs-4.sh: Likewise.
* tests/test-closein.sh: Likewise.
* tests/test-copy-acl.sh (func_tmpdir): Likewise.
* tests/test-copy-file.sh (func_tmpdir): Likewise.
* tests/test-dprintf-posix.sh: Likewise.
* tests/test-execl.sh: Likewise.
* tests/test-execle.sh: Likewise.
* tests/test-execlp.sh: Likewise.
* tests/test-execv.sh: Likewise.
* tests/test-execve.sh: Likewise.
* tests/test-execvp.sh: Likewise.
* tests/test-execvpe.sh: Likewise.
* tests/test-file-has-acl.sh (func_tmpdir): Likewise.
* tests/test-fprintf-posix.sh: Likewise.
* tests/test-init.sh: Likewise.
* tests/test-iswdigit.sh: Likewise.
* tests/test-iswxdigit.sh: Likewise.
* tests/test-mbmemcasecmp1.sh: Likewise.
* tests/test-mbmemcasecmp2.sh: Likewise.
* tests/test-mbmemcasecmp3.sh: Likewise.
* tests/test-mbmemcasecoll1.sh: Likewise.
* tests/test-mbmemcasecoll2.sh: Likewise.
* tests/test-mbmemcasecoll3.sh: Likewise.
* tests/test-mbrtoc32-1.sh: Likewise.
* tests/test-mbrtoc32-2.sh: Likewise.
* tests/test-mbrtoc32-3.sh: Likewise.
* tests/test-mbrtoc32-4.sh: Likewise.
* tests/test-mbrtowc1.sh: Likewise.
* tests/test-mbrtowc2.sh: Likewise.
* tests/test-mbrtowc3.sh: Likewise.
* tests/test-mbrtowc4.sh: Likewise.
* tests/test-mbscasecmp.sh: Likewise.
* tests/test-mbscasestr2.sh: Likewise.
* tests/test-mbscasestr3.sh: Likewise.
* tests/test-mbscasestr4.sh: Likewise.
* tests/test-mbschr.sh: Likewise.
* tests/test-mbscspn.sh: Likewise.
* tests/test-mbsinit.sh: Likewise.
* tests/test-mbsncasecmp.sh: Likewise.
* tests/test-mbsnrtoc32s-1.sh: Likewise.
* tests/test-mbsnrtoc32s-2.sh: Likewise.
* tests/test-mbsnrtoc32s-3.sh: Likewise.
* tests/test-mbsnrtoc32s-4.sh: Likewise.
* tests/test-mbsnrtowcs1.sh: Likewise.
* tests/test-mbsnrtowcs2.sh: Likewise.
* tests/test-mbsnrtowcs3.sh: Likewise.
* tests/test-mbsnrtowcs4.sh: Likewise.
* tests/test-mbspbrk.sh: Likewise.
* tests/test-mbspcasecmp.sh: Likewise.
* tests/test-mbsrchr.sh: Likewise.
* tests/test-mbsrtoc32s-1.sh: Likewise.
* tests/test-mbsrtoc32s-2.sh: Likewise.
* tests/test-mbsrtoc32s-3.sh: Likewise.
* tests/test-mbsrtoc32s-4.sh: Likewise.
* tests/test-mbsrtowcs1.sh: Likewise.
* tests/test-mbsrtowcs2.sh: Likewise.
* tests/test-mbsrtowcs3.sh: Likewise.
* tests/test-mbsrtowcs4.sh: Likewise.
* tests/test-mbsspn.sh: Likewise.
* tests/test-mbsstr2.sh: Likewise.
* tests/test-mbsstr3.sh: Likewise.
* tests/test-mbstoc32s-1.sh: Likewise.
* tests/test-mbstoc32s-2.sh: Likewise.
* tests/test-mbstoc32s-3.sh: Likewise.
* tests/test-mbstoc32s-4.sh: Likewise.
* tests/test-nl_langinfo.sh: Likewise.
* tests/test-parse-duration.sh (func_tmpdir): Likewise.
* tests/test-perror.sh: Likewise.
* tests/test-printf-posix.sh: Likewise.
* tests/test-set-mode-acl.sh (func_tmpdir): Likewise.
* tests/test-setlocale1.sh: Likewise.
* tests/test-strtod1.sh: Likewise.
* tests/test-strtold1.sh: Likewise.
* tests/test-unicodeio2.sh: Likewise.
* tests/test-unicodeio3.sh: Likewise.
* tests/test-vasnprintf-posix2.sh: Likewise.
* tests/test-vc-list-files-cvs.sh: Likewise.
* tests/test-vc-list-files-git.sh: Likewise.
* tests/test-vdprintf-posix.sh: Likewise.
* tests/test-vfprintf-posix.sh: Likewise.
* tests/test-vprintf-posix.sh: Likewise.
* tests/test-wcrtomb.sh: Likewise.
* tests/test-wcsnrtombs1.sh: Likewise.
* tests/test-wcsnrtombs2.sh: Likewise.
* tests/test-wcsnrtombs3.sh: Likewise.
* tests/test-wcsnrtombs4.sh: Likewise.
* tests/test-wcsrtombs1.sh: Likewise.
* tests/test-wcsrtombs2.sh: Likewise.
* tests/test-wcsrtombs3.sh: Likewise.
* tests/test-wcsrtombs4.sh: Likewise.
* tests/test-xprintf-posix.sh: Likewise.
* tests/test-xstrtoimax.sh: Likewise.
* tests/test-xstrtol.sh: Likewise.
* tests/test-xstrtoll.sh: Likewise.
* tests/test-xstrtoumax.sh: Likewise.
* tests/test-yesno.sh: Likewise.
* tests/unicase/test-locale-language.sh: Likewise.
* tests/unicase/test-ulc-casecmp1.sh: Likewise.
* tests/unicase/test-ulc-casecmp2.sh: Likewise.
* tests/unicase/test-ulc-casecoll1.sh: Likewise.
* tests/unicase/test-ulc-casecoll2.sh: Likewise.
* tests/unigbrk/test-ulc-grapheme-breaks.sh: Likewise.
* tests/unistdio/test-u16-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u16-vasnprintf3.sh: Likewise.
* tests/unistdio/test-u32-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u32-vasnprintf3.sh: Likewise.
* tests/unistdio/test-u8-vasnprintf2.sh: Likewise.
* tests/unistdio/test-u8-vasnprintf3.sh: Likewise.
* tests/unistdio/test-ulc-vasnprintf2.sh: Likewise.
* tests/unistdio/test-ulc-vasnprintf3.sh: Likewise.
* tests/uniwbrk/test-ulc-wordbreaks.sh: Likewise.
* tests/uniwidth/test-uc_width2.sh: Likewise.

2 years agodoc: Update README.
Bruno Haible [Sun, 17 Jul 2022 10:55:05 +0000 (12:55 +0200)]
doc: Update README.

* doc/README: Fix stale links (reported by Tzvetelin Katchov). Clarify
the relation to build-aux/gnu-web-doc-update.

2 years agodoc: Fix typo.
Bruno Haible [Thu, 14 Jul 2022 19:57:16 +0000 (21:57 +0200)]
doc: Fix typo.

Reported by Eric Gallager <egall@gwmail.gwu.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-07/msg00045.html>.

* doc/posix-functions/mmap.texi: Add parenthesis.

2 years agosigsegv: Optimize stackvma implementation for AIX 7.
Bruno Haible [Sun, 10 Jul 2022 21:19:03 +0000 (23:19 +0200)]
sigsegv: Optimize stackvma implementation for AIX 7.

Reported by Neha Jain <nehajain29@in.ibm.com> in
<https://lists.gnu.org/archive/html/bug-m4/2022-06/msg00005.html>
via Eric Blake.

* lib/stackvma.c: For AIX, add implementation that uses /proc/$pid/map,
based on lib/vma-iter.c.
(sigsegv_get_vma): Use it on AIX 7 or higher.

2 years agovma-iter: Add support for AIX 7.
Bruno Haible [Sun, 10 Jul 2022 19:52:11 +0000 (21:52 +0200)]
vma-iter: Add support for AIX 7.

* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on AIX.
* lib/vma-iter.c (vma_iterate): Add code for AIX, known to work on
AIX 7.
* lib/get-rusage-as.c: Update comments.
* lib/get-rusage-data.c: Likewise.
* tests/test-get-rusage-as.c (main): Take into account the special
address space organization on AIX in 32-bit mode.

2 years agohavelib: Fix 'configure --help' output.
Bruno Haible [Mon, 4 Jul 2022 22:48:36 +0000 (00:48 +0200)]
havelib: Fix 'configure --help' output.

* m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Fix m4 quoting bug.

2 years agosupersede: Support the file name "/dev/null" on native Windows.
Bruno Haible [Sun, 3 Jul 2022 09:58:03 +0000 (11:58 +0200)]
supersede: Support the file name "/dev/null" on native Windows.

* lib/supersede.c (open_supersede): On native Windows, map "/dev/null"
to "NUL".

2 years agomaint.mk: fix syntax-check for unnecessary hash.h header use
Jim Meyering [Thu, 23 Jun 2022 15:12:44 +0000 (08:12 -0700)]
maint.mk: fix syntax-check for unnecessary hash.h header use

* top/maint.mk (_hash_re): Correct the regexp. It had two problems:
- lacked the "hash_" prefix, so would match non-uses
- failed to detect uses of the hash_x?initialize functions
The former led to an excess/unneeded use of hash.h in coreutils' cut.c.
The latter would have led to a FP "not needed" report for copy.c.

2 years agofchmodat: Fix test failure on native Windows.
Bruno Haible [Tue, 21 Jun 2022 23:46:37 +0000 (01:46 +0200)]
fchmodat: Fix test failure on native Windows.

* modules/fchmodat (Depends-on): Add 'chmod'.

2 years agochmod: Add tests.
Bruno Haible [Tue, 21 Jun 2022 23:45:33 +0000 (01:45 +0200)]
chmod: Add tests.

* tests/test-chmod.c: New file, based on tests/test-lchmod.c.
* modules/chmod-tests: New file.

2 years agochmod: New module.
Bruno Haible [Tue, 21 Jun 2022 23:43:52 +0000 (01:43 +0200)]
chmod: New module.

* lib/sys_stat.in.h (chmod): Declare when GNULIB_CHMOD is 1.
* lib/chmod.c: New file, based on lib/lchmod.c.
* m4/chmod.m4: New file, based on m4/fchmodat.m4.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H): Test whether chmod is declared.
(gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize GNULIB_CHMOD.
(gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_CHMOD.
* modules/sys_stat (Makefile.am): Substitute GNULIB_CHMOD,
REPLACE_CHMOD.
* modules/chmod: New file, based on modules/lchmod.
* doc/posix-functions/chmod.texi: Mention the new module and the
problems on IRIX and Windows.

2 years agolchmod: Simplify.
Bruno Haible [Tue, 21 Jun 2022 21:19:07 +0000 (23:19 +0200)]
lchmod: Simplify.

* lib/lchmod.c: Remove unnecessary include, obsolete since 2020-02-23.

2 years agolchmod: port back to AIX 7.2
Paul Eggert [Mon, 20 Jun 2022 04:30:01 +0000 (23:30 -0500)]
lchmod: port back to AIX 7.2

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html
* lib/lchmod.c: Include string.h, for strlen.
(lchmod): Do not depend on HAVE_READLINK since we now depend on
the readlink module.  Check for AIX 7.2 bug.
* m4/lchmod.m4 (gl_PREREQ_LCHMOD): Do not check for readlink
since we now depend on the readlink module.
* modules/lchmod (Depends-on): Depend on readlink.

2 years agofchmodat: pacify gcc -Wunused-variable
Paul Eggert [Mon, 20 Jun 2022 04:29:07 +0000 (23:29 -0500)]
fchmodat: pacify gcc -Wunused-variable

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html
* lib/fchmodat.c (fchmodat): Remove unused local.

2 years agogetlogin, getlogin_r tests: Really avoid test failure.
Bruno Haible [Sun, 19 Jun 2022 14:14:19 +0000 (16:14 +0200)]
getlogin, getlogin_r tests: Really avoid test failure.

Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00037.html>.

* tests/test-getlogin.h (test_getlogin_result): Parse the contents of
/proc/self/loginuid as an unsigned integer.

2 years agofchmodat: port better to MS-Windows etc.
Paul Eggert [Sun, 12 Jun 2022 20:46:52 +0000 (13:46 -0700)]
fchmodat: port better to MS-Windows etc.

MS-Windows problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00041.html
Although I don’t use MS-Windows I see some related fstatat etc.
problems and am trying to fix them with this further patch.
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod):
* lib/lchown.c (lchown)
[!HAVE_LCHOWN && HAVE_CHOWN && !CHOWN_MODIFIES_SYMLINK]:
* lib/renameatu.c (renameatu)
[HAVE_RENAME && RENAME_TRAILING_SLASH_SOURCE_BUG]:
Use readlinkat/readlink instead of fstatat/lstat to test merely
whether a string names a symlink, as this avoids problems
with EOVERFLOW.  Also, I hope it works around the MS-Windows
issues that Bruno noted.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT):
Check for readlinkat, not lchmod.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not require AC_CANONICAL_HOST
or check for lstat.
(gl_PREREQ_LCHMOD): Check for readlink.
* modules/lchown (Depends-on): Add readlink.  Do not depend on
lstat merely because !HAVE_LCHOWN.
* modules/renameatu (Depends-on): Add fstatat, readlinkat.

2 years agofchmodat: port to old Linux kernel + newer headers
Paul Eggert [Sat, 11 Jun 2022 23:58:25 +0000 (16:58 -0700)]
fchmodat: port to old Linux kernel + newer headers

Problem reported by Lance Fredrickson in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00038.html
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod): Do not rely on AT_EMPTY_PATH as to
whether syscalls work on ""; instead, if a call fails with
ENOENT assume that those syscalls do not work.
Do not use fstatat to determine whether a file is a symlink,
as this has problems with EOVERFLOW.  Use readlinkat instead,
and if it fails with EINVAL then the file is not a symlink.
Remove #if tests on __linux__ || __ANDROID__ || __CYGWIN__
as this has been a maintenance hassle and it’s unlikely
these days that a new platform would #define O_PATH without also
either supporting /proc or keeping it absent.
* modules/fchmodat (Depends-on): Remove fstatat.
There should be no need for either fchmodat or lchmod to depend on
readlinkat, since they use readlinkat only in contexts where it
should work without Gnulib intervention.

2 years agofopen-gnu: Make this module work again (regression 2022-01-03).
Bruno Haible [Mon, 6 Jun 2022 14:34:48 +0000 (16:34 +0200)]
fopen-gnu: Make this module work again (regression 2022-01-03).

Reported by Nelson H. F. Beebe <beebe@math.utah.edu> in
<https://lists.gnu.org/archive/html/platform-testers/2022-04/msg00005.html>.

* modules/fopen-gnu (configure.ac): Invoke gl_STDIO_MODULE_INDICATOR.

2 years agogetlogin, getlogin_r tests: Avoid test failure in specific environments.
Bruno Haible [Mon, 6 Jun 2022 09:55:04 +0000 (11:55 +0200)]
getlogin, getlogin_r tests: Avoid test failure in specific environments.

Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00001.html>.

* modules/getlogin-tests (Depends-on): Add stdbool.
* modules/getlogin_r-tests (Depends-on): Likewise.
* tests/test-getlogin.h: Include stdbool.h.
(test_getlogin_result): On Linux, skip the test if /proc/self/loginuid
contains "-1".

2 years agoautoupdate
Karl Berry [Thu, 26 May 2022 14:24:56 +0000 (07:24 -0700)]
autoupdate

2 years agoautoupdate
Karl Berry [Wed, 25 May 2022 14:54:30 +0000 (07:54 -0700)]
autoupdate

2 years agostrstr-simple: pacify GCC 12.1
Paul Eggert [Sat, 21 May 2022 20:38:29 +0000 (13:38 -0700)]
strstr-simple: pacify GCC 12.1

* lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1
-Wsuggest-attribute=pure (x86-64, -O2).

2 years agoautoupdate
Karl Berry [Fri, 20 May 2022 14:55:14 +0000 (07:55 -0700)]
autoupdate

2 years agostring, wchar: Fix compilation error on MSVC (regression 2021-09-07).
Bruno Haible [Sun, 15 May 2022 11:25:46 +0000 (13:25 +0200)]
string, wchar: Fix compilation error on MSVC (regression 2021-09-07).

* lib/string.in.h (free): For MSVC, add the dllimport specification if
the MSVC headers have it.
* lib/wchar.in.h (free): Likewise.

2 years agoglob tests: Fix a warning (regression from 2022-03-23).
Bruno Haible [Sat, 14 May 2022 20:34:12 +0000 (22:34 +0200)]
glob tests: Fix a warning (regression from 2022-03-23).

* tests/test-glob.c: Include <fcntl.h>.
* modules/glob-tests (Depends-on): Add fcntl-h.

2 years agodfa: fix bug with ‘.’ and UTF-8 Hangul Syllables
Paul Eggert [Sat, 14 May 2022 06:23:35 +0000 (23:23 -0700)]
dfa: fix bug with ‘.’ and UTF-8 Hangul Syllables

This fixes a bug introduced in 2019-12-18T05:41:27Z!eggert@cs.ucla.edu,
an earlier patch that fixed dfa.c to not match invalid UTF-8.
Unfortunately that patch had a couple of typos when dfa.c is
matching against the regular expression ‘.’ (dot).  One typo
caused dfa.c to incorrectly reject the valid UTF-8 sequences
(ED)(90-9F)(80-BF) corresponding to U+D400 through U+D7FF, which
are some Hangul Syllables and Hangul Jamo Extended-B.  The other
typo caused dfa.c to incorrectly reject the valid sequences
(F4)(88-8F)(80-BF)(80-BF) which correspond to U+108000 through
U+10FFFF (Supplemental Private Use Area plane B).
* lib/dfa.c (utf8_classes): Fix typos.
* tests/test-dfa-match.sh: Test the fix.

2 years agomanywarnings: update C warnings for GCC 12
Paul Eggert [Thu, 12 May 2022 22:13:04 +0000 (15:13 -0700)]
manywarnings: update C warnings for GCC 12

Adjust for C programs compiled by GCC 12.
(A C++ expert still needs to look at manywarnings-c++.m4.)
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 12.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbidi-chars=any,ucn
and -Wuse-after-free=3.  Although not enabled by -Wall or -Wextra
they seem suitable for Gnulib-using C code.

2 years agoautoupdate
Karl Berry [Mon, 9 May 2022 15:33:17 +0000 (08:33 -0700)]
autoupdate

2 years agolibc-config: update to match cdefs
Paul Eggert [Thu, 5 May 2022 21:37:21 +0000 (14:37 -0700)]
libc-config: update to match cdefs

* lib/libc-config.h (__attribute_alloc_align__)
(__attribute_maybe_unused, __fortified_attr_access)
(__glibc_fortify, __glibc_fortify_n, __glibc_likely)
(__glibc_safe_len_cond, __glibc_safe_or_unknown_len)
(__glibc_unsafe_len, __glibc_unsigned_or_positive, __wur):
Undef these too, since lib/cdefs.h now defines them
unconditionally.

2 years agocdefs: merge from glibc
Paul Eggert [Thu, 5 May 2022 21:34:23 +0000 (14:34 -0700)]
cdefs: merge from glibc

* lib/cdefs.h (__glibc_safe_or_unknown_len):
Use glibc’s newer version.

2 years agoaf_alg: port to Ubuntu 22.04
Paul Eggert [Mon, 2 May 2022 16:01:08 +0000 (09:01 -0700)]
af_alg: port to Ubuntu 22.04

Without this patch, maintainer builds of coreutils fail on Ubuntu
22.04 with diagnostics like "./lib/gl_openssl.h:79:1: error:
'MD5_Init' is deprecated: Since OpenSSL 3.0
[-Werror=deprecated-declarations]".  From
<https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes>
it appears that Gnulib needs to either define OPENSSL_API_COMPAT
to a version less than 3.0, or use a compatibility layer, or
assume OpenSSL 1.1.0 or later.  The simplest workaround is to
define OPENSSL_API_COMPAT for 1.1.1, the oldest OpenSSL release
still supported.  A better fix would be to rewrite the code to
assume OpenSSL 1.1.1 or later, and stop using the older API.
* lib/md5.h, lib/sha1.h, lib/sha256.h, lib/sha512.h, lib/sm3.h:
Define OPENSSL_API_COMPAT to 0x10101000L to suppress
the deprecation warnings on Ubuntu 22.04.

2 years agostring: Avoid syntax error on glibc systems with GCC 11.
Bruno Haible [Sat, 30 Apr 2022 12:09:00 +0000 (14:09 +0200)]
string: Avoid syntax error on glibc systems with GCC 11.

Reported by Tom Tromey <tromey@adacore.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00075.html>
and by Satadru Pramanik <satadru@umich.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00076.html>.

* lib/string.in.h (strndup): Don't rededeclare strndup if it is defined
as a macro.

2 years agostdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).
Simon Marchi [Thu, 28 Apr 2022 23:47:55 +0000 (01:47 +0200)]
stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).

* lib/stdlib.in.h (free): Add exception specification like glibc does.

2 years agoglob: improve config and test cleanup
Paul Eggert [Thu, 28 Apr 2022 21:40:48 +0000 (14:40 -0700)]
glob: improve config and test cleanup

Config problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00071.html
* m4/glob.m4 (gl_GLOB): Clean up temporary file.
Also, name it conf$$-file not conf-file, so it’s cleaned
up on interrupt.
* modules/glob-tests (MOSTLYCLEANFILES):
Append test-glob.tglobfile, test-glob.tgloblink[123].

2 years agoFix ChangeLog typo
Paul Eggert [Tue, 26 Apr 2022 22:00:24 +0000 (15:00 -0700)]
Fix ChangeLog typo

2 years agoglob: port to NetBSD 9.2
Paul Eggert [Tue, 26 Apr 2022 21:54:26 +0000 (14:54 -0700)]
glob: port to NetBSD 9.2

Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html
* doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability
bugs.  Remove an old common about errno that is no longer true
of POSIX 2018.
* lib/glob.c (glob_in_dir): Convert dirfd arg from void *
to DIR * before passing it to dirfd.

2 years agobackupfile: fix bug when renaming simple backups
Paul Eggert [Thu, 21 Apr 2022 02:34:57 +0000 (19:34 -0700)]
backupfile: fix bug when renaming simple backups

* lib/backupfile.c (backupfile_internal): Fix bug when RENAME
and when doing simple backups.  Problem reported by Steve Ward in:
https://bugs.gnu.org/55029

2 years agoautoupdate
Karl Berry [Tue, 19 Apr 2022 14:48:24 +0000 (07:48 -0700)]
autoupdate

2 years agoverify: port to Mac OS 10.7.5
Paul Eggert [Sun, 17 Apr 2022 02:18:03 +0000 (19:18 -0700)]
verify: port to Mac OS 10.7.5

Mac OS 10.7.5 clang sets __clang_major__ to 4 even though it was
derived from Clang 3.2.  Problem reported by Werner Lemberg in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00779.html
* lib/verify.h (_GL_HAVE__STATIC_ASSERT): Don’t define to 1
when __clang_major__ == 4 && !__cplusplus
&& __STDC_VERSION__ < 201112L && !defined __STRICT_ANSI__.

2 years agosigsegv: Fix compilation error on arceb CPUs.
Bruno Haible [Sat, 16 Apr 2022 01:01:51 +0000 (03:01 +0200)]
sigsegv: Fix compilation error on arceb CPUs.

Reported by Fabrice Fontaine <fontaine.fabrice@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00028.html>.

* m4/stack-direction.m4 (SV_STACK_DIRECTION): Treat the 'arc' variants
like 'arc'.

2 years agostring, wchar: Fix error in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 22:52:26 +0000 (00:52 +0200)]
string, wchar: Fix error in C++ mode on glibc systems with clang.

* lib/string.in.h (free): Add exception specification like glibc does.
* lib/wchar.in.h (free): Likewise.

2 years agostring: Fix errors in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 22:29:04 +0000 (00:29 +0200)]
string: Fix errors in C++ mode on glibc systems with clang.

* lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
strstr, strcasestr): Use _GL_CXXALIASWARN1 also with clang, and add
exception specification.

2 years agomath: Fix errors in C++ mode on glibc systems with clang.
Bruno Haible [Wed, 13 Apr 2022 21:43:05 +0000 (23:43 +0200)]
math: Fix errors in C++ mode on glibc systems with clang.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISFINITE,
GNULIB_NAMESPACE_LACKS_ISINF, GNULIB_NAMESPACE_LACKS_ISNAN,
GNULIB_NAMESPACE_LACKS_SIGNBIT): New macros.
* tests/test-math-c++.cc (isfinite): Skip test if
GNULIB_NAMESPACE_LACKS_ISFINITE is 1.
(isinf): Skip test if GNULIB_NAMESPACE_LACKS_ISINF is 1.
(isnan): Skip test if GNULIB_NAMESPACE_LACKS_ISNAN is 1.
(signbit): Skip test if GNULIB_NAMESPACE_LACKS_SIGNBIT is 1.

2 years agolibgmp: pacify Clang too
Paul Eggert [Fri, 8 Apr 2022 23:45:11 +0000 (16:45 -0700)]
libgmp: pacify Clang too

* lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang.
Problem reported for Emacs by Mattias Engdegård.

2 years agoglob: test for glibc bug 25659
Paul Eggert [Wed, 23 Mar 2022 17:22:51 +0000 (10:22 -0700)]
glob: test for glibc bug 25659

https://sourceware.org/bugzilla/show_bug.cgi?id=25659
* m4/glob.m4 (gl_GLOB): Replace glob if it has bug 25659.
* tests/test-glob.c (main): Test for glibc bug 25659.

2 years agoglob: fix symlink and // issues; improve speed
Paul Eggert [Wed, 23 Mar 2022 16:52:58 +0000 (09:52 -0700)]
glob: fix symlink and // issues; improve speed

* lib/glob.c: Include fcntl.h.
(dirfd) [_LIBC]: New macro.
(GLOB_STAT64, GLOB_LSTAT64): Remove.  Replace all uses with ...
(GLOB_FSTATAT64): ... this new macro.
(glob_in_dir): Treat DT_LNK like DT_UNKNOWN.
Use directory-relative fstatat unless GLOB_ALTDIRFUNC, or dirfd fails.
Avoid duplicate strlen (directory).
Work even if directory is "/", without turning it into "//".
Use a scratch buffer instead of by-hand alloca stuff.
Use mempcpy and memcpy instead of stpcpy and strcpy.
* modules/glob (Depends-on): Add dirfd, fstatat.  Remove stat.
(License): Change from LGPLv2+ to GPL, since it depends on
fstatat.

2 years agoglob: resolve DT_UNKNOWN via is_dir
DJ Delorie [Wed, 23 Mar 2022 16:39:37 +0000 (09:39 -0700)]
glob: resolve DT_UNKNOWN via is_dir

The DT_* values returned by getdents (readdir) are only hints and
not required.  In fact, some Linux filesystems return DT_UNKNOWN
for most entries, regardless of actual type.  This causes make
to mis-match patterns with a trailing slash (via GLOB_ONLYDIR)
(see make's functions/wildcard test case).  Thus, this patch
detects that case and uses is_dir() to make the type known enough
for proper operation.

Performance in non-DT_UNKNOWN cases is not affected.

The lack of DT_* is a well known issue on older XFS installations
(for example, RHEL 7 and 8, Fedora 28) but can be recreated by
creating an XFS filesystem with flags that mimic older behavior:

$ fallocate -l 10G /xfs.fs
$ mkfs.xfs -n ftype=0 -m crc=0 -f /xfs.fs
$ mkdir /xfs
$ mount -o loop /xfs.fs /xfs

2 years agoautoupdate
Karl Berry [Sun, 20 Mar 2022 15:39:33 +0000 (08:39 -0700)]
autoupdate

2 years agoNEWS: Document Automake 1.14 requirement here too.
Ben Pfaff [Sun, 13 Mar 2022 19:16:40 +0000 (12:16 -0700)]
NEWS: Document Automake 1.14 requirement here too.

It had been documented there before for the Automake 1.11 requirement.
* NEWS: Mention the change.

2 years agosigsegv: Add support for Linux/PowerPC (32-bit) with musl libc.
Bruno Haible [Sun, 13 Mar 2022 14:12:46 +0000 (15:12 +0100)]
sigsegv: Add support for Linux/PowerPC (32-bit) with musl libc.

Reported by Khem Raj <raj.khem@gmail.com> in
<https://lists.gnu.org/archive/html/m4-patches/2022-03/msg00000.html>.

* src/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): In the Linux/PowerPC
32-bit case, handle musl libc differently.
* modules/sigsegv (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

2 years agoregex: fix double-free
Paul Eggert [Sat, 12 Mar 2022 01:23:53 +0000 (17:23 -0800)]
regex: fix double-free

* lib/regex_internal.c (re_dfa_add_node): Don’t free storage
twice if an allocation fails.

2 years agoregex: fix minor over-allocation
Paul Eggert [Fri, 11 Mar 2022 21:34:07 +0000 (13:34 -0800)]
regex: fix minor over-allocation

* lib/regexec.c (push_fail_stack): Fix off-by-one error that
over-allocated the stack.

2 years agoregex: fix free_fail_stack undefined behavior
Paul Eggert [Fri, 11 Mar 2022 21:27:33 +0000 (13:27 -0800)]
regex: fix free_fail_stack undefined behavior

* lib/regexec.c (push_fail_stack): Don’t increment number of
re_fail_stack_t entries until after successful allocation.  This
prevents a crash if re_realloc or re_malloc fails here, and a
later free_fail_stack examines regs or a later pop_fail_stack
examines node.  Problem discovered by Coverity scan sent
2022-03-11 11:03:52Z.

2 years agoCreate lib/Makefile.am after gnulib-comp.m4
Paul Eggert [Tue, 1 Mar 2022 18:01:22 +0000 (10:01 -0800)]
Create lib/Makefile.am after gnulib-comp.m4

* gnulib-tool (func_import): Create library makefile after
creating gnulib-comp.m4.  With --gnu-make, the latter depends on
the former.  See <https://bugs.gnu.org/32452#109>.

2 years agogettime-res: fix unlikely overflow bug
Paul Eggert [Sat, 26 Feb 2022 21:13:09 +0000 (13:13 -0800)]
gettime-res: fix unlikely overflow bug

* lib/gettime-res.c (gettime_res): Fix bug when hz * tv_sec overflows.
With 64-bit ‘long’ and nanosecond resolution the bug can occur
starting in the year 2262, with probability about 2e-9.
With 32-bit ‘long’ the bug can occur now, with same probability.
The probability goes up on hosts with worse timestamp resolution.

2 years ago* doc/gnulib-readme.texi: Typo fix.
Paul Eggert [Sat, 26 Feb 2022 19:33:36 +0000 (11:33 -0800)]
* doc/gnulib-readme.texi: Typo fix.

2 years agomodules/unicase/special-casing: Fix compilation error
Darshit Shah [Fri, 25 Feb 2022 23:36:25 +0000 (15:36 -0800)]
modules/unicase/special-casing: Fix compilation error

* modules/unicase/special-casing: Don't prepend $(AM_V_at) to the
second part of a compound command.  It causes make to try and
execute the command "@sed" which doesn't exist.

2 years agoPort __has_attribute to Apple’s Clang renumbering
Paul Eggert [Fri, 25 Feb 2022 23:30:42 +0000 (15:30 -0800)]
Port __has_attribute to Apple’s Clang renumbering

Problem reported by Kirill A. Korinsky in:
https://lists.gnu.org/r/bug-gnulib/2022-02/msg00034.html
* config/srclist.txt: Comment out sys/cdefs.h for now.
* lib/cdefs.h (__glibc_has_attribute):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Port to Apple’s renumbering of Clang versions.

2 years agodoc: add two missing closing parentheses
Benno Schulenberg [Tue, 22 Feb 2022 10:53:35 +0000 (11:53 +0100)]
doc: add two missing closing parentheses

* doc/regex.texi (Syntax Bits): Add missing closing parenthesis.
* doc/regex.texi (BSD Regular Expression Compiling): Likewise.

2 years agognulib-tool: Bump automake dependency.
Simon Josefsson [Tue, 22 Feb 2022 11:47:14 +0000 (12:47 +0100)]
gnulib-tool: Bump automake dependency.

* gnulib-tool (func_emit_lib_Makefile_am)
(func_emit_tests_Makefile_am): Demand Automake ≥ 1.14, for
%reldir%.

2 years agoDocument that Automake ≥ 1.14 is needed (regression 2021-12-15).
Bruno Haible [Sun, 20 Feb 2022 20:04:57 +0000 (21:04 +0100)]
Document that Automake ≥ 1.14 is needed (regression 2021-12-15).

Reported by Simon Josefsson and Mike Frysinger in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-02/msg00010.html>.

* DEPENDENCIES (Automake): Require version 1.14 or newer.

2 years agostring: Fix "mismatched allocation function" warnings regarding strndup.
Bruno Haible [Thu, 10 Feb 2022 01:44:14 +0000 (02:44 +0100)]
string: Fix "mismatched allocation function" warnings regarding strndup.

* lib/string.in.h (strndup): Mark with _GL_ATTRIBUTE_MALLOC and
_GL_ATTRIBUTE_DEALLOC_FREE. For GCC >= 11: Declare also when the
platform already declares the function or when the module 'strndup' is
not in use.

2 years agounictype/category-byname: Fix test failure.
Bruno Haible [Wed, 9 Feb 2022 22:38:59 +0000 (23:38 +0100)]
unictype/category-byname: Fix test failure.

* modules/unictype/category-byname (configure.ac): Bump required
libunistring version.

2 years agoautoupdate
Karl Berry [Wed, 9 Feb 2022 22:01:03 +0000 (14:01 -0800)]
autoupdate

2 years agomaint: restore ChangeLog entries dropped in 2004
Paul Eggert [Mon, 7 Feb 2022 02:38:32 +0000 (18:38 -0800)]
maint: restore ChangeLog entries dropped in 2004

These entries were dropped by mistake in
2004-10-15T22:57:10Z!simon@josefsson.org
which looks like a merge commit of some sort.
I found the mistake by noticing the misspelling "xstrto".

2 years agoparse-datetime: allow calculations to yield -1
Paul Eggert [Sat, 5 Feb 2022 19:05:44 +0000 (11:05 -0800)]
parse-datetime: allow calculations to yield -1

Problem reported by Jeremy Cantrell <https://bugs.gnu.org/50115>.
* lib/parse-datetime.y (parse_datetime_body): When calling mktime,
use an unmodifed and negative tm_wday or tm_yday to detect an error,
as a (time_t) -1 return value is valid on most hosts.
* tests/test-parse-datetime.c (main): Add a test for the bug.

2 years agomaint: fix up stale XARGCASEMATCH comment
Pádraig Brady [Sun, 30 Jan 2022 12:14:24 +0000 (12:14 +0000)]
maint: fix up stale XARGCASEMATCH comment

* lib/argmatch.c: Remove reference to no longer available macro.

2 years agomaintainer-makefile: fix sc_error_message_uppercase false failure
Pádraig Brady [Fri, 28 Jan 2022 14:54:00 +0000 (14:54 +0000)]
maintainer-makefile: fix sc_error_message_uppercase false failure

* top/maint.mk (sc_error_message_uppercase): Don't trigger for
any of the PRI... defines.  Note we add an extra constraint
here that PRI always follows a double quote, but that's
almost always the case, or can be easily made so by prepending
"" for example.

2 years agomaint: Update copyright notices
Paul Eggert [Thu, 27 Jan 2022 18:57:02 +0000 (10:57 -0800)]
maint: Update copyright notices

* build-aux/announce-gen, build-aux/declared.sh:
* build-aux/git-version-gen, build-aux/gitlog-to-changelog:
* build-aux/gnu-web-doc-update, build-aux/gnupload:
* build-aux/increment-serial, build-aux/libtool-next-version:
* build-aux/useless-if-before-free:
Update some copyright notices by hand, that were not
updated automatically.

2 years agocalloc-gnu: fix misspelling in 2022-01-03 patch
Paul Eggert [Thu, 27 Jan 2022 07:00:41 +0000 (23:00 -0800)]
calloc-gnu: fix misspelling in 2022-01-03 patch

Problem reported by Thien-Thi Nguyen in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00170.html
* modules/calloc-gnu (Depends-on):
* modules/calloc-posix (Depends-on):
Fix misspelling of REPLACE_CALLOC_FOR_CALLOC_POSIX.

2 years agoxstrtoimax, xstrtoumax: depend on inttypes-incomplete
Paul Eggert [Mon, 24 Jan 2022 05:07:39 +0000 (21:07 -0800)]
xstrtoimax, xstrtoumax: depend on inttypes-incomplete

This fixes a call to strtoimax without declaring it,
and similarly for strtoumax.
* lib/xstrtoimax.c, lib/xstrtoumax.c (XSTRTOL_INCLUDE_INTTYPES_H):
Define, so that strtoimax and strtoumax are declared.
* lib/xstrtol.c [XSTRTOL_INCLUDE_INTTYPES_H]: Include inttypes.h.
* modules/xstrtoimax, modules/xstrtoumax (Depends-on):
Add inttypes-incomplete.

2 years agoautoupdate
Karl Berry [Wed, 19 Jan 2022 19:00:03 +0000 (11:00 -0800)]
autoupdate

2 years agolog tests: Avoid test failure with nvc 22.1.
Bruno Haible [Sat, 15 Jan 2022 22:39:23 +0000 (23:39 +0100)]
log tests: Avoid test failure with nvc 22.1.

* tests/test-log.h (test_function): With nvc, expect up to 4 ulps error.

2 years agohavelib: Recognize ELF platform despite nvc 22.1.
Bruno Haible [Sat, 15 Jan 2022 22:08:47 +0000 (23:08 +0100)]
havelib: Recognize ELF platform despite nvc 22.1.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Recognize Linux as an ELF
platform, even with a compiler that does not define __ELF__.