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

4 years agoperror, strerror_r: remove unportable tests
Paul Eggert [Fri, 28 Aug 2020 00:52:58 +0000 (17:52 -0700)]
perror, strerror_r: remove unportable tests

Problem reported by Florian Weimer in:
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
* tests/test-perror2.c (main):
* tests/test-strerror_r.c (main): Omit unportable tests.

4 years agostdint, wchar, wctype-h: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:27:21 +0000 (01:27 +0200)]
stdint, wchar, wctype-h: Change configure message.

* m4/wint_t.m4 (gt_TYPE_WINT_T): Say "checking whether wint_t is large
enough..." instead of "checking whether wint_t is too small...".

4 years agotime_rz: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:23:55 +0000 (01:23 +0200)]
time_rz: Change configure message.

* m4/time_rz.m4 (gl_TIME_RZ): Say "checking whether localtime works even
near extrema..." instead of "checking whether localtime loops forever
near extrema...".

4 years agostdint: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:21:27 +0000 (01:21 +0200)]
stdint: Change configure message.

* m4/stdint.m4 (gl_STDINT_H): Say "checking whether stdint.h works
without ISO C predefines..." instead of "checking whether stdint.h
predates C++11...".

4 years agosocketlib: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:09:20 +0000 (01:09 +0200)]
socketlib: Change configure message.

* m4/socketlib.m4 (gl_SOCKETLIB): Say "checking for WSAStartup..."
instead of "checking if we need to call WSAStartup in winsock2.h and
-lws2_32...".

4 years agoinclude_next: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:04:36 +0000 (01:04 +0200)]
include_next: Change configure message.

* m4/include_next.m4 (gl_INCLUDE_NEXT): Say "checking whether source
code line length is unlimited..." instead of "checking whether system
header files limit the line length...".

4 years agogetcwd: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:56:09 +0000 (00:56 +0200)]
getcwd: Change configure message.

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Say "checking
whether getcwd succeeds when 4k < cwd_length < 16k..." instead of
"checking whether getcwd aborts when 4k < cwd_length < 16k...".

4 years agochdir-long: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:49:28 +0000 (00:49 +0200)]
chdir-long: Change configure message.

* m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Say "checking whether this
system supports file names of any length..." instead of "checking
whether this system has an arbitrary file name length limit...".
Set gl_cv_have_unlimited_file_name_length instead of
gl_cv_have_arbitrary_file_name_length_limit.
* modules/chdir-long (Depends-on, configure.ac): Update accordingly.

4 years agoceill: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:47:22 +0000 (00:47 +0200)]
ceill: Change configure message.

* m4/ceill.m4 (gl_FUNC_CEILL): Say "checking whether ceill() works..."
instead of "checking whether ceill() breaks with small values...".

4 years agoiconv: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:42:22 +0000 (00:42 +0200)]
iconv: Change configure message.

* m4/iconv.m4 (AM_ICONV): Say "checking whether iconv is compatible
with its POSIX signature..." instead of "checking for iconv
declaration...". Remove K&R C support.

4 years ago* ChangeLog: Fix stray paren.
Paul Eggert [Wed, 26 Aug 2020 22:56:02 +0000 (15:56 -0700)]
* ChangeLog: Fix stray paren.

4 years agogetcwd: help the merge back into glibc
Paul Eggert [Wed, 26 Aug 2020 22:30:53 +0000 (15:30 -0700)]
getcwd: help the merge back into glibc

This patch was inspired by Adhemerval Zanella’s proposed glibc patches:
https://sourceware.org/pipermail/libc-alpha/2020-August/117294.html
The idea is to make it easier for Gnulib lib/getcwd.c to match
glibc io/getcwd-generic.c.
* lib/getcwd.c [_LIBC]: Do not include pathmax.h.
Include not-cancel.h.
(HAVE_OPENAT, D_INO_IN_DIRENT, HAVE_MSVC_INVALID_PARAMETER_HANDLER)
(HAVE_MINIMALLY_WORKING_GETCWD): Define for the _LIBC case.
(__getcwd, __lstat, __readdir) [!_LIBC]: Remove these macros.
(__close_nocancel_nostatus, __getcwd_generic, stat64, __fstat64)
(__fstatat64, __lstat64, __readdir64, __fdopendir, __openat)
(__rewinddir, __openat64, dirent64) [_LIBC]: New macros.
(__getcwd_generic): Rename from __getcwd.
Use the abovementioned macros for consistency with glibc.
(weak_alias): Remove.

4 years agoverify: Avoid warnings when assume(0) is used.
Bruno Haible [Tue, 25 Aug 2020 23:45:49 +0000 (01:45 +0200)]
verify: Avoid warnings when assume(0) is used.

