]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agobitset: use ffsl to accelerate iterations over set bits
Akim Demaille [Sat, 14 Nov 2020 15:58:23 +0000 (16:58 +0100)]
bitset: use ffsl to accelerate iterations over set bits

Currently we iterate over words bit by bit.  Instead, we should jump
from set bit to set bit.
Suggested by Bruno Haible.

* modules/bitset: Depend upon ffsl.
* lib/bitset/base.h (bitset_ffs, BITSET_FOR_EACH_BIT): New.
* lib/bitset/array.c (abitset_list): Use BITSET_FOR_EACH_BIT.

4 years agobitset: more tests
Akim Demaille [Sat, 14 Nov 2020 15:01:23 +0000 (16:01 +0100)]
bitset: more tests

These new tests managed to uncover shortcomings in previous versions
of the following commit.

* tests/test-bitset.c (compare): Make it clear that the random values
should not be modified.
Check bitset_first, bitset_last and BITSET_FOR_EACH.

4 years agobitset: fix the copy from lbitset to other types
Akim Demaille [Sun, 15 Nov 2020 11:23:10 +0000 (12:23 +0100)]
bitset: fix the copy from lbitset to other types

bitset_copy from an lbitset did not check whether the destination has
the same type.  Apply the same strategy as elsewhere.

Without this commit, the following one fails.

* lib/bitset/list.c (lbitset_copy): Rename as...
(lbitset_copy_): this.
(lbitset_copy): New.
Dispatch to heterogeneous/homogeneous copy.

4 years agobitset: making debug traces more useful
Akim Demaille [Sun, 15 Nov 2020 11:22:20 +0000 (12:22 +0100)]
bitset: making debug traces more useful

* lib/bitset.c (bitset_print): Print the bitset type in verbose mode.

4 years agobitset: comment changes
Akim Demaille [Sat, 14 Nov 2020 15:04:10 +0000 (16:04 +0100)]
bitset: comment changes

* lib/bitset.c: Move some documenting comments to...
* lib/bitset.h: here.
* lib/bitset/array.c: Fix some comments.

4 years agocareadlinkat: warn better about GCC bug 93644
Paul Eggert [Sat, 14 Nov 2020 18:27:50 +0000 (10:27 -0800)]
careadlinkat: warn better about GCC bug 93644

* lib/careadlinkat.c (readlink_stk): When --enable-gcc-warnings is
not in effect, use "#warning" to let builders know more clearly
about GCC bug 93644, because the bug triggers even if no -W option
is given to GCC.

4 years agoautoupdate
Karl Berry [Sat, 14 Nov 2020 15:42:21 +0000 (07:42 -0800)]
autoupdate

4 years agoautoupdate
Karl Berry [Fri, 13 Nov 2020 18:28:34 +0000 (10:28 -0800)]
autoupdate

4 years agoautoupdate
Karl Berry [Fri, 13 Nov 2020 18:26:32 +0000 (10:26 -0800)]
autoupdate

4 years agohard-locale-tests: avoid a -Wstrict-prototypes warning
Jim Meyering [Fri, 13 Nov 2020 15:34:28 +0000 (07:34 -0800)]
hard-locale-tests: avoid a -Wstrict-prototypes warning

* tests/locale.c (main): Placate gcc's -Wstrict-prototypes by
changing "main ()" to "main (void)". This was the only case that
triggered a warning when building grep with --enable-gcc-warnings.

4 years agotime_rz: simplify CVE-2017-7476 fix
Paul Eggert [Thu, 12 Nov 2020 03:20:42 +0000 (19:20 -0800)]
time_rz: simplify CVE-2017-7476 fix

* lib/time_rz.c: Do not include limits.h; I think it was included
under the mistaken impression that limits.h defines SIZE_MAX.
(SIZE_MAX): Remove.
(save_abbr): Put string length into a ptrdiff_t variable,
so that the size comparison works naturally.  This
fixes CVE-2017-7476 in a cleaner way.

4 years agoparse-datetime: streamline overflow checking
Paul Eggert [Thu, 12 Nov 2020 03:16:23 +0000 (19:16 -0800)]
parse-datetime: streamline overflow checking

When parse-datetime.y’s overflow code was written, INT_ADD_WRAPV
did not work for unsigned destinations, and since time_t might
be unsigned that meant it did not work for time_t destinations.
This limitation of INT_ADD_WRAPV has been fixed, so we can
now streamline parse-datetime.y a bit.
* lib/parse-datetime.y: Do not include limits.h, as LONG_MAX
has not been used for a while.
(yylex, parse_datetime2): Assume C99 declarations after statements.
(yyles): Use INT_SUBTRACT_WRAPV instead of an explicit comparison
to TYPE_MINIMUM.
(parse_datetime2): No need for time_overflow now that
INT_ADD_WRAPV works for unsigned results.

4 years agoparse-datetime-tests: port to Alpine Linux 3.12.1
Paul Eggert [Thu, 12 Nov 2020 03:08:27 +0000 (19:08 -0800)]
parse-datetime-tests: port to Alpine Linux 3.12.1

* tests/test-parse-datetime.c: Include errno.h for errno,
and unistd.h for _SC_TZNAME_MAX and sysconf.
(main): In the outlandishly-long time zone abbreviation test,
do not exceed TZNAME_MAX as this has undefined behavior,
and on Alpine Linux 3.12.1 it makes the test fail.

4 years agoautoupdate
Karl Berry [Wed, 11 Nov 2020 16:16:41 +0000 (08:16 -0800)]
autoupdate

4 years agomgetgroups: avoid warning with clang
Pádraig Brady [Mon, 9 Nov 2020 13:12:31 +0000 (13:12 +0000)]
mgetgroups: avoid warning with clang

