]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 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__.

3 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'.

3 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.

3 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.

3 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.

3 years agoautoupdate
Karl Berry [Sun, 10 Apr 2022 14:10:12 +0000 (07:10 -0700)]
autoupdate

3 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.

3 years agoinit.sh: don’t assume gzip
Paul Eggert [Mon, 4 Apr 2022 17:53:12 +0000 (10:53 -0700)]
init.sh: don’t assume gzip

* tests/init.sh (rand_bytes_): Don’t assume gzip is installed.
I found this while testing gzip installation on a platform where I
had removed the installed gzip.  gzip is executed only on
platforms lacking mktemp and /dev/urandom so this code is rarely
used; however, these platforms might also lack gzip since gzip
is neither specified by POSIX or required by the GNU Coding Standards.

3 years agoglob: sync better with glibc
Paul Eggert [Wed, 30 Mar 2022 23:29:11 +0000 (16:29 -0700)]
glob: sync better with glibc

* lib/glob.c (dirfd) [_LIBC]: Use #undef instead of #ifdef.
Problem reported by DJ Delorie.

3 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.

3 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.

3 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

3 years agomaint: bootstrap: split a too-long line
Jim Meyering [Mon, 21 Mar 2022 01:38:50 +0000 (18:38 -0700)]
maint: bootstrap: split a too-long line

* build-aux/bootstrap (git_modules_config): Split longer-than-80 line.

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

3 years agomaintainer-makefile: Improve GnuPG announce-gen options.
Simon Josefsson [Mon, 14 Mar 2022 10:14:50 +0000 (11:14 +0100)]
maintainer-makefile: Improve GnuPG announce-gen options.

* top/maint.mk (gpg_key_emil): New variable.
(gpg_keyring_url): New variable.
(announcement): Pass them as --gpg-key-email and
--gpg-keyring-url.

3 years agoannounce-gen: Modernize GnuPG key retrieval suggestions.
Simon Josefsson [Mon, 14 Mar 2022 10:13:45 +0000 (11:13 +0100)]
announce-gen: Modernize GnuPG key retrieval suggestions.

Based on patch by Darshit Shah in:
https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00022.html

* build-aux/announce-gen (usage): Add --gpg-key-email and
--gpg-keyring-url.
(main): Support the new options.
(main): Don't suggest 'gpg --keyserver' since the situation with
public key servers is complicated and GnuPG version dependent.

3 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.

3 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.

3 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.

3 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.

3 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.

3 years agofts: revert change to use AT_NO_AUTOMOUNT
Paul Eggert [Thu, 10 Mar 2022 21:07:53 +0000 (13:07 -0800)]
fts: revert change to use AT_NO_AUTOMOUNT

* NEWS: Don’t mention AT_NO_AUTOMOUNT.
* lib/fts.c (fts_stat): Don’t use AT_NO_AUTOMOUNT, as
it has no effect with fstatat.

3 years agostatat: now obsolete
Paul Eggert [Wed, 9 Mar 2022 21:54:53 +0000 (13:54 -0800)]
statat: now obsolete

* lib/openat.h (statat, lstatat): Now deprecated.
All uses removed, and replaced with fstatat.
* modules/statat: Mark as obsolete, because it’s confusing:
it’s not clear whether it should use AT_NO_AUTOMOUNT,
which is implied by stat and by lstat, but not by fstatat.
* tests/test-statat.c: Disable deprecated-declarations warnings.

3 years agofts: be consistent about AT_NO_AUTOMOUNT
Paul Eggert [Wed, 9 Mar 2022 19:54:13 +0000 (11:54 -0800)]
fts: be consistent about AT_NO_AUTOMOUNT

* lib/fts.c (fts_stat): Use fstatat with AT_NO_AUTOMOUNT
consistently, instead of sometimes using stat (which implies
AT_NO_AUTOMOUNT) and sometimes using fstatat without AT_NO_AUTOMOUNT.
Remove a goto while we’re at it.

3 years agofcntl-h: add AT_NO_AUTOMOUNT
Pádraig Brady [Mon, 7 Mar 2022 14:04:53 +0000 (14:04 +0000)]
fcntl-h: add AT_NO_AUTOMOUNT

* lib/fcntl.in.h: Define AT_NO_AUTOMOUNT to 0 where not defined.
This is available on Linux since 2.6.38.

3 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>.

3 years agoautoupdate
Karl Berry [Sun, 27 Feb 2022 15:09:13 +0000 (07:09 -0800)]
autoupdate

3 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.

3 years agoDocument clang -fsanitize=undefined glitch
Paul Eggert [Sat, 26 Feb 2022 19:39:32 +0000 (11:39 -0800)]
Document clang -fsanitize=undefined glitch

* doc/gnulib-intro.texi (Unsupported Platforms):
Document incompatibility of ‘clang -fsanitize=undefined’
with Gnulib, and how to work around it by also using
‘-fno-sanitize=pointer-overflow’.

3 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.

3 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.

3 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.

3 years agonanosleep: simplify by using pselect
Paul Eggert [Fri, 25 Feb 2022 19:54:49 +0000 (11:54 -0800)]
nanosleep: simplify by using pselect