Reported by Mattias Engdegård <mattiase@acm.org> via Paul Eggert in
<https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00838.html>.

* lib/verify.h (assume): Use __builtin_unreachable if the argument is
the constant 0.
* tests/test-verify.c (f): New function.
(state): New type.
(test_assume_expressions, test_assume_optimization,
test_assume_noreturn): New functions.

4 years agofstrcmp: Clarification regarding NOTE_ORDERED.
Bruno Haible [Tue, 25 Aug 2020 22:29:28 +0000 (00:29 +0200)]
fstrcmp: Clarification regarding NOTE_ORDERED.

* lib/fstrcmp.c (NOTE_ORDERED): Define to false.

4 years agodiffseq: new option NOTE_ORDERED
Paul Eggert [Mon, 24 Aug 2020 22:19:27 +0000 (15:19 -0700)]
diffseq: new option NOTE_ORDERED

Problem reported by Phil Sainty <https://bugs.gnu.org/42931>.
* NEWS: Mention this.
* lib/diffseq.h (NOTE_ORDERED): New macro.
(IF_LINT2): Remove; no longer needed.
(compareseq): If (!NOTE_ORDERED), recurse on the smaller
subproblem and iterate to do the larger.

4 years agoautoupdate
Karl Berry [Mon, 24 Aug 2020 14:24:52 +0000 (07:24 -0700)]
autoupdate

4 years agosys_types: let Autoconf 2.70 do pid_t
Paul Eggert [Mon, 24 Aug 2020 02:36:10 +0000 (19:36 -0700)]
sys_types: let Autoconf 2.70 do pid_t

* m4/pid_t.m4 (AC_TYPE_PID_T): Redefine this Autoconf macro
only for Autoconf versions 2.69 and earlier, since 2.70
will be fixed.

4 years agotests: Don't assume that pid_t fits in an 'int'.
Bruno Haible [Sun, 23 Aug 2020 23:22:49 +0000 (01:22 +0200)]
tests: Don't assume that pid_t fits in an 'int'.

* tests/test-nonblocking-pipe-main.c (main): Use type 'pid_t' instead
of 'int'.
* tests/test-nonblocking-socket-main.c (main): Likewise.

4 years agosys_types: Fix definition of pid_t on 64-bit MSVC.
Bruno Haible [Sun, 23 Aug 2020 23:19:18 +0000 (01:19 +0200)]
sys_types: Fix definition of pid_t on 64-bit MSVC.

* m4/pid_t.m4: New file.
* modules/sys_types (Files): Add it.
* modules/dirent (Files): Likewise.
* modules/fcntl-h (Files): Likewise.
* modules/sched (Files): Likewise.
* modules/signal-h (Files): Likewise.
* modules/spawn (Files): Likewise.
* modules/sys_stat (Files): Likewise.
* modules/sys_wait (Files): Likewise.
* modules/termios (Files): Likewise.
* modules/unistd (Files): Likewise.

4 years agointtypes: Fix {PRI,SCN}*PTR on 32-bit native Windows (regr. 2020-07-21).
Bruno Haible [Sun, 23 Aug 2020 22:29:41 +0000 (00:29 +0200)]
inttypes: Fix {PRI,SCN}*PTR on 32-bit native Windows (regr. 2020-07-21).

* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Fix syntax error in test
program.

4 years agointprops: be consistent about +X vs X+0
Paul Eggert [Sun, 23 Aug 2020 20:14:14 +0000 (13:14 -0700)]
intprops: be consistent about +X vs X+0

* lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify.

4 years agointprops: fix INT_MULTIPLY_WRAPV bit-field bug
Paul Eggert [Sun, 23 Aug 2020 20:14:13 +0000 (13:14 -0700)]
intprops: fix INT_MULTIPLY_WRAPV bit-field bug

The bug occurs when using INT_MULTIPLY_WRAPV (a, b, c) where B
is a bit-field, on older GCC or non-GCC compilers where we do
things ourselves instead of using __builtin_mul_overflow.
Without this fix, INT_MULTIPLY_WRAPV would not compile, due
to applying sizeof to a bit-field.
* lib/intprops.h (_GL_INT_MULTIPLY_RANGE_OVERFLOW):
Promote B before giving it to TYPE_WIDTH, in case B is a bit-field.

4 years agosupersede: Avoid a failure when writing to /dev/null in Solaris zones.
Bruno Haible [Sun, 23 Aug 2020 17:37:17 +0000 (19:37 +0200)]
supersede: Avoid a failure when writing to /dev/null in Solaris zones.