* lib/mgetgroups.c: Xcode-12.1 identifies as GCC 4.2.1,
so disable -Wpointer-sign for all clang versions.

4 years agognulib-tool: Fix link error with 'version-etc' (regression 2020-05-29).
Bruno Haible [Sat, 7 Nov 2020 20:07:04 +0000 (21:07 +0100)]
gnulib-tool: Fix link error with 'version-etc' (regression 2020-05-29).

Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-11/msg00032.html>.

* gnulib-tool (func_emit_tests_Makefile_am): Add libtests.a to
LDADD a third time, after the second occurrence of ../lib/libgnu.a.
* pygnulib/GLEmiter.py (tests_Makefile_am): Likewise.

4 years agoautoupdate
Karl Berry [Sat, 7 Nov 2020 17:16:59 +0000 (09:16 -0800)]
autoupdate

4 years agotests: pacify Sun C 5.9
Paul Eggert [Wed, 4 Nov 2020 23:13:40 +0000 (15:13 -0800)]
tests: pacify Sun C 5.9

Without these changes, Sun C 5.9 (2009/11/22) issues complaints like
“"test-nl_langinfo-mt.c", line 75: warning: statement not reached”.
* tests/test-nl_langinfo-mt.c (thread1_func, thread2_func)
(thread3_func, thread4_func, thread5_func, thread6_func, threadN_func):
* tests/test-setlocale_null-mt-all.c (thread1_func, thread2_func):
* tests/test-setlocale_null-mt-one.c (thread1_func, thread2_func):
Remove unreachable ‘return NULL;’s.

4 years agotests: port better to XLC 12.01
Paul Eggert [Wed, 4 Nov 2020 22:51:38 +0000 (14:51 -0800)]
tests: port better to XLC 12.01

* tests/test-argmatch.c (CHECK): Do not use -1 as a subscript,
even in code that is not executed, as IBM XLC 12.01 complains "The
subscript -1 is less than zero."
* tests/test-stdint.c (verify_width): Pass an (unused) 3rd
argument to _GL_VERIFY, as ISO C requires.  Otherwise, IBM XLC
12.01 complains "The invocation of macro _GL_VERIFY contains fewer
arguments than are required by the macro definition."

4 years agoaligned-malloc: Use fixes from the new modules.
Bruno Haible [Wed, 4 Nov 2020 01:34:06 +0000 (02:34 +0100)]
aligned-malloc: Use fixes from the new modules.

* modules/aligned-malloc (Depends-on): Add posix_memalign,
aligned_alloc, memalign.
(configure.ac): Use AC_CHECK_FUNCS_ONCE.

4 years agoaligned_alloc: Add tests.
Bruno Haible [Wed, 4 Nov 2020 01:22:38 +0000 (02:22 +0100)]
aligned_alloc: Add tests.

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

4 years agoaligned_alloc: New module.
Bruno Haible [Wed, 4 Nov 2020 01:22:33 +0000 (02:22 +0100)]
aligned_alloc: New module.

* lib/stdlib.in.h (aligned_alloc): New declaration.
* lib/aligned_alloc.c: New file.
* m4/aligned_alloc.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether aligned_alloc is declared.
(gl_STDLIB_H_DEFAULTS): Initialize GNULIB_ALIGNED_ALLOC,
HAVE_ALIGNED_ALLOC, REPLACE_ALIGNED_ALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_ALIGNED_ALLOC,
HAVE_ALIGNED_ALLOC, REPLACE_ALIGNED_ALLOC.
* modules/aligned_alloc: New file.
* tests/test-stdlib-c++.cc (aligned_alloc): Check signature.
* doc/posix-functions/aligned_alloc.texi: Mention the new module and the
AIX bug.

4 years agoposix_memalign: Add tests.
Bruno Haible [Wed, 4 Nov 2020 01:19:12 +0000 (02:19 +0100)]
posix_memalign: Add tests.

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

4 years agoposix_memalign: New module.
Bruno Haible [Wed, 4 Nov 2020 01:19:08 +0000 (02:19 +0100)]
posix_memalign: New module.

* lib/stdlib.in.h (posix_memalign): New declaration.
* lib/posix_memalign.c: New file.
* m4/posix_memalign.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether posix_memalign is declared.
(gl_STDLIB_H_DEFAULTS): Initialize GNULIB_POSIX_MEMALIGN,
HAVE_POSIX_MEMALIGN, REPLACE_POSIX_MEMALIGN.
* modules/stdlib (Makefile.am): Substitute GNULIB_POSIX_MEMALIGN,
HAVE_POSIX_MEMALIGN, REPLACE_POSIX_MEMALIGN.
* modules/posix_memalign: New file.
* tests/test-stdlib-c++.cc (posix_memalign): Check signature.
* doc/posix-functions/posix_memalign.texi: Mention the new module and
the OpenBSD bug.

4 years agomemalign: Add tests.
Bruno Haible [Wed, 4 Nov 2020 01:12:22 +0000 (02:12 +0100)]
memalign: Add tests.

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

4 years agomemalign: New module.
Bruno Haible [Wed, 4 Nov 2020 01:12:15 +0000 (02:12 +0100)]
memalign: New module.

* modules/memalign: New file.
* doc/glibc-functions/memalign.texi: Mention the new module.

4 years agoverify tests: Fix crash with GCC (regression 2020-11-02).
Bruno Haible [Tue, 3 Nov 2020 16:15:21 +0000 (17:15 +0100)]
verify tests: Fix crash with GCC (regression 2020-11-02).

* tests/test-verify.c (main): Fix initializer of s.

4 years agomountlist: recognize more file system types as remote
Pádraig Brady [Tue, 27 Oct 2020 21:04:14 +0000 (21:04 +0000)]
mountlist: recognize more file system types as remote

