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

3 years agobootstrap: When a commit is specified, do a shallow fetch if possible.
Glenn Washburn [Wed, 5 Jan 2022 22:57:25 +0000 (23:57 +0100)]
bootstrap: When a commit is specified, do a shallow fetch if possible.

Rationale and explanation:
<https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00073.html>.

* bootstrap: When a commit hash is specified, ask for this specific
commit on fetch, and fallback to fetching the entire repository if
fetching by commit hash fails.

3 years agostack: also update stack_size to return idx_t
Paul Eggert [Wed, 5 Jan 2022 19:51:38 +0000 (11:51 -0800)]
stack: also update stack_size to return idx_t

* lib/stack.h (_GL_STACK_PREFIX (size)): Return idx_t, not size_t.

3 years agostack: pacify gcc -Wsign-compare
Paul Eggert [Wed, 5 Jan 2022 19:37:26 +0000 (11:37 -0800)]
stack: pacify gcc -Wsign-compare

* lib/stack.h (_GL_STACK_TYPE): Use idx_t for size too.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00035.html

3 years agoFix last commit.
Bruno Haible [Wed, 5 Jan 2022 19:03:13 +0000 (20:03 +0100)]
Fix last commit.

Based on a patch by José E. Marchesi <jemarch@gnu.org>, reported in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00036.html>.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Don't enable
-Wimplicit-fallthrough for GCC < 7.

3 years agognulib-tool: Avoid known warnings that reflect Gnulib's coding style.
Bruno Haible [Wed, 5 Jan 2022 17:21:55 +0000 (18:21 +0100)]
gnulib-tool: Avoid known warnings that reflect Gnulib's coding style.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): New macro.
* gnulib-tool (func_emit_lib_Makefile_am): Add the
GL_CFLAG_GNULIB_WARNINGS to the CFLAGS of all the compilation units of
the library.
(func_emit_tests_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the
CFLAGS.
(func_import): Emit an invocation of gl_CC_GNULIB_WARNINGS.

3 years agolicense: fix GPLv3 texts to use a comma instead of semicolon.
Bernhard Voelker [Mon, 3 Jan 2022 23:16:50 +0000 (00:16 +0100)]
license: fix GPLv3 texts to use a comma instead of semicolon.

See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Run:
  $ git grep -l 'Foundation; either version 3' \
      | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'

* All files using GPLv3: Adjust via the above command.

3 years agostring, wchar: Fix compilation error on MSVC (regression 2021-09-07).
Bruno Haible [Tue, 4 Jan 2022 12:20:55 +0000 (13:20 +0100)]
string, wchar: Fix compilation error on MSVC (regression 2021-09-07).

* lib/string.in.h (free): Don't redeclare as rpl_free. Instead, redefine
_GL_ATTRIBUTE_DEALLOC_FREE to reference rpl_free directly.
* lib/wchar.in.h (free): Likewise.

3 years agoautoupdate
Karl Berry [Mon, 3 Jan 2022 16:55:56 +0000 (08:55 -0800)]
autoupdate

3 years agogetpass-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 15:34:39 +0000 (16:34 +0100)]
getpass-gnu: Allow use as dependency from test modules.

* m4/getpass.m4 (gl_FUNC_GETPASS_GNU): Set
REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS.
* m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Initialize the
getpass-gnu module indicator.
(gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETPASS_FOR_GETPASS_GNU.
* modules/unistd (Makefile.am): Substitute GNULIB_GETPASS_GNU,
REPLACE_GETPASS_FOR_GETPASS_GNU.
* modules/getpass-gnu (configure.ac): Test
REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. Set a module
indicator.
* lib/unistd.in.h (getpass): Test REPLACE_GETPASS,
REPLACE_GETPASS_FOR_GETPASS_GNU, and the respective module indicators
instead of just REPLACE_GETPASS.

3 years agofopen-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 15:17:18 +0000 (16:17 +0100)]
fopen-gnu: Allow use as dependency from test modules.

