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

4 years agodfa: make dfasupported a global function
Norihiro Tanaka [Sun, 20 Sep 2020 07:00:04 +0000 (16:00 +0900)]
dfa: make dfasupported a global function

* lib/dfa.c (dfasupported): Rename, and make it global.
Update caller.
* lib/dfa.h (dfasupported): Add prototype.

4 years agocanonicalize: Add support for UNC file names on native Windows.
Bruno Haible [Sun, 20 Sep 2020 22:52:26 +0000 (00:52 +0200)]
canonicalize: Add support for UNC file names on native Windows.

Reported and initial patch by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?59079>.

* lib/canonicalize.c (canonicalize_filename_mode): For UNC file names,
extend the prefix to include the server.

4 years agosupersede: Fix test failures on native Windows.
Bruno Haible [Sun, 20 Sep 2020 22:51:54 +0000 (00:51 +0200)]
supersede: Fix test failures on native Windows.

* lib/supersede.c (open_supersede): Handle non-regular files on native
Windows like on Solaris.
* tests/test-supersede-open.h (test_open_supersede): Use O_BINARY flag.

4 years agotest-stdalign: test Oracle Studio better
Paul Eggert [Sun, 20 Sep 2020 22:42:43 +0000 (15:42 -0700)]
test-stdalign: test Oracle Studio better

* doc/posix-headers/stdalign.texi (stdalign.h):
* tests/test-stdalign.c (main):
Sun Studio Bug #2125432 seems to be fixed.

4 years agoc-stack: output diagnostic in single 'write'
Paul Eggert [Sun, 20 Sep 2020 19:52:15 +0000 (12:52 -0700)]
c-stack: output diagnostic in single 'write'

* lib/c-stack.c (die): In the typical case, use just one 'write'
syscall to output the diagnostic, as this lessens interleaving.
(die, c_stack_action): Assume C99.
* modules/c-stack (Depends-on): Add c99, mempcpy.

4 years agoc-stack: improve checking if !libsigsegv
Paul Eggert [Sun, 20 Sep 2020 18:48:17 +0000 (11:48 -0700)]
c-stack: improve checking if !libsigsegv

If SIGINFO_WORKS, do not treat a null pointer dereference as if it
were a stack overflow.  Use uintptr_t and INT_ADD_WRAPV to avoid
unlikely pointer overflow.  Also, fix some obsolete code and typos.
I found these problems while looking into this bug report:
https://lists.gnu.org/r/grep-devel/2020-09/msg00053.html
* lib/c-stack.c: Include c-stack.h first, to test interface.
Include inttypes.h for UINTPTR_MAX, stdbool.h, stddef.h for
max_align_t, intprops.h for INT_ADD_WRAPV.
(USE_LIBSIGSEGV): New macro; use it to simplify later code.
(SIGSTKSZ): Simplify setup.  Work around libsigsegv bug only
for libsigsegv 2.8 and earlier since the bug should be fixed
after that.
(alternate_signal_stack): Use max_align_t instead of doing it by hand.
(segv_handler, overflow_handler, segv_handler) [DEBUG]:
Assume sprintf returns byte count; this assumption is safe now.
(page_size): New static volatile variable, since sysconf isn’t
documented to be async-signal-safe on Solaris.  This variable is
present and used if (!USE_LIBSIGSEGV && HAVE_SIGALTSTACK &&
HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING &&
SIGINFO_WORKS).
(segv_handler): Use it if present.  Never report null pointer
dereference as a stack overflow.  Check for (unlikely) unsigned
and/or pointer overflow.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC):
Rename cache variables to gl_cv_sys_stack_overflow_works
and gl_cv_sys_xsi_stack_overflow_heuristic.
All uses changed.
(gl_PREREQ_C_STACK): Do not require AC_FUNC_ALLOCA, since
c-stack no longer uses STACK_DIRECTION.
Do not check for unistd.h, since we depend on unistd.
Fix shell typo ‘$"ac_cv_sys_xsi_stack_overflow_heuristic"’.
* modules/c-stack (Depends-on): Sort.  Add intprops, inttypes,
stdbool, stddef.