Sync "remote" file systems from stat.c in coreutils.
Note we only consider file systems that do not use host:resource
mount source.  I.e. those that don't generally use a colon when
mounting, as that case is already considered.  Searching for
"<fstype> /etc/fstab" was informative for identifying these.
The full list of "remote" file systems in coreutils is currently:
  acfs afs ceph cifs coda fhgfs fuseblk fusectl
  gfs gfs2 gpfs ibrix k-afs lustre novell nfs nfsd
  ocfs2 panfs prl_fs smb smb2 snfs vboxsf vmhgfs vxfs
Note also we do not include virtual machine file systems,
as even though they're remote to the current kernel,
they are generally not distributed to separate hosts.

* lib/mountlist.c (ME_REMOTE): Sync previously unconsidered
"remote" file systems from stat.c in coreutils.

4 years agoverify tests: Fix -Wuninitialized warning (regression 2020-10-30)
Bernhard Voelker [Mon, 2 Nov 2020 01:10:49 +0000 (02:10 +0100)]
verify tests: Fix -Wuninitialized warning (regression 2020-10-30)

* tests/test-verify.c (main): Initialize state variable.
Reported by Bruno Haible for GCC 5.4.0.

4 years agodfa.h: support inclusion from C++
Paul Eggert [Mon, 2 Nov 2020 18:53:08 +0000 (10:53 -0800)]
dfa.h: support inclusion from C++

* lib/dfa.h: Allow multiple inclusion, and inclusion from
C++ code.  The latter was suggested by Arnold Robbins.

4 years agossfmalloc tests: Portability to Linux/PowerPC and Linux/SPARC.
Bruno Haible [Mon, 2 Nov 2020 00:37:02 +0000 (01:37 +0100)]
ssfmalloc tests: Portability to Linux/PowerPC and Linux/SPARC.

* tests/test-ssfmalloc.c: Include <limits.h>.
(PAGESIZE_MAX): Set to 65536 on Linux/PowerPC.

4 years agoverify tests: Fix compilation error with MSVC (regression 2020-10-30).
Bruno Haible [Mon, 2 Nov 2020 00:31:09 +0000 (01:31 +0100)]
verify tests: Fix compilation error with MSVC (regression 2020-10-30).

* tests/test-verify.c (test_assume_noreturn): Fix declaration.

4 years agodfa-tests: test for today's invalid-merge fix
Jim Meyering [Sun, 1 Nov 2020 15:39:49 +0000 (07:39 -0800)]
dfa-tests: test for today's invalid-merge fix

* tests/test-dfa-invalid-merge.sh: New file.
* modules/dfa-tests (Files): Add it.
(TESTS): Add it.

4 years agodfa: retain sequences of similar nodes in optimization
Norihiro Tanaka [Sun, 1 Nov 2020 07:31:38 +0000 (16:31 +0900)]
dfa: retain sequences of similar nodes in optimization

DFA was merging similar nodes when it should not.  For example,
it would convert a+a+a to a+a.  Now, a sequence of similar nodes
is not merged.

Problem reported by Gonzalo Padrino in https://bugs.gnu.org/44351

* lib/dfa.c (merge_nfa_state): Skip the follow for repetition in
optimization.

4 years agotest-dfa-match-aux.c: accept EREs, not BREs
Jim Meyering [Sun, 1 Nov 2020 16:57:23 +0000 (08:57 -0800)]
test-dfa-match-aux.c: accept EREs, not BREs

* tests/test-dfa-match-aux.c (main): Specify RE_SYNTAX_EGREP, not
RE_SYNTAX_GREP, so tests can use ERE syntax rather than BRE.

4 years agoverify tests: avoid -Wmissing-declarations warnings
Bernhard Voelker [Fri, 30 Oct 2020 01:46:44 +0000 (02:46 +0100)]
verify tests: avoid -Wmissing-declarations warnings

* tests/test-verify.c (test_assume_expressions): Add declaration.
(test_assume_optimization): Likewise.
(test_assume_noreturn): Likewise.
(main): Move down after all other definitions.  While at it, also
call test_assume_expressions and test_assume_optimization as a
runtime check.

4 years agosys_stat: update comments for S_IRWXUGO, S_IXUGO
Paul Eggert [Mon, 26 Oct 2020 23:52:23 +0000 (16:52 -0700)]
sys_stat: update comments for S_IRWXUGO, S_IXUGO

* lib/sys_stat.in.h (S_IXUGO, S_IRWXUGO): Update comments.
Perhaps these macros should be removed, as they’re not in either
POSIX or GNU.  They could be moved to stat-macros.h, which would
be cleaner in some sense.

4 years agossfmalloc tests: Small tweaks.
Bruno Haible [Sun, 25 Oct 2020 17:18:06 +0000 (18:18 +0100)]
ssfmalloc tests: Small tweaks.

* tests/test-ssfmalloc.c: Add comments.
(alloc_pages): Don't require PROT_EXEC bits.
(block_sizes): Add more small sizes, for better coverage of
ssfmalloc-bitmap.h.

4 years agossfmalloc tests: Portability to Minix.
Bruno Haible [Sun, 25 Oct 2020 17:16:10 +0000 (18:16 +0100)]
ssfmalloc tests: Portability to Minix.

* modules/ssfmalloc-tests (Files): Add m4/mmap-anon.m4.
(configure.ac): Invoke gl_FUNC_MMAP_ANON.
* m4/mmap-anon.m4: Update comment.

4 years agossfmalloc: Portability to AIX.
Bruno Haible [Sun, 25 Oct 2020 17:14:09 +0000 (18:14 +0100)]
ssfmalloc: Portability to AIX.

* modules/ssfmalloc (Include): Add ssfmalloc.h.
(Link): New section.
* modules/ssfmalloc-tests (Makefile.am): Link test-ssfmalloc with
$(LIBTHREAD).