Reported by Jörg Sonnenberger <joerg@netbsd.org>
via Thomas Klausner <tk@giga.or.at> in
<https://pkgsrc.se/files.php?messageId=20200812233110.30230FB28@cvs.NetBSD.org>.

* lib/supersede.c (open_supersede): When opening an existing non-regular
file on Solaris, use O_CREAT although it should not be necessary.

4 years agoverify: Make assume work on bit field expressions (regr. 2020-08-22).
Bruno Haible [Sun, 23 Aug 2020 14:24:55 +0000 (16:24 +0200)]
verify: Make assume work on bit field expressions (regr. 2020-08-22).

Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00202.html>.

* lib/verify.h (assume): Use '_Bool' or 'bool' as type of the temporary
variable.

4 years agolibc-config: Improve comments.
Bruno Haible [Sun, 23 Aug 2020 13:45:48 +0000 (15:45 +0200)]
libc-config: Improve comments.

* lib/cdefs.h (__warndecl, __warnattr, __errordecl): Explain why we
cannot use clang's __diagnose_if__ here.

4 years agoverify: Do use __builtin_assume on clang.
Bruno Haible [Sat, 22 Aug 2020 22:52:39 +0000 (00:52 +0200)]
verify: Do use __builtin_assume on clang.

* lib/verify.h (assume): Use clang’s __builtin_assume, with a temporary
variable in a statement expression.

4 years agosig2str: Add more signals.
Bruno Haible [Sat, 22 Aug 2020 22:50:41 +0000 (00:50 +0200)]
sig2str: Add more signals.

* lib/sig2str.c (numname_table): Add SIGCPUFAIL, SIGTHR, SIGBREAK.

4 years agodoc: Update for OpenBSD 6.0, 6.7.
Bruno Haible [Sat, 22 Aug 2020 22:44:24 +0000 (00:44 +0200)]
doc: Update for OpenBSD 6.0, 6.7.

