]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 years agogettext-h: Optimize also for clang.
Bruno Haible [Tue, 7 Dec 2021 04:41:29 +0000 (05:41 +0100)]
gettext-h: Optimize also for clang.

* lib/gettext.h (pgettext_aux, npgettext_aux, dcpgettext_expr,
dcnpgettext_expr): Inline also on clang.

3 years agointprops: Break sync with glibc.
Bruno Haible [Mon, 6 Dec 2021 20:28:40 +0000 (21:28 +0100)]
intprops: Break sync with glibc.

* config/srclist.txt: Comment out intprops.h.

3 years agointprops: streamline and get ready for Clang 14
Paul Eggert [Mon, 6 Dec 2021 18:29:54 +0000 (10:29 -0800)]
intprops: streamline and get ready for Clang 14

* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW):
Rely on __has_builtin first, since GCC didn’t introduce it until
GCC 9 so we don’t need to special-case GCC first.
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P):
Look at __EDG__ rather than __ICC, since icc defines __EDG__ too.
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Define to 1 in Clang 14 and later,
as a bug fix is scheduled for Clang 14.
(_GL_HAS_BUILTIN_OVERFLOW_P): Do not bother to special-case
__clang__, since __has_builtin should do the right thing anyway.

3 years agointprops: Treat EDG-based compilers like Intel compilers.
Bruno Haible [Mon, 6 Dec 2021 16:47:05 +0000 (17:47 +0100)]
intprops: Treat EDG-based compilers like Intel compilers.

Reported by Ilya Kurdyukov <ilyakurdyukov@altlinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00028.html>.

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based
compilers.

3 years agosigsegv: Fix build on some more embedded CPUs.
Bruno Haible [Mon, 6 Dec 2021 00:16:10 +0000 (01:16 +0100)]
sigsegv: Fix build on some more embedded CPUs.

* m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows
negative, when the GCC 11 sources say so.

3 years agosys_random: port better to uClibc < 1.0.35
Paul Eggert [Wed, 1 Dec 2021 01:50:01 +0000 (17:50 -0800)]
sys_random: port better to uClibc < 1.0.35

Problem reported by Fabrice Fontaine in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
Include <stddef.h>, in case this file is included before
__UCLIBC__ is defined.

3 years agogettext-h: document GNULIB_NO_VLA
Paul Eggert [Sat, 27 Nov 2021 08:49:56 +0000 (00:49 -0800)]
gettext-h: document GNULIB_NO_VLA

* doc/gnulib-readme.texi (C99 features avoided):
Document GNULIB_NO_VLA.

3 years agogettext-h: use VLA test similar to regex
Paul Eggert [Sat, 27 Nov 2021 08:33:24 +0000 (00:33 -0800)]
gettext-h: use VLA test similar to regex

* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Assuming
GNULIB_NO_VLA, define if (defined __STDC_VERSION__ && 199901L <=
__STDC_VERSION__ \ + && !defined __STDC_NO_VLA___), not if
((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__).
This is more consistent with what the regex module does.
* modules/gettext-h (Depends-on): Depend on vararrays, since
lib/gettext.h uses __STDC_NO_VLA__.

3 years agoregex: port to tcc
Paul Eggert [Sat, 27 Nov 2021 08:00:46 +0000 (00:00 -0800)]
regex: port to tcc

Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00038.html
* modules/regex (Depends-on): Depend on vararrays, since
lib/regex.h uses __STDC_NO_VLA__.
* modules/vararrays: Change license from LGPL to LGPLv2+.

3 years agotest-framework-sh: remove unsafe entries from PATH
Bernhard Voelker [Wed, 24 Nov 2021 22:59:00 +0000 (23:59 +0100)]
test-framework-sh: remove unsafe entries from PATH

Running tests with '.' in the PATH may yield unspecified results,
and is deemed unsafe per se.  This includes empty entries as well
which are treated like a '.' entry as per POSIX.

* tests/init.sh (setup_): Add snippet to remove relative and non-
accessible entries from the PATH environment variable.

3 years agoregex: merge from glibc
Paul Eggert [Wed, 24 Nov 2021 17:33:46 +0000 (09:33 -0800)]
regex: merge from glibc

The main change here, imported from Glibc, is for the regex
code to stop using nested functions when _LIBC is defined.
The intent is for the result to be copied back to Glibc
so that the two implementations can resync.
* lib/regcomp.c (re_set_fastmap, seek_collating_symbol_entry)
(lookup_collation_sequence_value, build_range_exp)
(build_collating_symbol):
* lib/regexec.c (acquire_init_state_context):
Declare with __always_inline instead of with
‘inline __attribute__ ((always_inline))’.
* lib/regexec.c (init_word_char):
Move uint64_t comment to regex_internal.h.
(parse_byte): Change multibyte-detecting arg from re_charset_t *
to re_dfa_t const *.  All callers changed.
(build_range_exp, build_collating_symbol) [!_LIBC]:
Change signature to match _LIBC well enough so that the caller can
be simplified to assume _LIBC.
(parse_bracket_exp): Pull its nested functions
seek_collating_symbol_entry, lookup_collation_sequence_value,
build_range_exp, build_collating_symbol out to the top level,
adding args to pass the information instead of having them access
nonlocal vars.  Use types in local vars that do not assume glibc.
* lib/regex_internal.h: Explain uint64_t etc. here.

3 years agoregex: assume RE_ENABLE_I18N
Paul Eggert [Wed, 24 Nov 2021 01:34:45 +0000 (17:34 -0800)]
regex: assume RE_ENABLE_I18N

These days there is no longer any need to port to platforms
lacking iswctype etc., since Gnulib now has substitutes.
* config/srclist.txt: Comment out regex_internal.c and
regex_internal.h for now, since they no longer match glibc.
The intent is to merge them again soon.
* lib/regex_internal.h (RE_ENABLE_I18N): Remove.
All uses changed to assume that RE_ENABLE_I18N is 1.
* modules/regex (Depends-on): Add iswctype.

3 years agolseek: port around macOS SEEK_HOLE glitch
Paul Eggert [Tue, 16 Nov 2021 06:17:44 +0000 (22:17 -0800)]
lseek: port around macOS SEEK_HOLE glitch

Problem reported by Sudhip Nashi (Bug#51857#47).
* lib/lseek.c (rpl_lseek): Work around macOS lseek+SEEK_HOLE
returning -1 with ENXIO if there are no holes before EOF,
contrary to the macOS documentation.

3 years agolseek: port around macOS SEEK_DATA glitch
Paul Eggert [Mon, 15 Nov 2021 23:08:25 +0000 (15:08 -0800)]
lseek: port around macOS SEEK_DATA glitch

Problem reported by Sudhip Nashi (Bug#51857).
* doc/posix-functions/lseek.texi (lseek): Mention macOS SEEK_DATA
issue.
* lib/lseek.c (rpl_lseek): Work around macOS portability glitch.
* m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek on Darwin.
* modules/lseek (Depends-on): Depend on msvc-nothrow
and fstat only if needed.

3 years agoAdd ChangeLog entry for sigsegv changes
Paul Eggert [Fri, 12 Nov 2021 02:38:46 +0000 (18:38 -0800)]
Add ChangeLog entry for sigsegv changes

3 years agosigsegv: fix build on or1k
Fabrice Fontaine [Thu, 11 Nov 2021 09:06:31 +0000 (10:06 +0100)]
sigsegv: fix build on or1k

Fix the following build failure on or1k with diffutils 3.8
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=e54aa6196947ed22ff66bcd714e4fc7bd0c5c3b4
sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this'
http://autobuild.buildroot.org/results/5427e52489d29ed4f18b4a70b3c36f0f7bb0ddd9

3 years agosigsegv: fix build on microblazeel
Fabrice Fontaine [Thu, 11 Nov 2021 08:57:23 +0000 (09:57 +0100)]
sigsegv: fix build on microblazeel

Fix the following build failure on microblazeel with diffutils 3.8:
sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this'
http://autobuild.buildroot.org/results/5ecd55b7c72f9630a7acc72341ccb60e94ddb574

3 years agoFix typos in previous patch.
Paul Eggert [Tue, 9 Nov 2021 18:06:22 +0000 (10:06 -0800)]
Fix typos in previous patch.

3 years agoexclude: yield proper errno on failure
Paul Eggert [Tue, 9 Nov 2021 17:50:28 +0000 (09:50 -0800)]
exclude: yield proper errno on failure

* lib/exclude.c (add_exclude_file): Do not assume that fclose
preserves errno on success.

3 years agoautoupdate
Karl Berry [Mon, 8 Nov 2021 15:21:39 +0000 (07:21 -0800)]
autoupdate

3 years agoregex: break regcomp.c link with glibc
Paul Eggert [Mon, 8 Nov 2021 07:31:08 +0000 (23:31 -0800)]
regex: break regcomp.c link with glibc

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00005.html
* config/srclist.txt: Comment out regcomp.c for now.
* lib/regcomp.c: Revert previous change.

3 years agoautoupdate
Karl Berry [Wed, 3 Nov 2021 15:06:20 +0000 (08:06 -0700)]
autoupdate

3 years ago* doc/gnulib-intro.texi: Fix some ancient history.
Paul Eggert [Tue, 2 Nov 2021 01:18:13 +0000 (18:18 -0700)]
* doc/gnulib-intro.texi: Fix some ancient history.

3 years agoautoupdate (belated)
Karl Berry [Thu, 28 Oct 2021 20:16:13 +0000 (13:16 -0700)]
autoupdate (belated)

3 years agostring: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07).
Bruno Haible [Sun, 24 Oct 2021 22:34:24 +0000 (00:34 +0200)]
string: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07).

Reported by Jan Engelhardt <jengelh@inai.de>
and by Arash Esbati <arash@gnu.org> via Andy Moreton in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00058.html>.

* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Add fallback declarations, like in
lib/stdlib.in.h.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Likewise.

3 years agoautoupdate
Karl Berry [Thu, 21 Oct 2021 14:28:12 +0000 (07:28 -0700)]
autoupdate

3 years agoautoupdate
Karl Berry [Wed, 20 Oct 2021 13:54:34 +0000 (06:54 -0700)]
autoupdate

3 years agoxalloc: new function xinmalloc
Paul Eggert [Tue, 19 Oct 2021 23:31:32 +0000 (16:31 -0700)]
xalloc: new function xinmalloc

* lib/xmalloc.c (xinmalloc): New function, which is like
xnmalloc but for idx_t instead of size_t.

3 years agoregex: redo style of previous change
Paul Eggert [Tue, 19 Oct 2021 08:48:37 +0000 (01:48 -0700)]
regex: redo style of previous change

3 years agoregex: improve comment
Paul Eggert [Tue, 19 Oct 2021 08:07:56 +0000 (01:07 -0700)]
regex: improve comment

3 years agoregex: fix buffer read overrrun
Paul Eggert [Mon, 18 Oct 2021 21:50:16 +0000 (14:50 -0700)]
regex: fix buffer read overrrun

* config/srclist.txt: Remove posix/regexec.c for now.
* lib/regexec.c (re_search_internal):
Fix buffer read overrun reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2021-10/msg00035.html

3 years agonproc: port better to macOS 10.14
Paul Eggert [Sat, 16 Oct 2021 02:33:46 +0000 (19:33 -0700)]
nproc: port better to macOS 10.14

* lib/nproc.c (num_processors_ignoring_omp)
[HAVE_SYSCTL && !defined __GLIBC__ && defined HW_NCPU]:
Do not use a const mib, as macOS 10.14 rejects this.

3 years agosigsegv: fix quoting problem
Paul Eggert [Wed, 13 Oct 2021 17:24:40 +0000 (10:24 -0700)]
sigsegv: fix quoting problem

Problem reported for FreeBSD ports by Alexey Dokuchaev in:
https://bugs.gnu.org/51144
* m4/stack-direction.m4 (SV_STACK_DIRECTION): Quote brackets.

3 years agonproc: port better to OpenBSD
Paul Eggert [Sun, 10 Oct 2021 17:43:47 +0000 (10:43 -0700)]
nproc: port better to OpenBSD

Problem reported by Omar Polo in:
https://lists.gnu.org/r/emacs-devel/2021-10/msg00692.html
* lib/nproc.c (num_processors_ignoring_omp): Prefer HW_NCPUONLINE
to HW_NCPU, for OpenBSD.  Also, make mib const.

3 years agotimer-time: port better to OpenBSD 6.9
Paul Eggert [Sun, 3 Oct 2021 00:50:48 +0000 (17:50 -0700)]
timer-time: port better to OpenBSD 6.9

* m4/timer_time.m4 (gl_TIMER_TIME): Also require timer_settime to
be declared, as it exists in OpenBSD but always fails with ENOSYS.

3 years agosys_select: port better to OpenBSD 6.9
Paul Eggert [Sat, 2 Oct 2021 21:11:55 +0000 (14:11 -0700)]
sys_select: port better to OpenBSD 6.9

OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
includes <signal.h>, which caused coreutils/lib/nproc.c compiles
to fail with "/usr/include/signal.h:57: warning: 'struct
sigaction' declared inside parameter list".  Fix this.
* lib/sys_select.in.h [__OpenBSD__]: Simply delegate to the system
header if being included from <sys/time.h>.

3 years agoautoupdate
Karl Berry [Sat, 2 Oct 2021 16:28:51 +0000 (09:28 -0700)]
autoupdate

3 years agodoc: Fix outdated statement about Spanish collation.
Bruno Haible [Wed, 22 Sep 2021 21:19:22 +0000 (23:19 +0200)]
doc: Fix outdated statement about Spanish collation.

Reported by Dietmar Schindler in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00095.html>.

* doc/regex.texi (Collating Elements vs. Characters): Choose another
example of a digraph with special collation.

3 years agodoc: Don't assume that the output format is TeX-based or info.
Bruno Haible [Wed, 22 Sep 2021 21:07:24 +0000 (23:07 +0200)]
doc: Don't assume that the output format is TeX-based or info.

Reported by Dietmar Schindler in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00095.html>.

* doc/regex.texi (Collating Elements vs. Characters): Assume a texinfo
version that groks UTF-8 encoded ISO-8859-1 characters.

3 years agoregex: sync with glibc
Paul Eggert [Tue, 21 Sep 2021 15:14:05 +0000 (08:14 -0700)]
regex: sync with glibc

* config/srclist.txt: Uncomment-out posix/regex.c and related
files, as the Gnulib versions have now been copied to glibc.
* lib/intprops.h: Remove authorship comment, as per glibc guidelines.

3 years agomaint: Avoid syntax-check failure for empty gnulib submodule.
Simon Josefsson [Mon, 20 Sep 2021 07:40:47 +0000 (09:40 +0200)]
maint: Avoid syntax-check failure for empty gnulib submodule.

* top/maint.mk (gnulib_dir): Fall back to GNULIB_SRCDIR if
submodule is not checked out.

3 years agoRelicense qemu.h under LGPLv2+.
Bruno Haible [Sun, 19 Sep 2021 22:09:45 +0000 (00:09 +0200)]
Relicense qemu.h under LGPLv2+.

* tests/qemu.h: Change license header.

3 years agoialloc: Update license headers after license change from 2021-08-29.
Bruno Haible [Sun, 19 Sep 2021 21:40:03 +0000 (23:40 +0200)]
ialloc: Update license headers after license change from 2021-08-29.

* lib/ialloc.h: Update license header.
* lib/ialloc.c: Likewise.

3 years agoImprove 'configure --help' output for crypto modules.
Bruno Haible [Sun, 19 Sep 2021 13:14:24 +0000 (15:14 +0200)]
Improve 'configure --help' output for crypto modules.

* m4/af_alg.m4 (gl_AF_ALG): List the hash functions for which we use the
Linux crypto. Also mention that we use it on files only.
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Use manual line breaking, not the
line-filling style of AS_HELP_STRING. Show that --with-openssl takes an
optional argument. List the hash functions for which we use the OpenSSL
library. Don't mention --with-linux-crypto if the af_alg module is not
in use. Mention that --with-linux-crypto applies only to the Linux
kernel. Mention that it gets used only when available. Mention that it
takes precedence only for files. In the error or warning, mention the
pre-built package name that people can install.

3 years agoAdd credit for a recent bug report.
Bruno Haible [Sun, 19 Sep 2021 01:37:51 +0000 (03:37 +0200)]
Add credit for a recent bug report.

3 years agostring, wchar: Don't require undefined m4 macros (regr. today).
Bruno Haible [Sun, 19 Sep 2021 01:11:19 +0000 (03:11 +0200)]
string, wchar: Don't require undefined m4 macros (regr. today).

Reported by Colin Watson <cjwatson@debian.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00078.html>.

* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Don't use m4_require
directly. Instead, invoke gl_STDLIB_H_REQUIRE_DEFAULTS.
* m4/wchar_h.m4 (gl_WCHAR_H_REQUIRE_DEFAULTS): Likewise.

3 years agosm3-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:43:02 +0000 (01:43 +0200)]
sm3-buffer tests: New module.