4 years agoRevert now-unnecessary override of config.guess on Alpine Linux 3.10.
Bruno Haible [Sun, 20 Sep 2020 18:40:50 +0000 (20:40 +0200)]
Revert now-unnecessary override of config.guess on Alpine Linux 3.10.

* m4/musl.m4: Revert 2020-09-19 patch.
* m4/setlocale_null.m4: Likewise.
* modules/setlocale-null: Likewise.

4 years agoautoupdate
Karl Berry [Sun, 20 Sep 2020 15:09:21 +0000 (08:09 -0700)]
autoupdate

4 years agorelocatable-prog: Fix for multiple relocatable library directories.
Ben Pfaff [Sun, 20 Sep 2020 14:44:29 +0000 (16:44 +0200)]
relocatable-prog: Fix for multiple relocatable library directories.

* build-aux/reloc-ldflags: Fix handling of multiple relocatable library
directories.  Each one needs its own -Wl,-rpath,$dir option, instead of
being attached to a single one.

4 years agotest-verify.c: avoid -Wshadow warnings
Jim Meyering [Sun, 20 Sep 2020 02:24:42 +0000 (19:24 -0700)]
test-verify.c: avoid -Wshadow warnings

* tests/test-verify.c (gx): Rename global from "x". Adjust use.
(enum): Capitalize member names. Adjust uses.

4 years agohavelib: Avoid linking with libc.a on GNU systems.
Bruno Haible [Sat, 19 Sep 2020 23:40:36 +0000 (01:40 +0200)]
havelib: Avoid linking with libc.a on GNU systems.

Reported by Bruce Dubbs <bruce.dubbs@gmail.com> in
<https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.

* m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): When processing the
dependency_libs value of a .la file, ignore '-lc' options on GNU
systems.

4 years agoFix recognition of musl libc on Alpine Linux 3.10.
Bruno Haible [Sat, 19 Sep 2020 13:08:43 +0000 (15:08 +0200)]
Fix recognition of musl libc on Alpine Linux 3.10.

Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00020.html>.

* m4/musl.m4 (gl_MUSL_CANONICAL_HOST): New macro.
(gl_MUSL_LIBC): Require it.
* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Likewise.
* modules/setlocale-null (Files): Add m4/musl.m4.

4 years agonl_langinfo: Make multithread-safe on Solaris 10 and Solaris 11.3.
Bruno Haible [Sat, 19 Sep 2020 10:37:14 +0000 (12:37 +0200)]
nl_langinfo: Make multithread-safe on Solaris 10 and Solaris 11.3.

Reported for Solaris 10 by Dagobert Michelsen via Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00023.html>
and for Solaris 11.3 by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/bug-grep/2020-06/msg00013.html>.

* lib/nl_langinfo-lock.c: New file, based on lib/setlocale_null-lock.c.
* lib/nl_langinfo.c: Include <stdlib.h> and <windows.h> or <pthread.h>
or <threads.h>.
(ITEMS, MAX_RESULT_LEN): New macros.
(nl_langinfo_unlocked): New function.
(gl_get_nl_langinfo_lock): New declaration.
(nl_langinfo_with_lock): New function, based on lib/setlocale_null.c.
(rpl_nl_langinfo): Use nl_langinfo_with_lock instead of nl_langinfo.
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Require gl_PTHREADLIB. Define
HAVE_THREADS_H. Set NL_LANGINFO_MTSAFE. If setting it to 0, also set
REPLACE_NL_LANGINFO.
(gl_PREREQ_NL_LANGINFO_LOCK): New macro.
* modules/nl_langinfo (Files): Add lib/nl_langinfo-lock.c,
lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4.
(configure.ac): Compile nl_langinfo-lock.c when NL_LANGINFO_MTSAFE is 0.
* doc/posix-functions/nl_langinfo.texi: Mention the Solaris bug.