GNU Emacs avoids Gnulib’s ‘select’ module and uses only pselect,
which it implements in a special way on MS-DOS.
Unfortunately, though, nanosleep uses ‘select’;
problem reported by Lars Ingebrigtsen (Bug#32452#74).
As far as I can tell, Gnulib nanosleep's use of
‘select’ with signals is only for ancient platforms
that Gnulib no longer cares about, so remove that use of ‘select’.
I don’t know of any platforms that still need this fallback code,
but just in case, fall back to pselect instead, while removing
signal handling that it shouldn’t be needed nowadays.
* lib/nanosleep.c: Do not include sig-handler.h, sys/time.h.
(SIGCONT, suspended, sighandler, my_usleep): Remove.
(nanosleep) [!HAVE_BUG_BIG_NANOSLEEP && !(_WIN32 && !__CYGWIN__)]:
Just call pselect.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Do not check for sys/time.h
or call gl_FUNC_SELECT.  Do not include sys/time.h or worry
about LIBSOCKET.
(gl_PREREQ_NANOSLEEP): Remove as it’s no longer needed.
All uses removed.
* modules/nanosleep (Depends-on): Add pselect.
Remove select, sigaction, sys_time.

3 years agouserspec: warn about '.' separator
Paul Eggert [Fri, 25 Feb 2022 01:10:12 +0000 (17:10 -0800)]
userspec: warn about '.' separator

Problem reported by Dan Jacobson (Bug#44770).
* lib/userspec.c: Don’t include stdbool.h since it’s now in our API.
(parse_user_spec_warn): New function, broken out of parse_user_spec
and with a new PWARN arg.
(parse_user_spec): Use it.
* lib/userspec.h: Include stdbool.h and declare new function.
* tests/test-userspec.c (struct test.in): Now a char array
so that it can be modified.
(T): Make the placeholder a valid test, as that simplifies
the code.  Omit NULL placeholder at the end, likewise.
(main): Set up T in the new way, and test that the "."  separator
acts like the ":" separator except with a warning if it works.

3 years agouserspec: no need for static vars
Paul Eggert [Thu, 24 Feb 2022 16:45:55 +0000 (08:45 -0800)]
userspec: no need for static vars

* lib/userspec.c (parse_with_separator): Simplify.

3 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.

3 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%.

3 years agoclose-stream: don't depend on fclose
Paul Eggert [Tue, 22 Feb 2022 05:59:12 +0000 (21:59 -0800)]
close-stream: don't depend on fclose

This reverts 2022-01-26T17:33:03Z!eggert@cs.ucla.edu.
Depending on fclose broke Emacs, and since this dependency didn't
help GNU m4 let's remove it for now.  Problem reported by
Lars Ingebrigtsen <https://bugs.gnu.org/32452#47>.
* modules/close-stream (Depends-on): Remove fclose.

3 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.

3 years agomktime: improve heuristic for ca-1986 Indiana DST
Paul Eggert [Sat, 19 Feb 2022 23:04:43 +0000 (15:04 -0800)]
mktime: improve heuristic for ca-1986 Indiana DST

Problem reported by Mark Krenz <https://bugs.gnu.org/48085>.
* lib/mktime.c (__mktime_internal): Be more generous about
accepting arguments with the wrong value of tm_isdst, by falling
back to a one-hour DST difference if we find no nearby DST that is
unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
rejected when TZ="America/Indianapolis" because the nearest DST
timestamp occurred in 1970, a temporal distance too great for the
old heuristic.  This also also narrows the search a bit, which
is a minor performance win.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS):
Check for putenv failures and for Bug#48085.
* tests/test-parse-datetime.c (main):
Test for setenv failures and for Bug#48085.

3 years agofilevercmp: fix several unexpected results
Paul Eggert [Sun, 13 Feb 2022 00:27:05 +0000 (16:27 -0800)]
filevercmp: fix several unexpected results

Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.
While looking into this, I spotted some more areas where the
code and documentation did not agree, or where the documentation
was unclear.  The biggest change needed by coreutils is a new
function filenvercmp that can compare byte strings containing NUL.
* lib/filevercmp.c: Do not include sys/types.h, stdlib.h, string.h.
Include idx.h, verify.h.
(match_suffix): Remove, replacing all uses with calls to ...
(file_prefixlen): ... this new function.  Simplify it by
avoiding the need for a confusing READ_ALPHA state variable.
Change its API to something more useful, with a *LEN arg.
it with a new *LEN arg.
(file_prefixlen, verrevcmp):
Prefer idx_t to size_t where either will do.
(order): Change args to S, POS, LEN instead of just S[POS].
This lets us handle NUL bytes correctly.  Callers changed.
Verify that ints are sufficiently wide for its API.
(verrevcmp): Don't assume that S1[S1_LEN] is a non-digit,
and likewise for S2[S2_LEN].  The byte might not be accessible
if filenvercmp is being called.
(filevercmp): Reimplement by calling filenvercmp.
(filenvercmp): New function, rewritten without the assumption
that the inputs are null-terminated.
Remove "easy comparison to see if strings are identical", as the
use of it later (a) was undocumented, and (b) caused sort -V to be
unstable.  When both strings start with ".", do not skip past
the "."s before looking for suffixes, as this disagreed
with the documentation.
* lib/filevercmp.h: Fix comments, which had many mistakes.
(filenvercmp): New decl.
* modules/filevercmp (Depends-on): Add idx, verify.  Remove string.
* tests/test-filevercmp.c: Include string.h.
(examples): Reorder examples ".0" and ".9" that matched the code
but not the documentation.  The code has been fixed to match the
documentation.  Add some examples involving \1 so that they
can be tried with both \1 and \0.  Add some other examples
taken from the bug report.
(equals): New set of test cases.
(sign, test_filevercmp): New functions.
(main): Remove test case where the fixed filevercmp disagrees with
strverscmp.  Use test_filevercmp instead of filevercmp, so that
we also test filenvercmp.  Test the newly-introduced EQUALS cases.

3 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.

3 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.

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

3 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".

3 years agotermcap, termcap-h: Deprecate.
Bruno Haible [Sun, 6 Feb 2022 11:55:51 +0000 (12:55 +0100)]
termcap, termcap-h: Deprecate.

* modules/termcap (Status, Notice): Add deprecation.
* modules/termcap-h (Status, Notice): Likewise.

3 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.

3 years agouserspec: help fix GNU ‘id’ incompatibility
Paul Eggert [Fri, 4 Feb 2022 22:27:41 +0000 (14:27 -0800)]
userspec: help fix GNU ‘id’ incompatibility

* lib/userspec.c (parse_with_separator):
Don’t set *username to a numeric string that is not a user name,
and similarly for *groupname.  Needed to fix Bug#53631.

3 years agoargmatch: add variants that only match full argument
Pádraig Brady [Sun, 30 Jan 2022 16:50:27 +0000 (16:50 +0000)]
argmatch: add variants that only match full argument

* lib/argmatch.h (argmatch_exact, [X]ARGMATCH_EXACT): New interfaces
that don't allow abbreviations.
* lib/argmatch.c (argmatch_exact): Likewise.
(__xargmatch_internal): Add a bool parameter to disable abbreviations.
* tests/test-argmatch.c: Add tests.

3 years agotests: Fix interpretation of setupterm's return code.
Bruno Haible [Sun, 30 Jan 2022 17:50:28 +0000 (18:50 +0100)]
tests: Fix interpretation of setupterm's return code.

* tests/test-terminfo.c (main): Test the value of err when setupterm
fails, not when it succeeds.
* tests/test-termcap.c (main): Likewise.

3 years agoterminfo: Add tests.
Bruno Haible [Sun, 30 Jan 2022 16:01:07 +0000 (17:01 +0100)]
terminfo: Add tests.

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

3 years agoterminfo, terminfo-h: New modules.
Bruno Haible [Sun, 30 Jan 2022 15:44:27 +0000 (16:44 +0100)]
terminfo, terminfo-h: New modules.

* lib/terminfo.h: New file, from GNU gettext.
* m4/terminfo.m4: New file, from GNU gettext.
* modules/terminfo: New file, from GNU gettext.
* modules/terminfo-h: New file, from GNU gettext.

3 years agotermcap: Add tests.
Bruno Haible [Sun, 30 Jan 2022 15:34:07 +0000 (16:34 +0100)]
termcap: Add tests.

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

3 years agotermcap, termcap-h: New modules.
Bruno Haible [Sun, 30 Jan 2022 14:06:22 +0000 (15:06 +0100)]
termcap, termcap-h: New modules.

* lib/termcap.h: New file, from GNU gettext.
* lib/tparm.c: New file, from GNU gettext.
* lib/tputs.c: New file, from GNU gettext.
* m4/termcap.m4: New file, from GNU gettext.
* m4/curses.m4: New file, from GNU gettext.
* modules/termcap: New file, from GNU gettext.
* modules/termcap-h: New file, from GNU gettext.

3 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.

3 years agogendocs: update copyright footer year
Mike Frysinger [Sun, 30 Jan 2022 09:58:32 +0000 (04:58 -0500)]
gendocs: update copyright footer year

* doc/gendocs_template: Change 2020 to 2022.

3 years agodoc: Clarify MSVC support.
Bruno Haible [Sat, 29 Jan 2022 23:48:44 +0000 (00:48 +0100)]
doc: Clarify MSVC support.

* doc/gnulib-intro.texi (Supported Platforms): Document that "debug"
builds are unsupported.

3 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.

3 years agoalignalloc: work around AddressSanitizer bug
Paul Eggert [Thu, 27 Jan 2022 19:36:00 +0000 (11:36 -0800)]
alignalloc: work around AddressSanitizer bug

* doc/posix-functions/aligned_alloc.texi (aligned_alloc):
Mention AddressSanitizer bug.
* lib/alignalloc.h (ALIGNALLOC_VIA_ALIGNED_ALLOC):
Define to 0 if AddressSanitizer is in use.
* tests/test-alignalloc.c (test_alignalloc): New function,
which tests for non-aligned sizes too.
(main): Use it.  Don’t bother checking for alignments
greater than 16 MiB, as this flummoxes AddressSanitizer
and there seems little point to testing them.

3 years agodoc: use UTF-8 encoding
Paul Eggert [Thu, 27 Jan 2022 19:05:39 +0000 (11:05 -0800)]
doc: use UTF-8 encoding

* doc/gnulib.texi: Use ‘@documentencoding UTF-8’.
Partly this is because there are a few UTF-8 characters
in the .texi files and there seems little point nowadays
to @U-ifiying them.  And partly it is so that the .info
output uses nicer UTF-8 characters, e.g., it single-quotes
‘like this’ instead of 'like this'.

3 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.

3 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.

3 years agoclose-stream: avoid crash on MSVC Debug mode
Paul Eggert [Wed, 26 Jan 2022 17:33:03 +0000 (09:33 -0800)]
close-stream: avoid crash on MSVC Debug mode

Problem reported by Julien Marrec in:
https://lists.gnu.org/r/bug-m4/2022-01/msg00000.html
* modules/close-stream (Depends-on): Depend on fclose.

3 years agobootstrap: update scriptversion
Paul Eggert [Wed, 26 Jan 2022 05:29:16 +0000 (21:29 -0800)]
bootstrap: update scriptversion

* build-aux/bootstrap: Update scriptversion.
Problem reported by Bjarni Ingi Gislason in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00164.html

3 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.

3 years agoalignalloc, xalignalloc: new modules
Paul Eggert [Mon, 24 Jan 2022 00:30:17 +0000 (16:30 -0800)]
alignalloc, xalignalloc: new modules

* lib/alignalloc.c, lib/alignalloc.h, lib/xalignalloc.c:
* m4/alignalloc.m4, modules/alignalloc, modules/alignalloc-tests:
* modules/xalignalloc, tests/test-alignalloc.c:
New files.

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

3 years agoextern-inline: improve macOS port
Paul Eggert [Mon, 17 Jan 2022 22:03:01 +0000 (14:03 -0800)]
extern-inline: improve macOS port

* m4/extern-inline.m4 (gl_EXTERN_INLINE):
Define HAVE___HEADER_INLINE at configure-time, so that config.h
knows the workaround is not needed even though ctype.h has not yet
been included.  This lets the compiler use extern inline functions
on newer macOS platforms, instead of static inline.
Problem reported by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00130.html

3 years agoxstrtol: Trim dependencies.
Bruno Haible [Mon, 17 Jan 2022 10:07:25 +0000 (11:07 +0100)]
xstrtol: Trim dependencies.

* lib/xstrtol.h: Include <stdint.h>, not <inttypes.h>.
* modules/xstrtol (Depends-on): Add stdint. Remove inttypes-incomplete.

3 years agoxstrtol: Fix compilation error (regression 2022-01-16).
Bruno Haible [Mon, 17 Jan 2022 09:53:45 +0000 (10:53 +0100)]
xstrtol: Fix compilation error (regression 2022-01-16).

* modules/xstrtol (Depends-on): Add intprops.

3 years agoxstrtol: remove unnecessary else after return
Jim Meyering [Mon, 17 Jan 2022 09:13:19 +0000 (10:13 +0100)]
xstrtol: remove unnecessary else after return

* lib/xstrtol.c (bkm_scale): Drop "else" after return.

3 years agoxstrtol: simplify integer overflow checking
Paul Eggert [Mon, 17 Jan 2022 06:45:47 +0000 (22:45 -0800)]
xstrtol: simplify integer overflow checking

* lib/xstrtol.c: Include intprops.h.
(TYPE_SIGNED): Remove, as intprops.h defines that for us now.
(bkm_scale): Use INT_MULTIPLY_WRAPV instead of checking for
overflow by hand.

3 years agoxstrtoll-tests: use %lld for long long
Paul Eggert [Mon, 17 Jan 2022 06:31:02 +0000 (22:31 -0800)]
xstrtoll-tests: use %lld for long long

* tests/test-xstrtoll.c, tests/test-xstrtoull.c (__spec):
Do not assume long long is 64 bits, or that exact-width
64-bit types exist.  Although these assumptions are true
on current Gnulib platforms they are not true in general.
Also, GCC warns if PRId64 is "ld" but intmax_t is long long
even when long and long long are both 64 bits.

3 years agoDon't pass unknown warning option to clang.
Bruno Haible [Sat, 15 Jan 2022 23:13:38 +0000 (00:13 +0100)]
Don't pass unknown warning option to clang.

Reported by Assaf Gordon via Paul Eggert in
<https://lists.gnu.org/archive/html/coreutils/2022-01/msg00018.html>.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Don't use
-Wno-unsuffixed-float-constants with clang.

3 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.

3 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__.

3 years agooset-c++: Avoid compilation error with nvc++ 22.1.
Bruno Haible [Sat, 15 Jan 2022 18:52:28 +0000 (19:52 +0100)]
oset-c++: Avoid compilation error with nvc++ 22.1.

* lib/gl_oset.hh: With EDG C++ compilers, avoid 'friend'.

3 years agonstrftime: pacify nvc 22.1 unreachable statement
Paul Eggert [Sat, 15 Jan 2022 03:42:57 +0000 (19:42 -0800)]
nstrftime: pacify nvc 22.1 unreachable statement

* lib/nstrftime.c (__strftime_internal):
Omit unreachable ‘break;’.

3 years agotests: pacify nvc 22.1 unreachable statement
Paul Eggert [Sat, 15 Jan 2022 03:33:21 +0000 (19:33 -0800)]
tests: pacify nvc 22.1 unreachable statement

* tests/test-sys_wait.h (test_sys_wait_macros):
Widen scope of ‘#if 0’ so that there is not an unreachable ‘break;’.

3 years agotests: pacify nvc 22.1 set-but-not-used
Paul Eggert [Sat, 15 Jan 2022 03:26:50 +0000 (19:26 -0800)]
tests: pacify nvc 22.1 set-but-not-used

* tests/test-fnmatch.c (main): Don’t set a var without using it.
* tests/test-sched.c (f1): Now extern.

3 years agointprops: work around nvc 22.1 bug
Paul Eggert [Sat, 15 Jan 2022 02:50:48 +0000 (18:50 -0800)]
intprops: work around nvc 22.1 bug

Problem reported by Olivier Cessenat (Bug#53256).
* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW) [__EDG__]:
Define to 0, since __builtin_add_overflow doesn’t work
on NVIDIA HPC SDK 22.1.

3 years agocopy-file-range: work around Linux kernel bug
Paul Eggert [Sat, 15 Jan 2022 01:27:51 +0000 (17:27 -0800)]
copy-file-range: work around Linux kernel bug

This workaround is adapted from Coreutils.
* lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]:
Include <sys/utsname.h>.
(copy_file_range): Use a stub to replace the copy_file_range of
Linux kernel versions 4.5 through 5.2.
* lib/unistd.in.h (copy_file_range):
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS):
* modules/copy-file-range (configure.ac):
* modules/unistd (unistd.h):
Support replacement of copy_file_range.
* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Define HAVE_COPY_FILE_RANGE if the system has copy_file_range,
and on Linux check whether the system’s is known to work.