4 years agossfmalloc: Portability to Cygwin.
Bruno Haible [Sun, 25 Oct 2020 17:08:44 +0000 (18:08 +0100)]
ssfmalloc: Portability to Cygwin.

* lib/ssfmalloc.h: Add parameter PAGESIZE_MAX.
(pg_offset_t): Define depending on PAGESIZE_MAX.
* tests/test-ssfmalloc.c: Undefine PAGESIZE.
(PAGESIZE_MAX): New macro.

4 years agossfmalloc: Fix buffer overrun in bitmap search.
Bruno Haible [Sun, 25 Oct 2020 17:03:34 +0000 (18:03 +0100)]
ssfmalloc: Fix buffer overrun in bitmap search.

* lib/ssfmalloc-bitmap.h (find_first_packet_set): Don't access the
word *words_end.

4 years agoautoupdate
Karl Berry [Sun, 25 Oct 2020 14:05:29 +0000 (07:05 -0700)]
autoupdate

4 years agodoc: mention ‘restrict’ and C++
Paul Eggert [Sat, 24 Oct 2020 20:35:17 +0000 (13:35 -0700)]
doc: mention ‘restrict’ and C++

* doc/gnulib-readme.texi (C99 features assumed): Document
that ‘restrict’ should be avoided in C++ code.

4 years agoautoupdate
Karl Berry [Thu, 22 Oct 2020 15:59:02 +0000 (08:59 -0700)]
autoupdate

4 years agoselinux-at, selinux-h: port to SELinux 3.1
Bernhard Voelker [Mon, 19 Oct 2020 23:37:09 +0000 (16:37 -0700)]
selinux-at, selinux-h: port to SELinux 3.1

The new release finally deprecated the typedef 'security_context_t',
see <https://github.com/SELinuxProject/selinux/commit/7a124ca275>.
Use the simpler 'char *' instead.
* lib/getfilecon.c (getfilecon): Adjust type of context parameter.
(lgetfilecon): Likewise.
(fgetfilecon): Likewise.
(map_to_failure): Likewise.
(rpl_getfilecon): Likewise.
(rpl_lgetfilecon): Likewise.
(rpl_fgetfilecon): Likewise.
* lib/se-selinux.in.h (security_context_t): Remove typedef.
(getcon): Adjust type of context parameter.
(freecon): Likewise.
(getfscreatecon): Likewise.
(setfscreatecon): Likewise.
(matchpathcon): Likewise.
(getfilecon): Likewise.
(lgetfilecon): Likewise.
(fgetfilecon): Likewise.
(setfilecon): Likewise.
(lsetfilecon): Likewise.
(fsetfilecon): Likewise.
(security_check_context): Likewise.
(security_check_context_raw): Likewise.
(setexeccon): Likewise.
(security_compute_create): Likewise.
* lib/selinux-at.c (getfileconat): Likewise.
(lgetfileconat): Likewise.
(setfileconat): Likewise.
(lsetfileconat): Likewise.
* lib/selinux-at.h: Likewise.

4 years agoxalloc-die: Fix link error with Solaris cc (regression 2020-07-27).
Bruno Haible [Mon, 19 Oct 2020 23:12:51 +0000 (01:12 +0200)]
xalloc-die: Fix link error with Solaris cc (regression 2020-07-27).

* lib/xalloc.h (xalloc_die): Don't declare if GNULIB_XALLOC_DIE is 0.
(xmalloc, xzalloc, xcalloc, xrealloc, x2realloc, xmemdup, xstrdup,
XMALLOC, XNMALLOC, XZALLOC, XCALLOC, xnmalloc, xnrealloc, x2nrealloc,
xcharalloc): Don't declare/define if GNULIB_XALLOC is 0.
* modules/xalloc (configure.ac): Define GNULIB_XALLOC.
* modules/xalloc-die (configure.ac): Define GNULIB_XALLOC_DIE.

4 years agossfmalloc: Add tests.
Bruno Haible [Mon, 19 Oct 2020 02:04:18 +0000 (04:04 +0200)]
ssfmalloc: Add tests.

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

4 years agossfmalloc: New module.
Bruno Haible [Mon, 19 Oct 2020 02:03:09 +0000 (04:03 +0200)]
ssfmalloc: New module.

* lib/ssfmalloc.h: New file.
* lib/ssfmalloc-bitmap.h: New file.
* modules/ssfmalloc: New file.

4 years agowchar: Fix configure test result on some versions of AIX.
Bruno Haible [Sun, 18 Oct 2020 21:05:38 +0000 (23:05 +0200)]
wchar: Fix configure test result on some versions of AIX.

Reported by Clément Chigot <clement.chigot@atos.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00115.html>.

* m4/wchar_h.m4 (gl_WCHAR_H_INLINE_OK): Execute the test only on glibc
systems.

4 years agotime: Fix warning about asctime when asctime is not used.
Bruno Haible [Sun, 18 Oct 2020 18:42:56 +0000 (20:42 +0200)]
time: Fix warning about asctime when asctime is not used.

* lib/time.in.h (asctime_r, ctime, ctime_r): Fix _GL_WARN_ON_USE
invocation.

4 years ago*-list, *-oset, *-omap: Avoid a GCC warning (regression 2020-10-10).
Bruno Haible [Sun, 18 Oct 2020 13:10:23 +0000 (15:10 +0200)]
*-list, *-oset, *-omap: Avoid a GCC warning (regression 2020-10-10).

* lib/gl_anylinked_list2.h (gl_linked_iterator_free): Remove
'_GL_ATTRIBUTE_CONST'.
* lib/gl_anytree_list2.h (gl_tree_iterator_free): Likewise.
* lib/gl_anytree_omap.h (gl_tree_iterator_free): Likewise.
* lib/gl_anytree_oset.h (gl_tree_iterator_free): Likewise.
* lib/gl_array_list.c (gl_array_iterator_free): Likewise.
* lib/gl_array_omap.c (gl_array_iterator_free): Likewise.
* lib/gl_array_oset.c (gl_array_iterator_free): Likewise.
* lib/gl_carray_list.c (gl_carray_iterator_free): Likewise.