* tests/test-sm3-buffer.c: Renamed from tests/test-sm3.c.
* modules/crypto/sm3-buffer-tests: Renamed from
modules/crypto/sm3-tests. Test tests/test-sm3-buffer.c instead of
tests/test-sm3.c.

3 years agosm3-buffer: New module.
Bruno Haible [Sat, 18 Sep 2021 23:42:57 +0000 (01:42 +0200)]
sm3-buffer: New module.

* lib/sm3-stream.c: New file, extracted from lib/sm3.c.
* lib/sm3.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, sm3_stream): Moved to sm3-stream.c.
* lib/sm3.h: Tweak.
* modules/crypto/sm3-buffer: New file, based on modules/crypto/sm3.
* modules/crypto/sm3: Rewritten.

3 years agosha512-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:42:20 +0000 (01:42 +0200)]
sha512-buffer tests: New module.

* tests/test-sha512-stream.c: Renamed from tests/test-sha512.c.
* modules/crypto/sha512-buffer-tests: New file, based on
modules/crypto/sha512-tests.
* modules/crypto/sha512-tests: Remove tests that are now in
modules/crypto/sha512-buffer-tests. Test tests/test-sha512-stream.c
instead of tests/test-sha512.c.

3 years agosha512: Clarify module to source relation.
Bruno Haible [Sat, 18 Sep 2021 23:40:46 +0000 (01:40 +0200)]
sha512: Clarify module to source relation.