3 years agoAvoid error "conditional LIBUNISTRING_COMPILE_... was never defined" when option...
Bruno Haible [Fri, 14 Jan 2022 22:20:44 +0000 (23:20 +0100)]
Avoid error "conditional LIBUNISTRING_COMPILE_... was never defined" when option --conditional-dependencies is used (regression 2022-01-09).

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00099.html>.

* m4/libunistring-base.m4 (gl_LIBUNISTRING_MODULE): Use gl_CONDITIONAL
instead of AM_CONDITIONAL.

3 years agoautoupdate
Karl Berry [Thu, 13 Jan 2022 17:12:18 +0000 (09:12 -0800)]
autoupdate

3 years agoAvoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).
Bruno Haible [Thu, 13 Jan 2022 15:23:21 +0000 (16:23 +0100)]
Avoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).

Reported by Werner Lemberg <wl@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00094.html>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Avoid redefining
_GL_ATTRIBUTE_DEALLOC_FREE.

3 years agobackupfile: fix bug when renaming not from wd
Paul Eggert [Mon, 10 Jan 2022 18:34:09 +0000 (10:34 -0800)]
backupfile: fix bug when renaming not from wd

* lib/backupfile.c (backupfile_internal): Fix bug when DIR_FD
does not specify the working directory, and when RENAME.
Without the bug fix, FILE is treated as relative to the working
directory, not relative to DIR_FD, when renaming FILE.
This bug was introduced when DIR_FD and RENAME were introduced,
in 2018-10-24T02:10:21Z!eggert@cs.ucla.edu.
While we’re at it, when SDIR is nonnegative improve performance a
bit by passing an SDIR-relative old name to renameatu.