4 years agofsusage, getaddrinfo: Produce more regular configure output.
Bruno Haible [Sat, 19 Sep 2020 00:00:38 +0000 (02:00 +0200)]
fsusage, getaddrinfo: Produce more regular configure output.

* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Remove AC_MSG_CHECKING without
corresponding AC_MSG_RESULT.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.

4 years agoAdd back gl_SILENT.
Bruno Haible [Fri, 18 Sep 2020 23:58:12 +0000 (01:58 +0200)]
Add back gl_SILENT.

* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): New macros.

4 years agoc-stack-tests: fix -fsanitize=undefined false alarm
Paul Eggert [Fri, 18 Sep 2020 17:33:02 +0000 (10:33 -0700)]
c-stack-tests: fix -fsanitize=undefined false alarm

* tests/test-c-stack2.sh: Skip the test-harness self-test
if ‘gcc -fsanitize=undefined’ is in use.

4 years agosignalblocking: simplify and remove gl_SILENT
Paul Eggert [Fri, 18 Sep 2020 02:16:07 +0000 (19:16 -0700)]
signalblocking: simplify and remove gl_SILENT

gl_SILENT was problematic because if a trap was sprung, stderr
generated during the trap was lost.  Avoid the problem by
removing the need for gl_SILENT.
* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): Remove.
* m4/signalblocking.m4 (gl_SIGNALBLOCKING):
Simplify, avoiding the need for gl_SILENT while preserving the
ability of the user to override the value of the cache variable,
now ac_cv_func_sigprocmask.

4 years agosigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25). Part 2.
Bruno Haible [Thu, 17 Sep 2020 21:02:51 +0000 (23:02 +0200)]
sigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25). Part 2.

4 years agosigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25).
Bruno Haible [Thu, 17 Sep 2020 20:52:00 +0000 (22:52 +0200)]
sigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25).

* m4/gnulib-common.m4 (GL_TMP_FD): New macro.
(gl_SILENT): Use 'exec', not a compound statement, to redirect
AS_MESSAGE_FD.

4 years agointprops, xalloc: avoid __builtin_mul_overflow_p with Clang
Paul Eggert [Thu, 17 Sep 2020 19:17:15 +0000 (12:17 -0700)]
intprops, xalloc: avoid __builtin_mul_overflow_p with Clang

Problem reported by Nelson H. F. Beebe for clang 9.0.1 in:
https://lists.gnu.org/r/grep-devel/2020-09/msg00028.html
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P) [__clang__]:
Define to 0.
* lib/xalloc-oversized.h (xalloc_oversized) [__clang__]:
Do not use __builtin_mul_overflow_p.

4 years agolibc-config: port __THROW to Ubuntu 4
Paul Eggert [Thu, 17 Sep 2020 16:45:21 +0000 (09:45 -0700)]
libc-config: port __THROW to Ubuntu 4

* lib/cdefs.h (__THROW): Do not use __attribute__ ((__nothrow__))
for GCC 3.3.  Problem reported by Jeffrey Walton in:
https://lists.gnu.org/r/bug-gnulib/2019-07/msg00058.html
The GCC 3.3.4 documentation says the attribute should work, but
apparently it does not work on Ubuntu 4’s GCC 3.3.  There seems
little point or desire to research this circa-2004 platform further,
so just avoid the attribute there.

4 years agotest-dfa-match.sh: port timeout work-around to newer Busybox
Jim Meyering [Thu, 17 Sep 2020 14:36:26 +0000 (07:36 -0700)]
test-dfa-match.sh: port timeout work-around to newer Busybox

* tests/test-dfa-match.sh: Update timeout -t portability test to
accommodate Busybox 1.30.0 and newer.

4 years agofnmatch: adjust to match glibc fix
Paul Eggert [Wed, 16 Sep 2020 22:40:20 +0000 (15:40 -0700)]
fnmatch: adjust to match glibc fix