* doc/*/*.texi: Update.
* m4/printf.m4: Update comments and cross-compilation guesses.
* m4/ceill.m4: Update comments.
* m4/getcwd-abort-bug.m4: Likewise.
* m4/ilogb.m4: Likewise.
* m4/ilogbf.m4: Likewise.
* m4/langinfo_h.m4: Likewise.
* m4/modf.m4: Likewise.
* m4/modff.m4: Likewise.

4 years agodoc: Mention sig2str module.
Bruno Haible [Sat, 22 Aug 2020 15:52:06 +0000 (17:52 +0200)]
doc: Mention sig2str module.

* doc/glibc-functions/sigabbrev_np.texi: Mention the sig2str module.

4 years agosigdescr_np: Add tests.
Bruno Haible [Sat, 22 Aug 2020 00:23:49 +0000 (02:23 +0200)]
sigdescr_np: Add tests.

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

4 years agosigdescr_np: New module.
Bruno Haible [Sat, 22 Aug 2020 00:22:05 +0000 (02:22 +0200)]
sigdescr_np: New module.

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

4 years agosigabbrev_np: Add tests.
Bruno Haible [Thu, 20 Aug 2020 22:55:43 +0000 (00:55 +0200)]
sigabbrev_np: Add tests.

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

4 years agosigabbrev_np: New module.
Bruno Haible [Thu, 20 Aug 2020 22:54:18 +0000 (00:54 +0200)]
sigabbrev_np: New module.

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

4 years agostdalign tests: Skip test with AIX xlclang.
Bruno Haible [Thu, 20 Aug 2020 22:43:57 +0000 (00:43 +0200)]
stdalign tests: Skip test with AIX xlclang.

* tests/test-stdalign.c (main): Skip alignas tests with AIX xlclang.

4 years agostdalign: Fix test failures on 32-bit platforms with clang versions < 8.
Bruno Haible [Thu, 20 Aug 2020 21:52:23 +0000 (23:52 +0200)]
stdalign: Fix test failures on 32-bit platforms with clang versions < 8.

* lib/stdalign.in.h (_Alignof): For clang versions < 8, use the same
workaround as for GCC versions < 4.9.

4 years ago; Update ChangeLog to match recent commits.
Paul Eggert [Thu, 20 Aug 2020 17:44:00 +0000 (10:44 -0700)]
; Update ChangeLog to match recent commits.

4 years agoSync up ProjectQuirks comments and documentation
Siddhesh Poyarekar [Thu, 20 Aug 2020 03:13:47 +0000 (08:43 +0530)]
Sync up ProjectQuirks comments and documentation

Transform the ProjectQuirks comments into a docstring so that it can
be accessed from python as ProjectQuirks.__doc__ and harmonize
descriptions with the documentation.

* build-aux/vcstocl/projectquirks.py (ProjectQuirks):
Transform comments into a docstring.
* doc/vcs-to-changelog.texi: Sync up description with
comments.

4 years agoSplit ProjectQuirks out into its own file
Siddhesh Poyarekar [Thu, 20 Aug 2020 03:13:46 +0000 (08:43 +0530)]
Split ProjectQuirks out into its own file

ProjectQuirks is used by external quirks files and importing it from
vcs-to-changelog.py is broken since it was renamed to use hyphens.  It
is cleaner to put it in its own file anyway.

* build-aux/vcstocl/projectquirks.py: A new file...
* build-aux/vcs-to-changelog.py (ProjectQuirks): ...to which
we move ProjectQuirks and import the file.

4 years agouchar: Fix compilation errors in C++ mode on macOS.
Bruno Haible [Wed, 19 Aug 2020 23:27:02 +0000 (01:27 +0200)]
uchar: Fix compilation errors in C++ mode on macOS.

* m4/uchar.m4 (gl_UCHAR_H): Require gl_ANSI_CXX if present. Include some
system header file before attempting to use 'char16_t' and 'char32_t'.

4 years agoansi-c++-opt: Work around an autoconf macro reordering problem.
Bruno Haible [Wed, 19 Aug 2020 22:42:05 +0000 (00:42 +0200)]
ansi-c++-opt: Work around an autoconf macro reordering problem.

* modules/ansi-c++-opt: Require gl_ANSI_CXX already in the early
section.

4 years agomath C++ tests: Fix compilation error in with GCC 10.
Bruno Haible [Wed, 19 Aug 2020 19:29:08 +0000 (21:29 +0200)]
math C++ tests: Fix compilation error in with GCC 10.

* lib/math.in.h (cbrt, ceil, copysign, exp2, expm1, floor, fma, fmod,
hypot, ilogb, log, log10, log1p, log2, logb, modf, remainder, rint,
round, trunc): Use _GL_CXXALIASWARN1 instead of _GL_CXXALIASWARN.

4 years agouchar: Fix compilation errors in C++ mode on OpenBSD.
Bruno Haible [Wed, 19 Aug 2020 18:40:20 +0000 (20:40 +0200)]
uchar: Fix compilation errors in C++ mode on OpenBSD.

* lib/uchar.in.h (char16_t, char32_t): Don't define in C++ mode if
CXX_HAS_UCHAR_TYPES is 1.
* m4/uchar.m4 (gl_UCHAR_H): Determine whether the C++ compiler
predefines char16_t and char32_t. Substitute CXX_HAS_UCHAR_TYPES.
* modules/uchar (Makefile.am): Substitute CXX_HAS_UCHAR_TYPES.

4 years agoFix compilation errors in C++ mode on OpenBSD.
Bruno Haible [Wed, 19 Aug 2020 08:39:59 +0000 (10:39 +0200)]
Fix compilation errors in C++ mode on OpenBSD.

* lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on
OpenBSD with clang, use the approach without C preprocessor macro.

4 years agouchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).
Bruno Haible [Wed, 19 Aug 2020 01:18:52 +0000 (03:18 +0200)]
uchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).

* modules/uchar-c++-tests (configure.ac): Don't use AC_LANG_PUSH and
AC_LANG_POP.

4 years agoautoupdate
Paul Eggert [Tue, 18 Aug 2020 22:32:14 +0000 (15:32 -0700)]
autoupdate

4 years agoverify: avoid __built_assume on Clang
Paul Eggert [Mon, 17 Aug 2020 21:47:45 +0000 (14:47 -0700)]
verify: avoid __built_assume on Clang

* lib/verify.h (assume): Do not use Clang’s __builtin_assume, as
Clang 9 incorrectly diagnoses arguments as having side effects
even when they do not.  I guess Clang 9 considers any function
call as if it had a side effect here.

4 years agolibc-config: avoid Clang’s __diagnose_if__
Paul Eggert [Mon, 17 Aug 2020 21:45:38 +0000 (14:45 -0700)]
libc-config: avoid Clang’s __diagnose_if__

* lib/cdefs.h (__warndecl, __warnattr, __errordecl):
For now, do not use __diagnose_if__ here, as this fails
on Fedora 31 with Clang 9.0.1, with diagnostic
"/usr/include/bits/stdio2.h:263:9: error: fgets called with bigger
size than length of destination buffer
[-Werror,-Wuser-defined-warnings]".  I guess Clang 9 warns even
for functions that are not called?