3 years agoautoupdate
Karl Berry [Mon, 10 Jan 2022 14:43:19 +0000 (06:43 -0800)]
autoupdate

3 years agohost-cpu-c-abi: Add support for LoongArch64 CPU.
Bruno Haible [Sun, 9 Jan 2022 23:24:33 +0000 (00:24 +0100)]
host-cpu-c-abi: Add support for LoongArch64 CPU.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Define __loongarch64__. (GCC
and clang predefine only __loongarch__, __loongarch64.)

3 years agostdio: Fix "missing file" errors (regression from today).
Bruno Haible [Sun, 9 Jan 2022 23:12:38 +0000 (00:12 +0100)]
stdio: Fix "missing file" errors (regression from today).

* modules/stdio (Files): Add stdio-read.c, stdio-write.c.
* m4/stdio_h.m4 (gl_STDIO_H): Update comments.

3 years agoUse the GL_CFLAG_GNULIB_WARNINGS for most AC_LIBOBJ compilation units.
Bruno Haible [Sun, 9 Jan 2022 14:47:21 +0000 (15:47 +0100)]
Use the GL_CFLAG_GNULIB_WARNINGS for most AC_LIBOBJ compilation units.

* modules/_Exit (configure.ac): Define an Automake conditional. Remove
the AC_LIBOBJ invocation.
(Makefile.am): Augment lib_SOURCES, guarded by that Automake
conditional.
* modules/accept: Likewise.
* modules/access: Likewise.
* modules/acosf: Likewise.
* modules/acosl: Likewise.
* modules/aligned_alloc: Likewise.
* modules/alphasort: Likewise.
* modules/argz: Likewise.
* modules/asinf: Likewise.
* modules/asinl: Likewise.
* modules/atan2f: Likewise.
* modules/atanf: Likewise.
* modules/atanl: Likewise.
* modules/atexit: Likewise.
* modules/atoll: Likewise.
* modules/bind: Likewise.
* modules/btowc: Likewise.
* modules/c32rtomb: Likewise.
* modules/canonicalize-lgpl: Likewise.
* modules/cbrt: Likewise.
* modules/cbrtf: Likewise.
* modules/cbrtl: Likewise.
* modules/ceil: Likewise.
* modules/ceilf: Likewise.
* modules/ceill: Likewise.
* modules/chdir-long: Likewise.
* modules/chown: Likewise.
* modules/close: Likewise.
* modules/closedir: Likewise.
* modules/cnd: Likewise.
* modules/connect: Likewise.
* modules/copy-file-range: Likewise.
* modules/copysign: Likewise.
* modules/copysignf: Likewise.
* modules/copysignl: Likewise.
* modules/cosf: Likewise.
* modules/coshf: Likewise.
* modules/cosl: Likewise.
* modules/creat: Likewise.
* modules/crypto/gc: Likewise.
* modules/ctime: Likewise.
* modules/dirfd: Likewise.
* modules/dup: Likewise.
* modules/dup2: Likewise.
* modules/duplocale: Likewise.
* modules/error: Likewise.
* modules/euidaccess: Likewise.
* modules/execinfo: Likewise.
* modules/execl: Likewise.
* modules/execle: Likewise.
* modules/execlp: Likewise.
* modules/execv: Likewise.
* modules/execve: Likewise.
* modules/execvp: Likewise.
* modules/execvpe: Likewise.
* modules/exp2: Likewise.
* modules/exp2f: Likewise.
* modules/exp2l: Likewise.
* modules/expf: Likewise.
* modules/expl: Likewise.
* modules/explicit_bzero: Likewise.
* modules/expm1: Likewise.
* modules/expm1f: Likewise.
* modules/expm1l: Likewise.
* modules/fabsf: Likewise.
* modules/fabsl: Likewise.
* modules/faccessat: Likewise.
* modules/fchdir: Likewise.
* modules/fchmodat: Likewise.
* modules/fchownat: Likewise.
* modules/fclose: Likewise.
* modules/fcntl: Likewise.
* modules/fdatasync: Likewise.
* modules/fdopen: Likewise.
* modules/fdopendir: Likewise.
* modules/fflush: Likewise.
* modules/ffs: Likewise.
* modules/ffsl: Likewise.
* modules/ffsll: Likewise.
* modules/fileblocks: Likewise.
* modules/float: Likewise.
* modules/flock: Likewise.
* modules/floor: Likewise.
* modules/floorf: Likewise.
* modules/floorl: Likewise.
* modules/fma: Likewise.
* modules/fmaf: Likewise.
* modules/fmal: Likewise.
* modules/fmod: Likewise.
* modules/fmodf: Likewise.
* modules/fmodl: Likewise.
* modules/forkpty: Likewise.
* modules/fpending: Likewise.
* modules/fpurge: Likewise.
* modules/freadable: Likewise.
* modules/freadahead: Likewise.
* modules/freadptr: Likewise.
* modules/free-posix: Likewise.
* modules/freopen: Likewise.
* modules/frexpf: Likewise.
* modules/fseek: Likewise.
* modules/fseeko: Likewise.
* modules/fseterr: Likewise.
* modules/fstat: Likewise.
* modules/fstatat: Likewise.
* modules/fsusage: Likewise.
* modules/fsync: Likewise.
* modules/ftell: Likewise.
* modules/ftello: Likewise.
* modules/ftruncate: Likewise.
* modules/fts: Likewise.
* modules/futimens: Likewise.
* modules/fwritable: Likewise.
* modules/fwriting: Likewise.
* modules/getaddrinfo: Likewise.
* modules/getcwd: Likewise.
* modules/getcwd-lgpl: Likewise.
* modules/getdelim: Likewise.
* modules/getdomainname: Likewise.
* modules/getdtablesize: Likewise.
* modules/getentropy: Likewise.
* modules/getgroups: Likewise.
* modules/gethostname: Likewise.
* modules/getline: Likewise.
* modules/getloadavg: Likewise.
* modules/getlogin: Likewise.
* modules/getlogin_r: Likewise.
* modules/getopt-posix: Likewise.
* modules/getpagesize: Likewise.
* modules/getpeername: Likewise.
* modules/getrandom: Likewise.
* modules/getrusage: Likewise.
* modules/getsockname: Likewise.
* modules/getsockopt: Likewise.
* modules/getsubopt: Likewise.
* modules/gettimeofday: Likewise.
* modules/getumask: Likewise.
* modules/getusershell: Likewise.
* modules/glob: Likewise.
* modules/grantpt: Likewise.
* modules/group-member: Likewise.
* modules/hypot: Likewise.
* modules/hypotf: Likewise.
* modules/hypotl: Likewise.
* modules/iconv_open: Likewise.
* modules/ilogb: Likewise.
* modules/ilogbf: Likewise.
* modules/ilogbl: Likewise.
* modules/imaxabs: Likewise.
* modules/imaxdiv: Likewise.
* modules/inet_ntop: Likewise.
* modules/inet_pton: Likewise.
* modules/ioctl: Likewise.
* modules/isapipe: Likewise.
* modules/isatty: Likewise.
* modules/isblank: Likewise.
* modules/isfinite: Likewise.
* modules/isinf: Likewise.
* modules/iswblank: Likewise.
* modules/iswctype: Likewise.
* modules/iswdigit: Likewise.
* modules/iswxdigit: Likewise.
* modules/lchmod: Likewise.
* modules/lchown: Likewise.
* modules/ldexpf: Likewise.
* modules/ldexpl: Likewise.
* modules/libgmp: Likewise.
* modules/link: Likewise.
* modules/linkat: Likewise.
* modules/listen: Likewise.
* modules/localeconv: Likewise.
* modules/localtime: Likewise.
* modules/log: Likewise.
* modules/log10: Likewise.
* modules/log10f: Likewise.
* modules/log10l: Likewise.
* modules/log1p: Likewise.
* modules/log1pf: Likewise.
* modules/log1pl: Likewise.
* modules/log2: Likewise.
* modules/log2f: Likewise.
* modules/log2l: Likewise.
* modules/logb: Likewise.
* modules/logbf: Likewise.
* modules/logbl: Likewise.
* modules/logf: Likewise.
* modules/login_tty: Likewise.
* modules/logl: Likewise.
* modules/lseek: Likewise.
* modules/lstat: Likewise.
* modules/mbrlen: Likewise.
* modules/mbrtoc32: Likewise.
* modules/mbrtowc: Likewise.
* modules/mbsinit: Likewise.
* modules/mbsnrtowcs: Likewise.
* modules/mbsrtowcs: Likewise.
* modules/mbtowc: Likewise.
* modules/memalign: Likewise.
* modules/memchr: Likewise.
* modules/memcmp: Likewise.
* modules/memcpy: Likewise.
* modules/memmove: Likewise.
* modules/mempcpy: Likewise.
* modules/memrchr: Likewise.
* modules/memset: Likewise.
* modules/mkdir: Likewise.
* modules/mkdirat: Likewise.
* modules/mkdtemp: Likewise.
* modules/mkfifo: Likewise.
* modules/mkfifoat: Likewise.
* modules/mknod: Likewise.
* modules/mkostemp: Likewise.
* modules/mkostemps: Likewise.
* modules/mkstemp: Likewise.
* modules/mkstemps: Likewise.
* modules/modf: Likewise.
* modules/modff: Likewise.
* modules/modfl: Likewise.
* modules/mountlist: Likewise.
* modules/msvc-inval: Likewise.
* modules/msvc-nothrow: Likewise.
* modules/mtx: Likewise.
* modules/nanosleep: Likewise.
* modules/nl_langinfo: Likewise.
* modules/obstack: Likewise.
* modules/open: Likewise.
* modules/openat: Likewise.
* modules/opendir: Likewise.
* modules/openpty: Likewise.
* modules/pclose: Likewise.
* modules/perror: Likewise.
* modules/pipe-posix: Likewise.
* modules/poll: Likewise.
* modules/popen: Likewise.
* modules/posix_memalign: Likewise.
* modules/posix_openpt: Likewise.
* modules/posix_spawn: Likewise.
* modules/posix_spawn-internal: Likewise.
* modules/posix_spawn_file_actions_addchdir: Likewise.
* modules/posix_spawn_file_actions_addclose: Likewise.
* modules/posix_spawn_file_actions_adddup2: Likewise.
* modules/posix_spawn_file_actions_addfchdir: Likewise.
* modules/posix_spawn_file_actions_addopen: Likewise.
* modules/posix_spawn_file_actions_destroy: Likewise.
* modules/posix_spawn_file_actions_init: Likewise.
* modules/posix_spawnattr_destroy: Likewise.
* modules/posix_spawnattr_getflags: Likewise.
* modules/posix_spawnattr_getpgroup: Likewise.
* modules/posix_spawnattr_getschedparam: Likewise.
* modules/posix_spawnattr_getschedpolicy: Likewise.
* modules/posix_spawnattr_getsigdefault: Likewise.
* modules/posix_spawnattr_getsigmask: Likewise.
* modules/posix_spawnattr_init: Likewise.
* modules/posix_spawnattr_setflags: Likewise.
* modules/posix_spawnattr_setpgroup: Likewise.
* modules/posix_spawnattr_setschedparam: Likewise.
* modules/posix_spawnattr_setschedpolicy: Likewise.
* modules/posix_spawnattr_setsigdefault: Likewise.
* modules/posix_spawnattr_setsigmask: Likewise.
* modules/posix_spawnp: Likewise.
* modules/powf: Likewise.
* modules/pread: Likewise.
* modules/pselect: Likewise.
* modules/pthread-cond: Likewise.
* modules/pthread-mutex: Likewise.
* modules/pthread-once: Likewise.
* modules/pthread-rwlock: Likewise.
* modules/pthread-spin: Likewise.
* modules/pthread-thread: Likewise.
* modules/pthread-tss: Likewise.
* modules/pthread_mutex_timedlock: Likewise.
* modules/pthread_sigmask: Likewise.
* modules/ptsname: Likewise.
* modules/ptsname_r: Likewise.
* modules/putenv: Likewise.
* modules/pwrite: Likewise.
* modules/qsort_r: Likewise.
* modules/raise: Likewise.
* modules/random: Likewise.
* modules/random_r: Likewise.
* modules/rawmemchr: Likewise.
* modules/read: Likewise.
* modules/readdir: Likewise.
* modules/readline: Likewise.
* modules/readlink: Likewise.
* modules/readlinkat: Likewise.
* modules/readutmp: Likewise.
* modules/reallocarray: Likewise.
* modules/recv: Likewise.
* modules/recvfrom: Likewise.
* modules/regex: Likewise.
* modules/relocatable-prog: Likewise.
* modules/remainder: Likewise.
* modules/remainderf: Likewise.
* modules/remainderl: Likewise.
* modules/remove: Likewise.
* modules/rename: Likewise.
* modules/renameat: Likewise.
* modules/rewinddir: Likewise.
* modules/rint: Likewise.
* modules/rintf: Likewise.
* modules/rintl: Likewise.
* modules/rmdir: Likewise.
* modules/round: Likewise.
* modules/roundf: Likewise.
* modules/roundl: Likewise.
* modules/rpmatch: Likewise.
* modules/scandir: Likewise.
* modules/sched_yield: Likewise.
* modules/secure_getenv: Likewise.
* modules/select: Likewise.
* modules/selinux-h: Likewise.
* modules/send: Likewise.
* modules/sendto: Likewise.
* modules/setenv: Likewise.
* modules/sethostname: Likewise.
* modules/setlocale: Likewise.
* modules/setlocale-null: Likewise.
* modules/setsockopt: Likewise.
* modules/shutdown: Likewise.
* modules/sig2str: Likewise.
* modules/sigabbrev_np: Likewise.
* modules/sigaction: Likewise.
* modules/sigdescr_np: Likewise.
* modules/signbit: Likewise.
* modules/sigprocmask: Likewise.
* modules/sinf: Likewise.
* modules/sinhf: Likewise.
* modules/sinl: Likewise.
* modules/sleep: Likewise.
* modules/socket: Likewise.
* modules/spawn-pipe: Likewise.
* modules/sqrtf: Likewise.
* modules/sqrtl: Likewise.
* modules/stat: Likewise.
* modules/stdio: Likewise.
* modules/stpcpy: Likewise.
* modules/stpncpy: Likewise.
* modules/strcase: Likewise.
* modules/strchrnul: Likewise.
* modules/strcspn: Likewise.
* modules/strdup-posix: Likewise.
* modules/strerror: Likewise.
* modules/strerror-override: Likewise.
* modules/strerrorname_np: Likewise.
* modules/strfmon_l: Likewise.
* modules/strftime-fixes: Likewise.
* modules/strncat: Likewise.
* modules/strndup: Likewise.
* modules/strnlen: Likewise.
* modules/strpbrk: Likewise.
* modules/strptime: Likewise.
* modules/strsep: Likewise.
* modules/strsignal: Likewise.
* modules/strtod: Likewise.
* modules/strtoimax: Likewise.
* modules/strtok_r: Likewise.
* modules/strtol: Likewise.
* modules/strtold: Likewise.
* modules/strtoll: Likewise.
* modules/strtoul: Likewise.
* modules/strtoull: Likewise.
* modules/strtoumax: Likewise.
* modules/strverscmp: Likewise.
* modules/symlink: Likewise.
* modules/symlinkat: Likewise.
* modules/tanf: Likewise.
* modules/tanhf: Likewise.
* modules/tanl: Likewise.
* modules/tcgetsid: Likewise.
* modules/thrd: Likewise.
* modules/time_r: Likewise.
* modules/time_rz: Likewise.
* modules/timegm: Likewise.
* modules/times: Likewise.
* modules/timespec_get: Likewise.
* modules/timespec_getres: Likewise.
* modules/tmpfile: Likewise.
* modules/towctrans: Likewise.
* modules/trunc: Likewise.
* modules/truncate: Likewise.
* modules/truncf: Likewise.
* modules/truncl: Likewise.
* modules/tsearch: Likewise.
* modules/tss: Likewise.
* modules/ttyname_r: Likewise.
* modules/tzset: Likewise.
* modules/uname: Likewise.
* modules/unlink: Likewise.
* modules/unlinkat: Likewise.
* modules/unlockpt: Likewise.
* modules/unsetenv: Likewise.
* modules/usleep: Likewise.
* modules/utime: Likewise.
* modules/utimensat: Likewise.
* modules/waitpid: Likewise.
* modules/wcpcpy: Likewise.
* modules/wcpncpy: Likewise.
* modules/wcrtomb: Likewise.
* modules/wcscasecmp: Likewise.
* modules/wcscat: Likewise.
* modules/wcschr: Likewise.
* modules/wcscmp: Likewise.
* modules/wcscoll: Likewise.
* modules/wcscpy: Likewise.
* modules/wcscspn: Likewise.
* modules/wcsdup: Likewise.
* modules/wcsftime: Likewise.
* modules/wcslen: Likewise.
* modules/wcsncasecmp: Likewise.
* modules/wcsncat: Likewise.
* modules/wcsncmp: Likewise.
* modules/wcsncpy: Likewise.
* modules/wcsnlen: Likewise.
* modules/wcsnrtombs: Likewise.
* modules/wcspbrk: Likewise.
* modules/wcsrchr: Likewise.
* modules/wcsrtombs: Likewise.
* modules/wcsspn: Likewise.
* modules/wcsstr: Likewise.
* modules/wcstok: Likewise.
* modules/wcswidth: Likewise.
* modules/wcsxfrm: Likewise.
* modules/wctob: Likewise.
* modules/wctomb: Likewise.
* modules/wctrans: Likewise.
* modules/wctype: Likewise.
* modules/wcwidth: Likewise.
* modules/windows-cond: Likewise.
* modules/windows-mutex: Likewise.
* modules/windows-once: Likewise.
* modules/windows-recmutex: Likewise.
* modules/windows-rwlock: Likewise.
* modules/windows-spawn: Likewise.
* modules/windows-spin: Likewise.
* modules/windows-thread: Likewise.
* modules/windows-timedmutex: Likewise.
* modules/windows-timedrecmutex: Likewise.
* modules/windows-timedrwlock: Likewise.
* modules/windows-tls: Likewise.
* modules/wmemchr: Likewise.
* modules/wmemcmp: Likewise.
* modules/wmemcpy: Likewise.
* modules/wmemmove: Likewise.
* modules/wmempcpy: Likewise.
* modules/wmemset: Likewise.
* modules/write: Likewise.