This fixes handling of collating symbols in fnmatch (glibc bug 26620).
This does not affect Gnulib; it merely keeps Gnulib and glibc
closer together, to help with any eventual merge, by incorporating
a recent glibc patch.  The patch and the following commentary is
by Andreas Schwab.
* lib/fnmatch_loop.c (FCT) [WIDE_CHAR_VERSION]: The variable idx
contains the index into the extra array, whereas wextra points
into the extra array at this index, containing the length of the
following collating sequence in the wide character representation.

4 years agostat, fstat: Fix compilation error with old mingw headers.
Bruno Haible [Wed, 16 Sep 2020 21:52:44 +0000 (23:52 +0200)]
stat, fstat: Fix compilation error with old mingw headers.

Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00027.html>.

* lib/stat-w32.c (VOLUME_NAME_NONE): Define if the Windows headers don't
define it.

4 years agostat, fstat: Fix when compiling for versions older than Windows Vista.
Bruno Haible [Wed, 16 Sep 2020 21:51:52 +0000 (23:51 +0200)]
stat, fstat: Fix when compiling for versions older than Windows Vista.

Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00027.html>.

* lib/stat-w32.c: Include <sdkddkver.h>. Test the value of _WIN32_WINNT
that was originally set before we redefined it.
* m4/stat.m4 (gl_PREREQ_STAT_W32): New macro.
(gl_PREREQ_STAT): Require it.
* m4/fstat.m4 (gl_PREREQ_FSTAT): Likewise.

4 years agodfa: remove dfa-heap-overrun workaround
Paul Eggert [Tue, 15 Sep 2020 20:44:34 +0000 (13:44 -0700)]
dfa: remove dfa-heap-overrun workaround

* lib/dfa.c (reorder_tokens): Go back to a single pass that
both sets map[*] and does other things.  This reverts
2020-09-14T01:20:01Z!eggert@cs.ucla.edu, which is no longer
needed now that 2020-09-14T13:21:05Z!noritnk@kcn.ne.jp
fixed the underlying problem.

4 years agodfa: fix failure in removal of epsilon closure
Norihiro Tanaka [Mon, 14 Sep 2020 13:21:05 +0000 (22:21 +0900)]
dfa: fix failure in removal of epsilon closure

If there are a espilon in a branch and the closure is iterated, maybe fails
in removal of the node.  The bug is introduced in
commit da0e8454a8e68035ef4b87dbb9097f85df6ece27.

* lib/dfa.c (dfaanalyze): Calculate backward transition for not only
concatenation but closure.

4 years agodfa: avoid use of uninitialized constraint
Paul Eggert [Mon, 14 Sep 2020 01:40:08 +0000 (18:40 -0700)]
dfa: avoid use of uninitialized constraint

* lib/dfa.c (merge_nfa_state): Do not initialize the constraint
to zero here.
(dfaoptimize): Do it here instead, via xcalloc.  This prevents the
use of an uninitialized constraint by later code when ! (flags[i]
& OPT_QUEUED) means merge_nfa_state was not called to initialize
the constraint.  Problem found by running 'valgrind src/grep -E
'(^| )*(a|b)*(c|d)*( |$)' < /dev/null' on Ubuntu 18.04.5 x86-64.

4 years agodfa: assume C99 in reorder_tokens
Paul Eggert [Mon, 14 Sep 2020 01:27:07 +0000 (18:27 -0700)]
dfa: assume C99 in reorder_tokens

* lib/dfa.c (reorder_tokens): Assume C99 and simplify.

4 years agodfa: fix dfa-heap-overrun failure
Paul Eggert [Mon, 14 Sep 2020 01:20:01 +0000 (18:20 -0700)]
dfa: fix dfa-heap-overrun failure