* lib/sha512-stream.c: New file, extracted from lib/sha512.c.
* lib/sha512.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, shaxxx_stream, sha512_stream, sha384_stream): Moved to
sha512-stream.c.
* lib/sha512.h: Tweak.
* modules/crypto/sha512 (Files): Add lib/sha512-stream.c.
(configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM.
(Makefile.am): Arrange to compile sha512-stream.c.
(Link): Mention $(LIB_CRYPTO).

3 years agosha256-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:39:47 +0000 (01:39 +0200)]
sha256-buffer tests: New module.

* tests/test-sha256-stream.c: Renamed from tests/test-sha256.c.
* modules/crypto/sha256-buffer-tests: New file, based on
modules/crypto/sha256-tests.
* modules/crypto/sha256-tests: Remove tests that are now in
modules/crypto/sha256-buffer-tests. Test tests/test-sha256-stream.c
instead of tests/test-sha256.c.

3 years agosha256: Clarify module to source relation.
Bruno Haible [Sat, 18 Sep 2021 23:38:36 +0000 (01:38 +0200)]
sha256: Clarify module to source relation.

* lib/sha256-stream.c: New file, extracted from lib/sha256.c.
* lib/sha256.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, shaxxx_stream, sha256_stream, sha224_stream): Moved to
sha256-stream.c.
* lib/sha256.h: Tweak.
* modules/crypto/sha256 (Files): Add lib/sha256-stream.c.
(configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM.
(Makefile.am): Arrange to compile sha256-stream.c.
(Link): Mention $(LIB_CRYPTO).

3 years agosha1-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:37:51 +0000 (01:37 +0200)]
sha1-buffer tests: New module.

* tests/test-sha1-buffer.c: New file, based on tests/test-sha1.c.
* tests/test-sha1-stream.c: Renamed from tests/test-sha1.c.
(main): Remove sha1-buffer tests.
* modules/crypto/sha1-buffer-tests: New file, based on
modules/crypto/sha1-tests.
* modules/crypto/sha1-tests: Remove tests that are now in
modules/crypto/sha1-buffer-tests. Test tests/test-sha1-stream.c instead
of tests/test-sha1.c.

3 years agosha1: Clarify module to source relation.
Bruno Haible [Sat, 18 Sep 2021 23:36:29 +0000 (01:36 +0200)]
sha1: Clarify module to source relation.

* lib/sha1-stream.c: New file, extracted from lib/sha1.c.
* lib/sha1.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, sha1_stream): Moved to sha1-stream.c.
* lib/sha1.h: Correct indentation.
* modules/crypto/sha1 (Files): Add lib/sha1-stream.c.
(configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM.
(Makefile.am): Arrange to compile sha1-stream.c.
(Link): Mention $(LIB_CRYPTO).

3 years agomd5-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:35:24 +0000 (01:35 +0200)]
md5-buffer tests: New module.