3 years agoobstack: Move AC_LIBOBJ invocation to the module description.
Bruno Haible [Sun, 9 Jan 2022 14:40:22 +0000 (15:40 +0100)]
obstack: Move AC_LIBOBJ invocation to the module description.

* m4/obstack.m4 (gl_FUNC_OBSTACK): Renamed from AC_FUNC_OBSTACK. Don't
invoke AC_LIBSOURCES nor AC_LIBOBJ.
* modules/obstack (configure.ac): Update. Invoke AC_LIBOBJ here.

3 years agostdio: Move AC_LIBOBJ invocations to the module description.
Bruno Haible [Sun, 9 Jan 2022 14:40:18 +0000 (15:40 +0100)]
stdio: Move AC_LIBOBJ invocations to the module description.

* m4/stdio_h.m4 (gl_STDIO_H): Don't invoke AC_LIBOBJ.
* modules/stdio (configure.ac): Invoke AC_LIBOBJ here.

3 years agofchdir: Move AC_LIBOBJ invocation to the module description.
Bruno Haible [Sun, 9 Jan 2022 14:40:14 +0000 (15:40 +0100)]
fchdir: Move AC_LIBOBJ invocation to the module description.

* m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't invoke AC_LIBOBJ and
gl_PREREQ_FCHDIR.
* modules/fchdir (configure.ac): Invoke AC_LIBOBJ and gl_PREREQ_FCHDIR.