* lib/dfa.c (reorder_tokens): When setting
map[d->follows[i].elems[j].index], instead of incorrectly assuming
that (i < d->follows[i].elems[j].index), use two loops, one to set
the map array and the other to use it.  The incorrect assumption
caused some elements to be missed, and this in turn caused grep's
dfa-heap-overrun test to fail on Solaris 10 sparc when compiled
with GCC.  I found this bug while investigating
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/183
and I think the bug also occurs on GNU/Linux but with more-subtle
symptoms.  The bug predates the recent dfa.c changes; perhaps the
recent changes make the bug more likely.

4 years agoparse-datetime: Make the build rule work with parallel 'make'.
Bruno Haible [Sun, 13 Sep 2020 20:03:16 +0000 (22:03 +0200)]
parse-datetime: Make the build rule work with parallel 'make'.

Reported by Daiki Ueno <ueno@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00036.html>.

* modules/parse-datetime (Makefile.am): Use a phony target and the
general idiom for rules that produce multiple files.

4 years agogetpass: Check for nonnull prompt argument while avoiding warnings.
Ben Pfaff [Sun, 13 Sep 2020 18:59:53 +0000 (20:59 +0200)]
getpass: Check for nonnull prompt argument while avoiding warnings.

The prompt parameter to getpass() is declared as nonnull (using a GCC
nonnull attribute).  Gnulib contains two implementations of this function,
one for POSIX, one for Windows.  The Windows implementation checked for
a nonnull prompt, which caused a GCC warning.  This commit fixes that by
avoiding the nonnull attribute when building getpass.c.  The POSIX
implementation did not check for a nonnull prompt.  This commit increases
the robustness by adding such a check.

* lib/getpass.c (_GL_ARG_NONNULL): Define to empty.
(getpass) [!_WIN32]: Print prompt only if nonnull.