* tests/test-md5-buffer.c: New file, based on tests/test-md5.c.
* tests/test-md5-stream.c: Renamed from tests/test-md5.c.
(main): Remove md5-buffer tests.
* modules/crypto/md5-buffer-tests: New file, based on
modules/crypto/md5-tests.
* modules/crypto/md5-tests: Remove tests that are now in
modules/crypto/md5-buffer-tests. Test tests/test-md5-stream.c instead
of tests/test-md5.c.

3 years agomd5: Clarify module to source relation.
Bruno Haible [Sat, 18 Sep 2021 23:35:19 +0000 (01:35 +0200)]
md5: Clarify module to source relation.

* lib/md5-stream.c: New file, extracted from lib/md5.c.
* lib/md5.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, md5_stream): Moved to md5-stream.c.
* lib/md5.h: Tweak.
* modules/crypto/md5 (Files): Add lib/md5-stream.c.
(configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM.
(Makefile.am): Arrange to compile md5-stream.c.
(Link): Mention $(LIB_CRYPTO).

3 years agomd4-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:33:31 +0000 (01:33 +0200)]
md4-buffer tests: New module.

* tests/test-md4-buffer.c: Renamed from tests/test-md4.c.
* modules/crypto/md4-buffer-tests: Renamed from
modules/crypto/md4-tests. Test tests/test-md4-buffer.c instead of
tests/test-md4.c.

3 years agomd4-buffer: New module.
Bruno Haible [Sat, 18 Sep 2021 23:32:01 +0000 (01:32 +0200)]
md4-buffer: New module.

* lib/md4-stream.c: New file, extracted from lib/md4.c.
* lib/md4.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, md4_stream): Moved to md4-stream.c.
* lib/md4.h: Reorder declarations.
* modules/crypto/md4-buffer: New file, based on modules/crypto/md4.
* modules/crypto/md4: Rewritten.

3 years agomd2-buffer tests: New module.
Bruno Haible [Sat, 18 Sep 2021 23:30:12 +0000 (01:30 +0200)]
md2-buffer tests: New module.

* tests/test-md2-buffer.c: Renamed from tests/test-md2.c.
* modules/crypto/md2-buffer-tests: Renamed from
modules/crypto/md2-tests. Test tests/test-md2-buffer.c instead of
tests/test-md2.c.

3 years agomd2-buffer: New module.
Bruno Haible [Sat, 18 Sep 2021 23:29:33 +0000 (01:29 +0200)]
md2-buffer: New module.

* lib/md2-stream.c: New file, extracted from lib/md2.c.
* lib/md2.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, md2_stream): Moved to md2-stream.c.
* lib/md2.h: Reorder declarations.
* modules/crypto/md2-buffer: New file, based on modules/crypto/md2.
* modules/crypto/md2: Rewritten.

3 years agostring, wchar: Don't cause link errors for rpl_free (regr. 2021-09-07).
Bruno Haible [Sat, 18 Sep 2021 14:31:52 +0000 (16:31 +0200)]
string, wchar: Don't cause link errors for rpl_free (regr. 2021-09-07).

* lib/string.in.h (free, rpl_free): Consider GNULIB_FREE_POSIX variable.
* lib/wchar.in.h (free, rpl_free): Likewise.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Require module
indicator variable initializations from the stdlib module.
* m4/wchar_h.m4 (gl_WCHAR_H_REQUIRE_DEFAULTS): Likewise.
* modules/string (Makefile.am): Substitute GNULIB_FREE_POSIX in string.h.
* modules/wchar (Makefile.am): Substitute GNULIB_FREE_POSIX in wchar.h.

3 years agothreadlib: Avoid crashes in thread-related functions on Cygwin 3.2.0.
Bruno Haible [Fri, 17 Sep 2021 20:22:50 +0000 (22:22 +0200)]
threadlib: Avoid crashes in thread-related functions on Cygwin 3.2.0.

Reported by Brian Inglis via Akim Demaille in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00063.html>.

* m4/threadlib.m4 (gl_WEAK_SYMBOLS): Force a "guessing no" result on
Cygwin.

3 years agosimple-atomic: Port to Oracle Studio 12.6.
Bruno Haible [Mon, 13 Sep 2021 23:18:37 +0000 (01:18 +0200)]
simple-atomic: Port to Oracle Studio 12.6.

* lib/simple-atomic.c (asm) [0x590 <= __SUNPRO_C && __STDC__]:

3 years agoasyncsafe-spin: port to Oracle Studio 12.6 sparc
Paul Eggert [Mon, 13 Sep 2021 18:12:54 +0000 (11:12 -0700)]
asyncsafe-spin: port to Oracle Studio 12.6 sparc

Problem reported by Dennis Clarke via Eric Blake in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00056.html
* lib/asyncsafe-spin.c (asm) [0x590 <= __SUNPRO_C && __STDC__]:
#define to __asm.

3 years agostdint-tests: long long preproc on recent Sun C
Paul Eggert [Mon, 13 Sep 2021 06:46:19 +0000 (23:46 -0700)]
stdint-tests: long long preproc on recent Sun C

* tests/test-stdint.c: Test long long preprocessor constants on
Oracle Developer Studio 12.6, where they should work.