3 years agoRemove influence of Automake conditionals on conditional dependencies.
Bruno Haible [Sun, 9 Jan 2022 14:38:51 +0000 (15:38 +0100)]
Remove influence of Automake conditionals on conditional dependencies.

* m4/gnulib-common.m4 (gl_CONDITIONAL): New macro.
(gl_CONDITIONAL_HEADER): Use it instead of AM_CONDITIONAL.
* m4/libgmp.m4 (gl_LIBGMP): Likewise.
* modules/posix_spawn_file_actions_addfchdir-tests (configure.ac):
Likewise.
* modules/uchar-c++-tests (configure.ac): Likewise.
* gnulib-tool (func_modules_transitive_closure): Don't inhibit
conditional dependencies processing on a module that uses an Automake
conditional.

3 years agognulib-tool: Fix "Don't forget" messages (regression 2021-12-12).
Bruno Haible [Sat, 8 Jan 2022 22:28:29 +0000 (23:28 +0100)]
gnulib-tool: Fix "Don't forget" messages (regression 2021-12-12).

* gnulib-tool (func_import): Fix variable references in "Don't forget"
messages.

3 years agognulib-tool: Remove all *.Po files upon distclean (regr. 2022-01-05).
Bruno Haible [Sat, 8 Jan 2022 21:10:54 +0000 (22:10 +0100)]
gnulib-tool: Remove all *.Po files upon distclean (regr. 2022-01-05).