4 years agoobstack: Fix a clang warning.
Bruno Haible [Sun, 18 Oct 2020 12:37:13 +0000 (14:37 +0200)]
obstack: Fix a clang warning.

* lib/obstack.c (print_and_abort): Mark as __attribute_noreturn__.

4 years agohash: Rename hash_delete to hash_remove.
Bruno Haible [Sat, 17 Oct 2020 01:00:59 +0000 (03:00 +0200)]
hash: Rename hash_delete to hash_remove.

* lib/hash.h (hash_remove): Renamed from hash_delete.
(hash_delete): New declaration.
* lib/hash.c (hash_remove): Renamed from hash_delete.
(hash_delete): New function.
* tests/test-hash.c (main): Update.
* lib/fts-cycle.c (leave_dir): Likewise.
* NEWS: Mention the change.

4 years agohash, xhash: Make usable from C++.
Bruno Haible [Sat, 17 Oct 2020 01:00:35 +0000 (03:00 +0200)]
hash, xhash: Make usable from C++.

* lib/hash.h: Add extern "C".

4 years agohash, xhash: Move comments to the .h file.
Bruno Haible [Sat, 17 Oct 2020 00:59:46 +0000 (02:59 +0200)]
hash, xhash: Move comments to the .h file.

* lib/hash.c: Move comments meant for the user from here...
* lib/xhash.c: ... and here...
* lib/hash.h: ... to here.