3 years agoextern-inline: Fix syntax error on macOS with GCC 11 (regr. 2021-08-22).
Bruno Haible [Mon, 13 Sep 2021 05:28:09 +0000 (07:28 +0200)]
extern-inline: Fix syntax error on macOS with GCC 11 (regr. 2021-08-22).

Reported by Akim Demaille in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00052.html>.

* m4/extern-inline.m4 (_GL_INLINE, _GL_EXTERN_INLINE): Put _GL_UNUSED
before, not after, 'static'.

3 years agosigsegv: port to OpenBSD 6.8+ powerpc64
Christian Weisgerber [Sat, 11 Sep 2021 20:51:13 +0000 (13:51 -0700)]
sigsegv: port to OpenBSD 6.8+ powerpc64

* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER):
Special case for __OpenBSD__ && __powerpc64__, needed due to:
https://github.com/openbsd/src/commit/5e649a8714ba05cf482011b7b7d1e5437b7c17db
which is part of the oldest currently-supported OpenBSD (6.8),
so we needn’t worry about older versions.

3 years agomaintainer-makefile: add 'can' to sc_prohibit_doubled_word
Pádraig Brady [Thu, 9 Sep 2021 15:16:03 +0000 (16:16 +0100)]
maintainer-makefile: add 'can' to sc_prohibit_doubled_word

* top/maint.mk (sc_prohibit_doubled_word): Check for "can can".

3 years agostrerror_r-posix: port even better to Android
Paul Eggert [Thu, 9 Sep 2021 02:18:37 +0000 (19:18 -0700)]
strerror_r-posix: port even better to Android

* lib/strerror_r.c: Use STRERROR_R_CHAR_P to decide whether the
system strerror_r returns char *, and HAVE_DECL_STRERROR_R to
decide whether it either does that or returns an integer.  In the
former case, use the system strerror_r even on platforms like
Android API level 23 that don’t have __xpg_strerror_r; also
check for strerror_r failure just in case.
* m4/error.m4 (gl_PREREQ_ERROR):
* m4/strerror_r.m4 (gl_PREREQ_STRERROR_R):
Use system extensions on Android, to avoid mishandling strerror_r
on API level 23 and later.
* modules/error, modules/strerror_r-posix (configure.ac):
Surround gl_PREREQ_ERROR with AS_IF instead of plain if, so that
AC_REQUIREs are propagated out.

3 years agostrerror_r-posix: port better to Android
Paul Eggert [Wed, 8 Sep 2021 16:45:46 +0000 (09:45 -0700)]
strerror_r-posix: port better to Android

* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of
gl_USE_SYSTEM_EXTENSIONS from here ...
(gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that
actually needs it.  This avoids a bug where 'configure' tests
whether strerror_r has the POSIX API before enabling GNU
extensions.  On Android, enabling GNU extensions switches from the
POSIX to the GNU API.  Problem reported by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html

3 years agostring, wchar: port rpl_free decl to Android
Paul Eggert [Wed, 8 Sep 2021 16:42:41 +0000 (09:42 -0700)]
string, wchar: port rpl_free decl to Android

* lib/string.in.h, lib/wchar.in.h:
(free): When replacing it, declare the unreplaced version too.
Problem reported by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html

3 years agostring, wchar: avoid some namespace pollution
Paul Eggert [Wed, 8 Sep 2021 00:51:39 +0000 (17:51 -0700)]
string, wchar: avoid some namespace pollution

* lib/string.in.h, lib/wchar.in.h:
(free): Declare by hand instead of including stdlib.h.
This avoids some namespace pollution.  It should also avoid some
nested-include problems described by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00018.html
* modules/string, modules/wchar:
(Depends-on): Add stdlib, so that REPLACE_FREE has the right value.
(Makefile.am): Replace @REPLACE_FREE@ when creating the include file.

3 years agocrypto: revert previous change
Paul Eggert [Tue, 7 Sep 2021 21:49:09 +0000 (14:49 -0700)]
crypto: revert previous change

3 years agocrypto: add missing file af_alg.h
Paul Eggert [Tue, 7 Sep 2021 01:43:36 +0000 (18:43 -0700)]
crypto: add missing file af_alg.h

* modules/crypto/md5-buffer, modules/crypto/sha1-buffer:
* modules/crypto/sha256-buffer, modules/crypto/sha512-buffer:
(Files): Add lib/af_alg.h, since the .c files include it.

3 years agoidx: break copying from glibc
Paul Eggert [Sat, 4 Sep 2021 16:45:06 +0000 (09:45 -0700)]
idx: break copying from glibc

* config/srclist.txt: Comment out idx.h, and bring back recent change.

3 years agosigsegv: Improve cross-compilation support for LoongArch CPU.
Sun Haiyong [Sat, 4 Sep 2021 13:06:43 +0000 (15:06 +0200)]
sigsegv: Improve cross-compilation support for LoongArch CPU.

* m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows
down on LoongArch.

3 years agodoc: Improve help related to bootstrap script.
Simon Josefsson [Sat, 4 Sep 2021 08:26:26 +0000 (10:26 +0200)]
doc: Improve help related to bootstrap script.

* doc/gnulib-tool.texi (VCS Issues): Make title more positive,
s/Issues/Integration/.  Some more bootstrap-related hints,
including changing suggested submodule path from .gnulib to gnulib
as this seems to be more wide-spread.

3 years agointprops: fix minor doc glitches
Paul Eggert [Sat, 4 Sep 2021 07:24:12 +0000 (00:24 -0700)]
intprops: fix minor doc glitches

* doc/intprops.texi (Integer Properties): Fix doc glitches.

3 years agodoc: Add suggestions on FDL texinfo usage.
Simon Josefsson [Sat, 4 Sep 2021 07:19:37 +0000 (09:19 +0200)]
doc: Add suggestions on FDL texinfo usage.

* doc/licenses-texi.texi (License Texinfo sources): Add texinfo
examples.

3 years agomaintainer-makefile: Add indentation syntax-check rule.
Simon Josefsson [Fri, 3 Sep 2021 19:59:43 +0000 (21:59 +0200)]
maintainer-makefile: Add indentation syntax-check rule.

* top/maint.mk (indent): Use AM_V_GEN and indent_args.
(sc_indent): New rule.
(indent_args): New variable.
(C_SOURCES): New variable, initialized to reasonable C files.
(exclude_file_name_regexp--indent): New variable.

3 years agoautoupdate
Karl Berry [Tue, 31 Aug 2021 15:30:42 +0000 (08:30 -0700)]
autoupdate

3 years agoidx: add commentary
Paul Eggert [Mon, 30 Aug 2021 18:15:20 +0000 (11:15 -0700)]
idx: add commentary

* lib/idx.h: Add comments about ssize_t and strlen, in
response to comments from Simon Josefsson in:
https://lists.gnu.org/r/bug-gnulib/2021-08/msg00196.html

3 years agoattribute: keep up with gnulib-common.m4
Paul Eggert [Mon, 30 Aug 2021 00:50:56 +0000 (17:50 -0700)]
attribute: keep up with gnulib-common.m4

* lib/attribute.h (ATTRIBUTE_DEALLOC, ATTRIBUTE_DEALLOC_FREE):
New macros, aliases for the _GL_-prefixed macros added
to gnulib-common.m4 last month.

3 years agosupersede: Fix test failure under QEMU user-mode for Linux/mips.
Bruno Haible [Mon, 30 Aug 2021 00:36:31 +0000 (02:36 +0200)]
supersede: Fix test failure under QEMU user-mode for Linux/mips.

* tests/test-supersede-open.h (test_open_supersede): Copy statbuf.st_dev
into a local variable of type dev_t.
* tests/test-supersede-fopen.h (test_fopen_supersede): Likewise.

3 years agospawn-pipe: Fix test failure when running under QEMU user-mode.
Bruno Haible [Mon, 30 Aug 2021 00:06:23 +0000 (02:06 +0200)]
spawn-pipe: Fix test failure when running under QEMU user-mode.

* tests/test-spawn-pipe-child.c: Include <stdbool.h>, <string.h>,
qemu.h.
(main): Under QEMU user-mode, allow fd 2 or fd 3 to be open.
* modules/spawn-pipe-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.

3 years agoexecute: Fix test failure when running under QEMU user-mode.
Bruno Haible [Mon, 30 Aug 2021 00:05:53 +0000 (02:05 +0200)]
execute: Fix test failure when running under QEMU user-mode.

* tests/test-execute-child.c: Include <stdbool.h>, qemu.h.
(main): Under QEMU user-mode, allow fd 3 to be open.
* modules/execute-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.

3 years agoposix_spawn_file_actions_addfchdir: Avoid test failure under QEMU.
Bruno Haible [Sun, 29 Aug 2021 23:56:46 +0000 (01:56 +0200)]
posix_spawn_file_actions_addfchdir: Avoid test failure under QEMU.

* tests/test-posix_spawn-fchdir.c: Include qemu.h.
(is_qemu): New variable.
(test): Under QEMU user-mode, don't expect that "pwd" produces the
result "/".
(main): Initialize is_qemu. Under QEMU user-mode, skip the relative file
name test.
* modules/posix_spawn_file_actions_addfchdir-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.

3 years agogetcwd tests: Avoid test failure when running under QEMU user-mode.
Bruno Haible [Sun, 29 Aug 2021 23:44:03 +0000 (01:44 +0200)]
getcwd tests: Avoid test failure when running under QEMU user-mode.

* modules/getcwd-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.
* tests/test-getcwd.c: Include qemu.h.
(test_long_name): Skip this test when running under QEMU user-mode.
(main): Consider return code 77 from test_long_name.

3 years agobase32, base64: treat negative sizes as overflows
Paul Eggert [Sun, 29 Aug 2021 19:58:49 +0000 (12:58 -0700)]
base32, base64: treat negative sizes as overflows

* lib/base64.c (base64_encode_alloc):
* lib/base32.c (base32_encode_alloc):
Treat negative sizes as overflows, for better compatibility
with previous API.

3 years agoexplicit_bzero test: Fix test failure due to GCC optimizations.
Bruno Haible [Sun, 29 Aug 2021 16:54:54 +0000 (18:54 +0200)]
explicit_bzero test: Fix test failure due to GCC optimizations.

* tests/test-explicit_bzero.c (do_secret_stuff): Use static variable
'last_stackbuf'.
(main): Use an 'if' to combine the two do_secret_stuff invocations.

3 years agodfa: port to non-gnulib
Paul Eggert [Sun, 29 Aug 2021 17:03:24 +0000 (10:03 -0700)]
dfa: port to non-gnulib

Suggested by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2021-08/msg00181.html
* lib/dfa.h (_GL_ATTRIBUTE_DEALLOC) [!_GL_ATTRIBUTE_MALLOC]:
Add missing definition.

3 years agobase32, base64: fix broken tests
Paul Eggert [Sun, 29 Aug 2021 07:45:43 +0000 (00:45 -0700)]
base32, base64: fix broken tests

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-08/msg00170.html
* lib/base32.c, lib/base64.c: Do not include verify.h,
and omit all uses of ‘assume’.
* modules/base32, modules/base64 (Depends-on): Remove verify.
* tests/test-base32.c, tests/test-base64.c:
Don’t pass out-of-range values to allocator,
as converting them to idx_t relies on implementation-defined
behavior that could trap.

3 years agoialloc: relicense
Paul Eggert [Sun, 29 Aug 2021 07:27:10 +0000 (00:27 -0700)]
ialloc: relicense

* modules/ialloc (License): Change from LGPL to LGPLv2+.

3 years agofma: Fix compilation error on Linux/sh4.
Bruno Haible [Sun, 29 Aug 2021 00:05:05 +0000 (02:05 +0200)]
fma: Fix compilation error on Linux/sh4.

* lib/fma.c (FUNC): Don't test for FE_DOWNWARD or FE_UPWARD when these
rounding modes are not defined.

3 years agosigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha, part 2.
Bruno Haible [Sat, 28 Aug 2021 23:16:37 +0000 (01:16 +0200)]
sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha, part 2.

* tests/test-sigabbrev_np.c (main): Fix syntax error.
* tests/test-sigdescr_np.c (main): Likewise.

3 years agoSkip some tests when running under QEMU user-mode.
Bruno Haible [Sat, 28 Aug 2021 23:03:29 +0000 (01:03 +0200)]
Skip some tests when running under QEMU user-mode.

* tests/qemu.h: New file.
* tests/test-get-rusage-as.c: Include qemu.h.
(main): Skip the test when running under QEMU.
* tests/test-get-rusage-data.c: Include qemu.h.
(main): Skip the test when running under QEMU.
* tests/test-printf-posix2.c: Include qemu.h.
(main): Return with code 77 when running under QEMU.
* tests/test-fprintf-posix2.c: Include qemu.h.
(main): Return with code 77 when running under QEMU.
* tests/test-fprintf-posix3.c: Include qemu.h.
(main): Return with code 79 when running under QEMU.
* tests/test-fprintf-posix3.sh: Skip the test when the return code was
79.
* tests/test-dprintf-posix2.c: Include qemu.h.
(main): Return with code 79 when running under QEMU. Use return code 80
instead of 78.
* tests/test-dprintf-posix2.sh: Skip the test when the return code was
79. Update for changed return code.
* modules/get-rusage-as-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.
* modules/get-rusage-data-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.
* modules/fprintf-posix-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.
* modules/dprintf-posix-tests (Files): Add qemu.h.
(Depends-on): Add stdbool.

3 years agosigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha.
Bruno Haible [Sat, 28 Aug 2021 17:39:05 +0000 (19:39 +0200)]
sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha.

* lib/sigabbrev_np.c (sigabbrev_np): When SIGINFO and SIGPWR have the
same value, give precendence to SIGPWR.
* lib/sigdescr_np.c (sigdescr_np): Likewise.
* tests/test-sigabbrev_np.c (main): Likewise.
* tests/test-sigdescr_np.c (main): Likewise.

3 years agoexecle, execve, execvpe tests: Fix test failures under qemu user-mode.
Bruno Haible [Sat, 28 Aug 2021 17:15:38 +0000 (19:15 +0200)]
execle, execve, execvpe tests: Fix test failures under qemu user-mode.

* test-execle-main.c: Include <string.h>.
(get_environ_assignment, create_minimal_env): New functions.
(main): Call create_minimal_env.
* test-execve-main.c: Likewise.
* test-execvpe-main.c: Likewise.

3 years agobase32, base64: prefer signed to unsigned integers
Paul Eggert [Fri, 27 Aug 2021 22:25:42 +0000 (15:25 -0700)]
base32, base64: prefer signed to unsigned integers

* lib/base32.c, lib/base64.c: Include ialloc.h instad of stdlib.h.
Include intprops.h, verify.h.
* lib/base32.c (base32_encode, base32_encode_alloc, get_8, decode_8)
(base32_decode_ctx, base32_decode_alloc_ctx):
* lib/base32.h (struct base32_decode_context):
* lib/base64.c (base64_encode_fast, base64_encode)
(base64_encode_alloc, get_4, decode_4, base64_decode_ctx)
(base64_decode_alloc_ctx):
* lib/base64.h (struct base64_decode_context):
* tests/test-base32.c (main):
* tests/test-base64.c (main):
Prefer signed to unsigned integers.
* lib/base32.c (base32_encode_alloc):
* lib/base64.c (base64_encode_alloc):
Use simpler and more-direct check for overflow, removing a TODO.
* lib/base32.h, lib/base64.h: Include idx.h instead of stddef.h.
* modules/base32, modules/base64 (Depends-on): Add ialloc, verify.

3 years agoregex: also break glibc lib/regex.c link for now
Paul Eggert [Fri, 27 Aug 2021 19:01:26 +0000 (12:01 -0700)]
regex: also break glibc lib/regex.c link for now