Reported by Mohammad Akhlaghi <mohammad@akhlaghi.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00061.html>.

* gnulib-tool (func_emit_initmacro_end): Collect the *.Po or *.Plo files
to remove into an AC_SUBSTed variable gl_LIBOBJDEPS.
(func_emit_lib_Makefile_am): Extend the distclean and maintainer-clean
rules.

3 years agoAdd another example.
Bruno Haible [Sat, 8 Jan 2022 19:58:14 +0000 (20:58 +0100)]
Add another example.

* examples/hello-c-gnulib-conddeps: New directory.

3 years agoc-stack: Adapt header file for use in C++ applications.
Marc Nieper-Wißkirchen [Sat, 8 Jan 2022 10:56:02 +0000 (11:56 +0100)]
c-stack: Adapt header file for use in C++ applications.

* lib/c-stack.h: Add extern "C" block.

3 years agoversion-etc: Adapt header file for use in C++ applications.
Marc Nieper-Wißkirchen [Sat, 8 Jan 2022 10:41:21 +0000 (11:41 +0100)]
version-etc: Adapt header file for use in C++ applications.

* lib/version-etc.h: Add extern "C" block.

3 years agosigsegv: Improve support for Linux/LoongArch64.
Bruno Haible [Fri, 7 Jan 2022 18:11:25 +0000 (19:11 +0100)]
sigsegv: Improve support for Linux/LoongArch64.

* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for
Linux/LoongArch.