* m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Set REPLACE_FOPEN_FOR_FOPEN_GNU
instead of REPLACE_FOPEN.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize the fopen-gnu
module indicator.
(gl_STDIO_H_DEFAULTS): Initialize REPLACE_FOPEN_FOR_FOPEN_GNU.
* modules/stdio (Makefile.am): Substitute GNULIB_FOPEN_GNU,
REPLACE_FOPEN_FOR_FOPEN_GNU.
* modules/fopen-gnu (Depends-on): Add more dependencies.
(configure.ac): Test REPLACE_FOPEN_FOR_FOPEN_GNU instead of
REPLACE_FOPEN.
* lib/stdio.in.h (fopen): Test REPLACE_FOPEN,
REPLACE_FOPEN_FOR_FOPEN_GNU, and the respective module indicators
instead of just REPLACE_FOPEN.

3 years agorealloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 14:31:53 +0000 (15:31 +0100)]
realloc-gnu: Allow use as dependency from test modules.

* m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Set
REPLACE_REALLOC_FOR_REALLOC_GNU instead of REPLACE_REALLOC.
(gl_FUNC_REALLOC_POSIX): Set REPLACE_REALLOC_FOR_REALLOC_POSIX instead
of REPLACE_REALLOC.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
realloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_REALLOC_FOR_REALLOC_GNU,
REPLACE_REALLOC_FOR_REALLOC_POSIX, not REPLACE_REALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_REALLOC_GNU,
REPLACE_REALLOC_FOR_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_POSIX, not
REPLACE_REALLOC.
* modules/realloc-posix (Depends-on, configure.ac): Test
REPLACE_REALLOC_FOR_REALLOC_POSIX instead of REPLACE_REALLOC.
* modules/realloc-gnu (Comment): Remove section.
(Depends-on): Add free-posix, malloc-gnu, xalloc-oversized.
(configure.ac): Test REPLACE_REALLOC_FOR_REALLOC_GNU instead of
REPLACE_REALLOC. Set a module indicator.
* lib/stdlib.in.h (realloc): Test REPLACE_REALLOC_FOR_REALLOC_POSIX,
REPLACE_REALLOC_FOR_REALLOC_GNU, and the respective module indicators
instead of just REPLACE_REALLOC.

3 years agocalloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 14:17:02 +0000 (15:17 +0100)]
calloc-gnu: Allow use as dependency from test modules.

* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Set REPLACE_CALLOC_FOR_CALLOC_GNU
instead of REPLACE_CALLOC.
(gl_FUNC_CALLOC_POSIX): Set REPLACE_CALLOC_FOR_CALLOC_POSIX instead of
REPLACE_CALLOC.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
calloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_CALLOC_FOR_CALLOC_GNU,
REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_CALLOC_GNU,
REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not
REPLACE_CALLOC.
* modules/calloc-posix (Depends-on, configure.ac): Test
REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC.
* modules/calloc-gnu (Depends-on): Add xalloc-oversized.
(configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_GNU instead of
REPLACE_CALLOC. Set a module indicator.
* lib/stdlib.in.h (calloc): Test REPLACE_CALLOC_FOR_CALLOC_POSIX,
REPLACE_CALLOC_FOR_CALLOC_GNU, and the respective module indicators
instead of just REPLACE_CALLOC.

3 years agomalloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 13:49:04 +0000 (14:49 +0100)]
malloc-gnu: Allow use as dependency from test modules.

* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Set REPLACE_MALLOC_FOR_MALLOC_GNU
instead of REPLACE_MALLOC.
(gl_FUNC_MALLOC_PTRDIFF, gl_FUNC_MALLOC_POSIX): Set
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Test
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
malloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_MALLOC_FOR_MALLOC_GNU,
REPLACE_MALLOC_FOR_MALLOC_POSIX, not REPLACE_MALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_MALLOC_GNU,
REPLACE_MALLOC_FOR_MALLOC_GNU, REPLACE_MALLOC_FOR_MALLOC_POSIX, not
REPLACE_MALLOC.
* modules/malloc-posix (Depends-on, configure.ac): Test
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* modules/malloc-gnu (Comment): Remove section.
(Depends-on): Add xalloc-oversized.
(configure.ac): Test REPLACE_MALLOC_FOR_MALLOC_GNU instead of
REPLACE_MALLOC. Set a module indicator.
* lib/stdlib.in.h (malloc): Test REPLACE_MALLOC_FOR_MALLOC_POSIX,
REPLACE_MALLOC_FOR_MALLOC_GNU, and the respective module indicators
instead of just REPLACE_MALLOC.