4 years agoautoupdate
Karl Berry [Fri, 16 Oct 2020 15:55:59 +0000 (08:55 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Thu, 15 Oct 2020 16:14:07 +0000 (09:14 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Wed, 14 Oct 2020 15:26:45 +0000 (08:26 -0700)]
autoupdate

4 years agoDon't declare an intention to modify the return value of strerror.
Philipp Klaus Krause [Wed, 14 Oct 2020 01:04:27 +0000 (03:04 +0200)]
Don't declare an intention to modify the return value of strerror.

* tests/test-perror2.c (main): Assign the return value of strerror to a
'const char *' variable.

4 years ago*printf: Avoid "expanded before it was required" warning.
Bruno Haible [Sun, 11 Oct 2020 23:12:42 +0000 (01:12 +0200)]
*printf: Avoid "expanded before it was required" warning.

* m4/printf.m4 (gl_SNPRINTF_TRUNCATION_C99): Define through
AC_DEFUN_ONCE.

4 years agogetprogname: Add support for OpenServer 6 and UnixWare 7.
Benji Wiebe [Sun, 11 Oct 2020 19:14:43 +0000 (21:14 +0200)]
getprogname: Add support for OpenServer 6 and UnixWare 7.

* lib/getprogname.c: Include <fcntl.h>, <stdlib.h>, <string.h>.
(getprogname): On OpenServer6 and UnixWare, read /proc/<pid>/cmdline.

4 years agotests: Avoid a name clash on UnixWare.
Bruno Haible [Sun, 11 Oct 2020 18:48:49 +0000 (20:48 +0200)]
tests: Avoid a name clash on UnixWare.

Reported by Tim Rice <tim@multitalents.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00025.html>.

* tests/nap.h (nap): Define as gl_nap on OpenServer and UnixWare.

4 years agostdioext: Update comments regarding UnixWare.
Bruno Haible [Sun, 11 Oct 2020 14:45:49 +0000 (16:45 +0200)]
stdioext: Update comments regarding UnixWare.

Reported by Tim Rice <tim@multitalents.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00005.html>.

* lib/fbufmode.c: Update comments.
* lib/fflush.c: Likewise.
* lib/fpending.c: Likewise.
* lib/fpurge.c: Likewise.
* lib/freadable.h: Likewise.
* lib/freadable.c: Likewise.
* lib/freadahead.c: Likewise.
* lib/freading.h: Likewise.
* lib/freading.c: Likewise.
* lib/freadptr.c: Likewise.
* lib/freadseek.c: Likewise.
* lib/fseeko.c: Likewise.
* lib/fseterr.c: Likewise.
* lib/fwritable.h: Likewise.
* lib/fwritable.c: Likewise.
* lib/fwriting.h: Likewise.
* lib/fwriting.c: Likewise.

4 years agostdioext: Treat OpenServer 6 and UnixWare 7 like OpenServer 5.
Bruno Haible [Sun, 11 Oct 2020 14:20:30 +0000 (16:20 +0200)]
stdioext: Treat OpenServer 6 and UnixWare 7 like OpenServer 5.

Reported Tim Rice <tim@multitalents.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00005.html>.
Uses the info from
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00028.html>.

* lib/stdio-impl.h: Test also __SCO_VERSION__ and __sysv5__.

4 years agostdioext: Avoid compilation errors on UnixWare 7.
Bruno Haible [Sun, 11 Oct 2020 13:24:52 +0000 (15:24 +0200)]
stdioext: Avoid compilation errors on UnixWare 7.

Reported by Tim Rice <tim@multitalents.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00127.html>.

* lib/fbufmode.c: Don't include <stdio_ext.h> if it does not exist.
* lib/fpurge.c: Likewise.
* lib/freadable.h: Likewise.
* lib/freading.h: Likewise.
* lib/fwritable.h: Likewise.
* lib/fwriting.h: Likewise.
* m4/fbufmode.m4 (gl_FUNC_FBUFMODE): Test whether <stdio_ext.h> exists.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
* m4/freadable.m4 (gl_FUNC_FREADABLE): Likewise.
* m4/freading.m4 (gl_FUNC_FREADING): Likewise.
* m4/fwritable.m4 (gl_FUNC_FWRITABLE): Likewise.
* m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise.

4 years agostdioext: Update comments regarding Cygwin.
Bruno Haible [Sun, 11 Oct 2020 12:43:20 +0000 (14:43 +0200)]
stdioext: Update comments regarding Cygwin.

* lib/fpending.c: Update comments.
* lib/fpurge.c: Likewise.
* lib/freadable.h: Likewise.
* lib/freadable.c: Likewise.
* lib/freading.h: Likewise.
* lib/freading.c: Likewise.
* lib/fwritable.h: Likewise.
* lib/fwritable.c: Likewise.
* lib/fwriting.h: Likewise.
* lib/fwriting.c: Likewise.

4 years agoFix "warning: implicit declaration of function 'pthread_sigmask'".
KO Myung-Hun [Sun, 11 Oct 2020 11:30:32 +0000 (13:30 +0200)]
Fix "warning: implicit declaration of function 'pthread_sigmask'".

* lib/signal.in.h [__KLIBC__]: Include <pthread.h>.
* lib/sys_select.in.h [__KLIBC__]: Do not include <signal.h>.

4 years ago*-list, *-oset, *-omap: Avoid possible compiler warnings.
Bruno Haible [Sat, 10 Oct 2020 20:52:22 +0000 (22:52 +0200)]
*-list, *-oset, *-omap: Avoid possible compiler warnings.

Reported by Marc Nieper-Wißkirchen in
<https://lists.gnu.org/r/bug-gnulib/2020-10/msg00025.html>.

* lib/gl_anylinked_list2.h (gl_linked_iterator,
gl_linked_iterator_from_to): Mark as 'pure'.
(gl_linked_iterator_free): Mark as 'const'.
* lib/gl_anytree_list2.h (gl_tree_size, gl_tree_node_value,
gl_tree_search_from_to, gl_tree_indexof_from_to, gl_tree_iterator,
gl_tree_iterator_from_to, gl_tree_sortedlist_search,
gl_tree_sortedlist_search_from_to, gl_tree_sortedlist_indexof,
gl_tree_sortedlist_indexof_from_to): Mark as 'pure'.
(gl_tree_iterator_free): Mark as 'const'.
* lib/gl_anytree_omap.h (gl_tree_size, gl_tree_iterator): Mark as
'pure'.
(gl_tree_iterator_free): Mark as 'const'.
* lib/gl_anytree_oset.h (gl_tree_size, gl_tree_next_node,
gl_tree_prev_node, gl_tree_iterator): Mark as 'pure'.
(gl_tree_iterator_free): Mark as 'const'.
* lib/gl_anytreehash_list1.h (node_position, compare_by_position,
compare_position_threshold): Mark as 'pure'.
* lib/gl_array_list.c (gl_array_size, gl_array_indexof_from_to,
gl_array_search_from_to, gl_array_iterator, gl_array_iterator_from_to,
gl_array_sortedlist_indexof_from_to, gl_array_sortedlist_indexof,
gl_array_sortedlist_search_from_to, gl_array_sortedlist_search): Mark as
'pure'.
(gl_array_iterator_free): Mark as 'const'.
* lib/gl_array_omap.c (gl_array_size, gl_array_indexof, gl_array_search,
gl_array_search_atleast, gl_array_iterator): Mark as 'pure'.
(gl_array_iterator_free): Mark as 'const'.
* lib/gl_array_oset.c (gl_array_size, gl_array_indexof, gl_array_search,
gl_array_indexof_atleast, gl_array_search_atleast, gl_array_iterator,
gl_array_iterator_atleast): Mark as 'pure'.
(gl_array_iterator_free): Mark as 'const'.
* lib/gl_carray_list.c (gl_carray_size, gl_carray_node_value,
gl_carray_next_node, gl_carray_previous_node, gl_carray_get_at,
gl_carray_indexof_from_to, gl_carray_search_from_to, gl_carray_iterator,
gl_carray_iterator_from_to, gl_carray_sortedlist_indexof_from_to,
gl_carray_sortedlist_indexof, gl_carray_sortedlist_search_from_to,
gl_carray_sortedlist_search): Mark as 'pure'.
(gl_carray_iterator_free): Mark as 'const'.

4 years agorbtree-list: Avoid possible compiler warnings.
Bruno Haible [Sat, 10 Oct 2020 20:17:15 +0000 (22:17 +0200)]
rbtree-list: Avoid possible compiler warnings.

This mirrors the change of avltree-list on 2014-09-16.

* lib/gl_rbtree_list.c (gl_rbtree_list_check_invariants): Add extern
declaration. Add cast to void for ignored value of check_invariants.

4 years agostack: New module.
Marc Nieper-Wißkirchen [Sat, 10 Oct 2020 20:21:25 +0000 (22:21 +0200)]
stack: New module.

* MODULES.html.sh: Add entry for the stack module.
* modules/stack: New file.
* modules/stack-tests: New file.
* lib/stack.h: New file.
* tests/test-stack.c: New file.

4 years agoattribute: improve const, pure doc
Paul Eggert [Sat, 10 Oct 2020 18:48:16 +0000 (11:48 -0700)]
attribute: improve const, pure doc

Problem reported by Marc Nieper-Wißkirchen in:
https://lists.gnu.org/r/bug-gnulib/2020-10/msg00035.html
* lib/attribute.h (ATTRIBUTE_CONST, ATTRIBUTE_PURE): Improv doc.  See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51971#c1

4 years agothread: pacify GCC on Solaris 10
Paul Eggert [Mon, 5 Oct 2020 18:04:33 +0000 (11:04 -0700)]
thread: pacify GCC on Solaris 10

Problem reported by Kiyoshi KANAZAWA for grep (Bug#43666#29).
* lib/glthread/thread.h (gl_thread_self): Use ‘(pthread_t) 0’
instead of ‘(pthread_t) NULL’, to pacify GCC on Solaris 10
where pthread_t is unsigned int.

4 years agoc-stack: avoid AS_IF
Paul Eggert [Mon, 5 Oct 2020 01:46:44 +0000 (18:46 -0700)]
c-stack: avoid AS_IF

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-10/msg00018.html
* m4/c-stack.m4 (gl_PREREQ_C_STACK): No need for AS_IF.

4 years agoc-stack: pacify GCC 9.3.1 when using libsigsegv
Paul Eggert [Mon, 5 Oct 2020 01:12:50 +0000 (18:12 -0700)]
c-stack: pacify GCC 9.3.1 when using libsigsegv

* lib/c-stack.c [USE_LIBSIGSEGV]: Disable --suggest-attribute=pure.

4 years agolocalename: Fix a couple of "unused parameter" warnings.
Bruno Haible [Sun, 4 Oct 2020 22:02:27 +0000 (00:02 +0200)]
localename: Fix a couple of "unused parameter" warnings.

Reported by Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00014.html>.

* lib/localename.c (gl_locale_name_thread_unsafe, gl_locale_name_thread,
gl_locale_name_posix, gl_locale_name_environ): Add _GL_UNUSED in
parameter list.

4 years agovasnprintf: Don't use %n on modern, ISO C 99 compliant platforms.
Bruno Haible [Sun, 4 Oct 2020 13:59:26 +0000 (15:59 +0200)]
vasnprintf: Don't use %n on modern, ISO C 99 compliant platforms.

Suggested by Jeremie Courreges-Anglas <jca@wxcvbn.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00010.html>.

* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF): Define
HAVE_SNPRINTF_TRUNCATION_C99.
* lib/vasnprintf.c (VASNPRINTF): Don't use %n if
HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99.

4 years agoc-stack: streamline Solaris configuration
Paul Eggert [Sat, 3 Oct 2020 19:51:08 +0000 (12:51 -0700)]
c-stack: streamline Solaris configuration

* lib/c-stack.c: Omit mention of HAVE_SIGALTSTACK, since
the code is used only if a test for sigaltstack worked
in some other way.
* m4/c-stack.m4 (gl_PREREQ_C_STACK): Do not require gl_LIBSIGSEGV;
instead, execute gl_LIBSIGSEGV only if needed (because the XSI
heuristic does not work).
* modules/c-stack (Files): Add m4/libsigsegv.m4, since
we no longer require the libsigsegv module.
(Depends-on): Depend on havelib, not libsigsegv.

4 years agoc-stack: stop using SIGSTKSZ
Paul Eggert [Wed, 30 Sep 2020 20:50:36 +0000 (13:50 -0700)]
c-stack: stop using SIGSTKSZ

It’s been proposed to stop making SIGSTKSZ an integer constant:
https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html
Also, using SIGSTKSZ in #if did not conform to current POSIX.
Also, avoiding SIGSTKSZ makes the code simpler and easier to grok.
* lib/c-stack.c (SIGSTKSZ): Remove.
(alternate_signal_stack): Now a 64 KiB array, for simplicity.
All uses changed.

4 years agoc-stack: fix libsigsegv typo
Paul Eggert [Tue, 29 Sep 2020 21:11:22 +0000 (14:11 -0700)]
c-stack: fix libsigsegv typo

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-09/msg00175.html
* lib/c-stack.c (USE_LIBSIGSEGV): Fix typo that caused libsigsegv
to be used only on Solaris (exactly where it is not needed!).

4 years agoMODULES.html.sh: Fix typo.
Thien-Thi Nguyen [Sat, 3 Oct 2020 13:36:04 +0000 (15:36 +0200)]
MODULES.html.sh: Fix typo.

* MODULES.html.sh (Numeric conversion functions <stdlib.h>): Fix typo.

4 years agoversion-etc: pacify Oracle Studio 12.6
Paul Eggert [Mon, 28 Sep 2020 08:18:49 +0000 (01:18 -0700)]
version-etc: pacify Oracle Studio 12.6

Without this patch, it complains: "version-etc.h", line 64:
warning: token-less macro argument (E_TOKENLESS_MACRO)" when in
pedantic mode.
* lib/version-etc.h (version_etc): Port to C89 macro rules.

4 years agoAvoid "warning: The macro `AC_DECL_SYS_SIGLIST' is obsolete".
Bruno Haible [Sun, 27 Sep 2020 22:49:20 +0000 (00:49 +0200)]
Avoid "warning: The macro `AC_DECL_SYS_SIGLIST' is obsolete".

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00154.html>.

* m4/strsignal.m4 (gl_PREREQ_STRSIGNAL): Check for sys_siglist
ourselves; don't use AC_DECL_SYS_SIGLIST.

4 years agoAvoid "warning: The macro `_AC_COMPUTE_INT' is obsolete".
Bruno Haible [Sun, 27 Sep 2020 22:39:54 +0000 (00:39 +0200)]
Avoid "warning: The macro `_AC_COMPUTE_INT' is obsolete".

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00154.html>.

* m4/gethostname.m4 (gl_PREREQ_HOST_NAME_MAX): Use AC_COMPUTE_INT
instead of _AC_COMPUTE_INT.

4 years agoAvoid "warning: The macro `AC_HEADER_STDC' is obsolete".
Bruno Haible [Sun, 27 Sep 2020 22:27:43 +0000 (00:27 +0200)]
Avoid "warning: The macro `AC_HEADER_STDC' is obsolete".

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00154.html>.

Based on a patch by Paul Eggert.

* m4/malloc.m4 (_AC_FUNC_MALLOC_IF): Don't require AC_HEADER_STDC. Don't
test STDC_HEADERS. Assume <stdlib.h> exists.
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Likewise.

4 years agoEnable testing of prereleases of Autoconf 2.70.
Bruno Haible [Sun, 27 Sep 2020 22:15:38 +0000 (00:15 +0200)]
Enable testing of prereleases of Autoconf 2.70.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00160.html>.

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA): Test for Autoconf >= 2.69c, not
>= 2.70.
* m4/largefile.m4 (AC_SYS_LARGEFILE): Likewise.
* m4/pid_t.m4 (AC_TYPE_PID_T): Likewise.
* m4/sys_types_h.m4 (AC_HEADER_MAJOR): Likewise.

4 years agoAvoid "warning: The macro `AC_PROG_CC_STDC' is obsolete".
Bruno Haible [Sun, 27 Sep 2020 19:56:10 +0000 (21:56 +0200)]
Avoid "warning: The macro `AC_PROG_CC_STDC' is obsolete".

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00151.html>.

* m4/gnulib-common.m4 (gl_PROG_CC_C99): Use AC_PROG_CC_C99 or
AC_PROG_CC, depending on the Autoconf version.

4 years agoAvoid "warning: The macro `AC_HELP_STRING' is obsolete".
Gavin Smith [Sun, 27 Sep 2020 19:06:51 +0000 (21:06 +0200)]
Avoid "warning: The macro `AC_HELP_STRING' is obsolete".

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Use AS_HELP_STRING instead
of AC_HELP_STRING.
* m4/libgcrypt.m4 (AM_PATH_LIBGCRYPT): Likewise.

4 years agoAvoid "warning: $as_echo_n is obsolete" from autoconf 2.69c.
Bruno Haible [Sun, 27 Sep 2020 19:03:24 +0000 (21:03 +0200)]
Avoid "warning: $as_echo_n is obsolete" from autoconf 2.69c.

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00151.html>.
* m4/gnulib-common.m4 (gl_CACHE_VAL_SILENT): Use gl_SILENT.

4 years agoautoupdate
Karl Berry [Sun, 27 Sep 2020 14:38:08 +0000 (07:38 -0700)]
autoupdate

4 years agoextensions: Simplify last commit.
Bruno Haible [Sun, 27 Sep 2020 12:49:21 +0000 (14:49 +0200)]
extensions: Simplify last commit.

* m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Don't require
AC_GNU_SOURCE ever.

4 years agoextensions: require AC_GNU_SOURCE only for <=2.63
Paul Eggert [Sun, 27 Sep 2020 02:18:08 +0000 (19:18 -0700)]
extensions: require AC_GNU_SOURCE only for <=2.63

Problem reported by Gavin Smith in:
https://lists.gnu.org/r/autoconf/2020-09/msg00012.html
* m4/extensions.m4 ([gl_USE_SYSTEM_EXTENSIONS]):
Require AC_GNU_SOURCE only for Autoconf 2.63 and earlier, since it
shouldn’t be needed after that, and Autoconf 2.70 complains about
it being obsolete.

4 years agoregex-tests: Make test more robust.
Bruno Haible [Sat, 26 Sep 2020 13:57:08 +0000 (15:57 +0200)]
regex-tests: Make test more robust.

* tests/test-regex.c (main): Make sure to revert the locale to "C" after
the test in "tr_TR.UTF-8" locale. Exit if we can't revert it.

4 years agodfa: remove unused the member of structure
Norihiro Tanaka [Sat, 26 Sep 2020 00:50:01 +0000 (09:50 +0900)]
dfa: remove unused the member of structure

* lib/dfa.c (struct dfa): Remove unused member 'first_end'.

4 years agoregex-tests: fix possible Turkish false-alarm
Paul Eggert [Sat, 26 Sep 2020 02:00:53 +0000 (19:00 -0700)]
regex-tests: fix possible Turkish false-alarm

* modules/regex-tests (Depends-on): Add wctype-h.
* tests/test-regex.c: Include wctype.h.
(main): Check that ‘i’ uppercases to ‘İ’ in Turkish,
as the Turkish regex test assumes this.

4 years agoregex-tests: fix test and add debug output
Paul Eggert [Fri, 25 Sep 2020 23:02:36 +0000 (16:02 -0700)]
regex-tests: fix test and add debug output

Perhaps this will fix the recent grep test failure reported at:
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/199
At least, the debug output should help narrow down the failure.
* tests/test-regex.c: Include stdarg.h, stdio.h.
(exit_status): New var.
(report_error): New function.
(main): Use it to report failures to stdout instead of merely
exiting with some nonzero status.  The status info alone isn’t
enough to do remote debugging.  In the new tr_TR.UTF-8 test, clear
regex before calling re_compile_pattern, fixing a portability bug.

4 years agoregex: no longer match glibc
Paul Eggert [Fri, 25 Sep 2020 21:38:06 +0000 (14:38 -0700)]
regex: no longer match glibc

* config/srclist.txt: Comment out regex_internal.c for now.

4 years agoautoupdate
Karl Berry [Fri, 25 Sep 2020 15:03:18 +0000 (08:03 -0700)]
autoupdate

4 years agoregex: fix ignore-case Turkish bug
Paul Eggert [Thu, 24 Sep 2020 00:03:45 +0000 (17:03 -0700)]
regex: fix ignore-case Turkish bug

* lib/regex_internal.c (build_wcs_upper_buffer):
Do not assume that converting single-byte character to upper
yields a single-byte character.  This is not true for Turkish,
where towupper (L'i') yields L'İ', which is not single-byte.
* tests/test-regex.c (main): Test for this bug.

4 years agoregex: port to weird isascii platforms
Paul Eggert [Wed, 23 Sep 2020 23:45:16 +0000 (16:45 -0700)]
regex: port to weird isascii platforms

* lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version.