4 years agodfa: epsilon-closure tweaks (Bug#40634)
Paul Eggert [Sun, 13 Sep 2020 01:51:55 +0000 (18:51 -0700)]
dfa: epsilon-closure tweaks (Bug#40634)

Rename BACKWORD to BACKWARD consistently.
* lib/dfa.c (struct dfa): Reorder members to reduce fragmentation.
(addtok_mb): Redo slightly to make it act more like a state machine.
Check depth only when it increases.
(epsclosure): Let the switch test the tokens.
(dfaanalyze): Cache tindex.  Simplify position loops.
Prefer xcalloc to xnmalloc + explicit zeroing.  Free BACKWARD
only if it is not null, since we're testing that anyway.
(dfaanalyze, build_state): Use merge2 instead of doing it by hand.

4 years agodfa: use backward set in removal of epsilon closure
Norihiro Tanaka [Sun, 13 Sep 2020 01:51:55 +0000 (18:51 -0700)]
dfa: use backward set in removal of epsilon closure

When removing in epsilon closure, the code searched all nodes
sequentially, and this was slow for some cases.  Build a backward
set before search, and only check previous position with the set.
Problem reported in <https://bugs.gnu.org/40634>.
* lib/dfa.c (struct dfa): New member 'epsilon'.
(addtok_mb): Check whether a pattern has epsilon node or not.
(epsclosure): New arg BACKWORD; caller changed.  When removing
epsilon node and reconnecting, check only previous positions.
Treat BEG as if it were character.
(dfaanalyze): Build backward set.

4 years agocanonicalize: fix pointer indexing bugs
Paul Eggert [Thu, 10 Sep 2020 21:25:51 +0000 (14:25 -0700)]
canonicalize: fix pointer indexing bugs

Problem reported by Florian Weimer in:
https://lists.gnu.org/r/bug-gnulib/2020-09/msg00025.html
* lib/canonicalize-lgpl.c (__realpath):
* lib/canonicalize.c (canonicalize_filename_mode):
Do not generate a pointer past the end of the array.
* lib/canonicalize.c (canonicalize_filename_mode):
Do not use a pointer after passing it to realloc.

4 years agotempname: help merge with glibc
Paul Eggert [Thu, 10 Sep 2020 06:59:18 +0000 (23:59 -0700)]
tempname: help merge with glibc

Inspired by draft patches by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-September/117501.html
https://sourceware.org/pipermail/libc-alpha/2020-September/117502.html
* lib/tempname.c: Include stdalign.h, time.h.
If _LIBC, do not include random-bits.h.
(__getrandom, __clock_gettime64, __timespec64) [!_LIBC]: New macros.
(RANDOM_BITS): Remove, replacing with ...
(random_bits): ... this new static function.  All uses changed.
Add entropy each time if getrandom is not supported.
(RANDOM_VALUE, BASE_62_DIGITS, BASE_62_POWER):
Assume 64-bit support a la C99.
(try_tempname_len): Take advantage of ASLR when initializing
random value.
* modules/tempname (Depends-on): Add clock-time, stdalign, time.

4 years agogetcwd: merge recent glibc changes
Paul Eggert [Thu, 10 Sep 2020 01:28:36 +0000 (18:28 -0700)]
getcwd: merge recent glibc changes

* lib/getcwd.c (GETCWD_RETURN_TYPE) [!_LIBC]: New macro.
(__getcwd, getcwd) [_LIBC && !GETCWD_RETURN_TYPE]: Add aliases.

4 years agoautoupdate
Karl Berry [Tue, 8 Sep 2020 15:26:28 +0000 (08:26 -0700)]
autoupdate

4 years agoattribute: Clarify which file to include.
Bruno Haible [Sun, 6 Sep 2020 23:17:23 +0000 (01:17 +0200)]
attribute: Clarify which file to include.

* modules/attribute (Include): Add "attribute.h".

4 years agopipe-filter-ii, pipe-filter-gi: Fix warnings on native Windows.
Bruno Haible [Sun, 6 Sep 2020 22:20:01 +0000 (00:20 +0200)]
pipe-filter-ii, pipe-filter-gi: Fix warnings on native Windows.

* lib/pipe-filter-ii.c: Include <process.h>.
* lib/pipe-filter-gi.c: Likewise.

4 years agoverify: avoid __builtin_assume
Paul Eggert [Sun, 6 Sep 2020 00:40:22 +0000 (17:40 -0700)]
verify: avoid __builtin_assume

Our latest attempt to use Clang’s __builtin_assume caused a crash
in GNU Emacs that we spent quite some time tracking down as being
caused by the switch to __builtin_assume.  It’s not known whether
the crash is due is a Clang bug or a portability bug in GNU Emacs.
For now, play it safe and avoid __builtin_assume.
* lib/verify.h (_GL_HAS_BUILTIN_ASSUME): Remove.
(assume): Simplify by not trying to use Clang’s __builtin_assume.

4 years agoFix several "warning: no previous prototype for function".
Bruno Haible [Sat, 5 Sep 2020 21:50:09 +0000 (23:50 +0200)]
Fix several "warning: no previous prototype for function".

* modules/unicase/locale-language (Makefile.am): Add a 'static' keyword
in front of the declaration of the lookup function in
unicase/locale-languages.h.
* modules/unictype/bidiclass-byname (Makefile.am): Likewise in
unictype/bidi_byname.h.
* modules/unictype/category-byname (Makefile.am): Likewise in
unictype/categ_byname.h.
* modules/unictype/combining-class-byname (Makefile.am): Likewise in
unictype/combiningclass_byname.h.
* modules/unictype/joininggroup-byname (Makefile.am): Likewise in
unictype/joininggroup_byname.h.
* modules/unictype/joiningtype-byname (Makefile.am): Likewise in
unictype/joiningtype_byname.h.
* modules/unictype/property-byname (Makefile.am): Likewise in
unictype/pr_byname.h.
* modules/unictype/scripts (Makefile.am): Likewise in
unictype/scripts_byname.h.
* modules/uninorm/composition (Makefile.am): Likewise in
uninorm/composition-table.h.

4 years agoselect: Fix "warning: no previous prototype for function".
Bruno Haible [Sat, 5 Sep 2020 21:45:47 +0000 (23:45 +0200)]
select: Fix "warning: no previous prototype for function".

* lib/select.c: Include <sys/select.h>.

4 years agoUse module 'c99' when needed for variadic macros with '...' syntax.
Bruno Haible [Sat, 5 Sep 2020 18:03:59 +0000 (20:03 +0200)]
Use module 'c99' when needed for variadic macros with '...' syntax.

* modules/crypto/sm3 (Depends-on): Add c99.

4 years agoUse module 'c99' when needed for subobject initializer syntax.
Bruno Haible [Sat, 5 Sep 2020 17:56:55 +0000 (19:56 +0200)]
Use module 'c99' when needed for subobject initializer syntax.

* modules/tempname (Depends-on): Add c99.
* modules/nstrftime-tests (Depends-on): Likewise.

4 years agoUse module 'c99' when needed for declaration-after-statement syntax.
Bruno Haible [Sat, 5 Sep 2020 16:35:24 +0000 (18:35 +0200)]
Use module 'c99' when needed for declaration-after-statement syntax.

* modules/backup-rename (Depends-on): Add c99.
* modules/backupfile (Depends-on): Likewise.
* modules/bitset-tests (Depends-on): Likewise.
* modules/bitsetv (Depends-on): Likewise.
* modules/c-strtod (Depends-on): Likewise.
* modules/c-strtold (Depends-on): Likewise.
* modules/clean-temp (Depends-on): Likewise.
* modules/copy-file (Depends-on): Likewise.
* modules/crypto/hmac-md5-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha1-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha256-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha512-tests (Depends-on): Likewise.
* modules/crypto/md5-buffer (Depends-on): Likewise.
* modules/crypto/md5-tests (Depends-on): Likewise.
* modules/crypto/sha1-buffer (Depends-on): Likewise.
* modules/crypto/sha1-tests (Depends-on): Likewise.
* modules/crypto/sha256-buffer (Depends-on): Likewise.
* modules/crypto/sha256-tests (Depends-on): Likewise.
* modules/crypto/sha512-buffer (Depends-on): Likewise.
* modules/crypto/sha512-tests (Depends-on): Likewise.
* modules/diffseq (Depends-on): Likewise.
* modules/fatal-signal (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fstrcmp (Depends-on): Likewise.
* modules/fsusage (Depends-on): Likewise.
* modules/fts (Depends-on): Likewise.
* modules/fts-tests (Depends-on): Likewise.
* modules/getumask (Depends-on): Likewise.
* modules/git-merge-changelog (Depends-on): Likewise.
* modules/hash-map (Depends-on): Likewise.
* modules/hash-set (Depends-on): Likewise.
* modules/lchmod (Depends-on): Likewise.
* modules/libgmp-tests (Depends-on): Likewise.
* modules/libtextstyle-optional-tests (Depends-on): Likewise.
* modules/linkedhash-map (Depends-on): Likewise.
* modules/linkedhash-set (Depends-on): Likewise.
* modules/long-options (Depends-on): Likewise.
* modules/mbrtoc32 (Depends-on): Likewise.
* modules/memchr2-tests (Depends-on): Likewise.
* modules/memmem-tests (Depends-on): Likewise.
* modules/memrchr-tests (Depends-on): Likewise.
* modules/mktime-internal (Depends-on): Likewise.
* modules/nstrftime (Depends-on): Likewise.
* modules/opendirat (Depends-on): Likewise.
* modules/parse-datetime (Depends-on): Likewise.
* modules/quotearg-simple-tests (Depends-on): Likewise.
* modules/same (Depends-on): Likewise.
* modules/supersede (Depends-on): Likewise.
* modules/supersede-tests (Depends-on): Likewise.
* modules/time_rz (Depends-on): Likewise.
* modules/unistr/u16-chr-tests (Depends-on): Likewise.
* modules/unistr/u32-chr-tests (Depends-on): Likewise.
* modules/unistr/u8-chr-tests (Depends-on): Likewise.
* modules/xalloc (Depends-on): Likewise.
* modules/xnanosleep (Depends-on): Likewise.

4 years agoFix "warning: array initialized from parenthesized string constant".
Bruno Haible [Sat, 5 Sep 2020 14:58:11 +0000 (16:58 +0200)]
Fix "warning: array initialized from parenthesized string constant".

* tests/test-memmem.c (main): Remove parentheses around string constant.
* tests/test-c-strcasestr.c (main): Likewise.
* tests/test-strcasestr.c (main): Likewise.

4 years agoargmatch tests: Fix ISO C compliance warning.
Bruno Haible [Sat, 5 Sep 2020 14:42:06 +0000 (16:42 +0200)]
argmatch tests: Fix ISO C compliance warning.

* tests/test-argmatch.c: Omit semicolon after ARGMATCH_DEFINE_GROUP
invocation.

4 years agouniname/uniname: Fix -Wshadow warning.
Bruno Haible [Sat, 5 Sep 2020 12:26:49 +0000 (14:26 +0200)]
uniname/uniname: Fix -Wshadow warning.

* lib/uniname/uniname.c (unicode_name_word): Don't declare i upfront.
* modules/uniname/uniname (Depends-on): Add c99.

4 years agouniname/uniname: Fix -Wshorten-64-to-32 warnings.
Bruno Haible [Sat, 5 Sep 2020 13:44:29 +0000 (15:44 +0200)]
uniname/uniname: Fix -Wshorten-64-to-32 warnings.

* lib/uniname/uniname.c (unicode_name_word_lookup): Change type of last
argument to size_t.
(unicode_name_character): Change type of len, n1, n2, n3, words_length,
n to size_t.

4 years agounistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.
Bruno Haible [Sat, 5 Sep 2020 13:24:53 +0000 (15:24 +0200)]
unistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.

* lib/unistr.in.h (u8_uctomb_aux, u8_uctomb, u16_uctomb_aux, u16_uctomb,
u32_uctomb): Change type of last argument to ptrdiff_t.
* lib/unistr/u8-uctomb.c (u8_uctomb): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* lib/unistr/u16-uctomb.c (u16_uctomb): Likewise.
* lib/unistr/u16-uctomb-aux.c (u16_uctomb_aux): Likewise.
* lib/unistr/u32-uctomb.c (u32_uctomb): Likewise.

4 years agomanywarnings: remove -Wchkp and -Wabi from C++ too
Paul Eggert [Tue, 1 Sep 2020 18:14:33 +0000 (11:14 -0700)]
manywarnings: remove -Wchkp and -Wabi from C++ too

Suggested by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2020-09/msg00001.html
At some point somebody should merge the many other manywarnings-c.m4
changes into manywarnings-c++.m4 too, e.g.,
2020-07-02T00:00:51Z!eggert@cs.ucla.edu.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
Remove -Wchkp, -Wabi.

4 years agostrerrorname_np: Add tests.
Bruno Haible [Sun, 30 Aug 2020 20:20:01 +0000 (22:20 +0200)]
strerrorname_np: Add tests.

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

4 years agostrerrorname_np: New module.
Bruno Haible [Sun, 30 Aug 2020 20:19:05 +0000 (22:19 +0200)]
strerrorname_np: New module.

* lib/string.in.h (strerrorname_np): New declaration.
* lib/strerrorname_np.c: New file.
* m4/strerrorname_np.m4: New file.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Test whether strerrorname_np
is declared.
(gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_STRERRORNAME_NP,
HAVE_STRERRORNAME_NP, REPLACE_STRERRORNAME_NP.
* modules/string (Makefile.am): Substitute GNULIB_STRERRORNAME_NP,
HAVE_STRERRORNAME_NP, REPLACE_STRERRORNAME_NP.
* modules/strerrorname_np: New file.
* tests/test-string-c++.cc: Verify the signature of strerrorname_np.
* doc/glibc-functions/strerrorname_np.texi: Mention the new module and
the glibc 2.32 bug.