3 years agostriconveh: Make the last change also work on Solaris 11.
Bruno Haible [Sun, 2 Jan 2022 23:31:58 +0000 (00:31 +0100)]
striconveh: Make the last change also work on Solaris 11.

* lib/striconveh.c (mem_cd_iconveh_internal): Tweak last commit.

3 years agostriconveh: Make the last change also work on musl libc.
Bruno Haible [Sun, 2 Jan 2022 18:55:27 +0000 (19:55 +0100)]
striconveh: Make the last change also work on musl libc.

* lib/striconveh.c (mem_cd_iconveh_internal): Make the U+FFFD conversion
also work with non-GNU iconv() implementations.

3 years agogen-header: port to BusyBox ‘sed’
Paul Eggert [Sat, 1 Jan 2022 23:30:38 +0000 (15:30 -0800)]
gen-header: port to BusyBox ‘sed’

Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00004.html
* modules/gen-header (SED_HEADER_NOEDIT): Replace instead of prepend.
(SED_HEADER_STDOUT, SED_HEADER_TO_AT_t): Adjust to that change.
Do not use ‘w foo’ twice in the same script, as BusyBox ‘sed’
mistakenly opens ‘foo’ for output twice, thus losing some output.

3 years agoautoupdate
Paul Eggert [Sat, 1 Jan 2022 20:05:00 +0000 (12:05 -0800)]
autoupdate

3 years agostriconveh: Support an error handler that produces a Unicode U+FFFD.
Bruno Haible [Sat, 1 Jan 2022 18:48:54 +0000 (19:48 +0100)]
striconveh: Support an error handler that produces a Unicode U+FFFD.

Suggested by Marc Nieper-Wißkirchen in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00175.html>.

* lib/iconveh.h (iconveh_replacement_character): New enum value.
* lib/striconveh.c (mem_cd_iconveh_internal): When the handler is
iconveh_replacement_character, try to produce U+FFFD when possible,
instead of '?'.
* tests/test-striconveh.c (main): Add GB18030 tests. Test also
iconveh_replacement_character.

3 years agomaint: Update copyright notices.
Bruno Haible [Sat, 1 Jan 2022 18:48:46 +0000 (19:48 +0100)]
maint: Update copyright notices.

* build-aux/declared.sh (func_version): Bump year.

3 years agomaint: Update copyright notices in code generating programs.
Bruno Haible [Sat, 1 Jan 2022 18:48:03 +0000 (19:48 +0100)]
maint: Update copyright notices in code generating programs.

* lib/gen-uni-tables.c (output_predicate_test, output_predicate,
output_category, output_combclass, output_bidi_category,
output_decimal_digit_test, output_decimal_digit, output_digit_test,
output_digit, output_numeric_test, output_numeric, output_mirror,
output_joining_type_test, output_joining_type,
output_joining_group_test, output_joining_group, output_scripts,
output_scripts_byname, output_blocks, output_ident_category,
output_nonspacing_property, output_lbrk_tables,
output_lbrk_rules_as_tables, output_wbrk_tables, output_gbp_test,
output_gbp_table, output_decomposition_tables,
output_composition_tables, output_simple_mapping_test,
output_simple_mapping, output_casing_rules): Extend copyright year of
generated file to 2022.
* lib/uniname/gen-uninames.lisp (main): Likewise. Produce license notice
that is consistent with the gnulib/etc/license-notices/ files.
* All files regenerated.

3 years agomaint: fix ‘make update-copyright’ on symlinks
Paul Eggert [Sat, 1 Jan 2022 18:24:28 +0000 (10:24 -0800)]
maint: fix ‘make update-copyright’ on symlinks

After running ‘make update-copyright’ I noticed that it
incorrectly replaced a couple of symlinks with their contents.
* Makefile (update-copyright): Do not update symlinks.
* etc/license-notices/GPL, etc/license-notices/LGPL:
Change these back to symlinks.

3 years agomaint: run 'make update-copyright'
Paul Eggert [Sat, 1 Jan 2022 17:43:19 +0000 (09:43 -0800)]
maint: run 'make update-copyright'