]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agoscratch_buffer: Add comment.
Bruno Haible [Sat, 6 Mar 2021 23:27:13 +0000 (00:27 +0100)]
scratch_buffer: Add comment.

* lib/scratch_buffer.h: Add comment.

4 years agoparse-datetime2: fix licensing
Paul Eggert [Sat, 6 Mar 2021 16:23:48 +0000 (08:23 -0800)]
parse-datetime2: fix licensing

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-03/msg00017.html
* gnulib-tool (func_get_license): Treat parse-datetime2
(actually, anything starting with "parse-datetime")
like parse-datetime, as far as licenses go.

4 years agofree-posix: Update documentation.
Bruno Haible [Sat, 6 Mar 2021 12:49:52 +0000 (13:49 +0100)]
free-posix: Update documentation.

* doc/posix-functions/free.texi: Add platform details.

4 years agodoc: Update for glibc 2.33.
Bruno Haible [Sat, 6 Mar 2021 12:49:30 +0000 (13:49 +0100)]
doc: Update for glibc 2.33.

* doc/glibc-functions/mallinfo2.texi: New file.
* doc/gnulib.texi: Include it.
(Glibc sys/vtimes.h): Remove section.
* doc/glibc-functions/vtimes.texi: Remove file.
* doc/pastposix-functions/h_errno.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

4 years agostddef: Generalize tcc workaround to other compilers.
Bruno Haible [Thu, 4 Mar 2021 23:21:53 +0000 (00:21 +0100)]
stddef: Generalize tcc workaround to other compilers.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00027.html>.

* lib/stddef.in.h: Undefine the __need_* macros with all compilers.
* doc/posix-headers/stddef.texi: Mention that the TinyCC bug also exists
on macOS.

4 years agostdalign: port to tcc + glibc
Paul Eggert [Thu, 4 Mar 2021 08:47:19 +0000 (00:47 -0800)]
stdalign: port to tcc + glibc

* lib/stdalign.in.h (_Alignas): Do not define using __attribute__
if __attribute__ is defined as a macro, as __attribute__ surely a
no-op in that case and this is an area where __attribute__ cannot
simply be ignored.
* m4/stdalign.m4 (gl_STDALIGN_H): Include <stdint.h> so that
it #defines __attribute__(x) to nothing on glibc-based systems
when non-GNU-C-compatible compilers are used.
This exposes a bug in Tiny C Compiler 0.9.27’s implementation
of _Alignas on glibc platforms.

4 years agoasyncsafe-spin, simple-atomic: Add support for tcc/x86.
Bruno Haible [Thu, 4 Mar 2021 01:18:15 +0000 (02:18 +0100)]
asyncsafe-spin, simple-atomic: Add support for tcc/x86.

* lib/asyncsafe-spin.c (memory_barrier): With tcc/x86, don't use the
'mfence' instruction.
* lib/simple-atomic.c (memory_barrier): Likewise.

4 years agoasyncsafe-spin, simple-atomic: Add support for tcc.
Bruno Haible [Wed, 3 Mar 2021 12:32:41 +0000 (13:32 +0100)]
asyncsafe-spin, simple-atomic: Add support for tcc.

* lib/asyncsafe-spin.c (memory_barrier, atomic_compare_and_swap): On
i386 and x86_64, treat tcc like older GCC or clang.
* lib/simple-atomic.c (memory_barrier, atomic_compare_and_swap,
atomic_compare_and_swap_ptr): Likewise.

4 years agostddef: Work around an interoperability problem of tcc with glibc.
Bruno Haible [Wed, 3 Mar 2021 02:56:50 +0000 (03:56 +0100)]
stddef: Work around an interoperability problem of tcc with glibc.

Reported by Luca Saiu <positron@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00011.html>.

* lib/stddef.in.h [__TINYC__]: In case of the special invocation
convention, undefine the macros that TinyCC's <stddef.h> should undefine
but doesn't.
* doc/posix-headers/stddef.texi: Mention the TinyCC bug.

4 years agombrtowc: port to AIX 7.1 with xlc 12.1
Paul Eggert [Wed, 3 Mar 2021 00:27:39 +0000 (16:27 -0800)]
mbrtowc: port to AIX 7.1 with xlc 12.1

Fix a problem with locks when building GNU Tar (Savannah commit
55f2a0772e08b9febac3ac0de5cb048d4c60d2f5) on AIX 7.1 with IBM XL
C/C++ V12.1 using ‘./configure CC=xlc’.  The link fails due to
missing definitions of pthread_mutex_lock and
pthread_mutex_unlock.  GNU Tar uses unlocked-io and so
should not need to worry about multithreading or locks.
* lib/mbtowc-lock.h (mbtowc_with_lock) [USE_UNLOCKED_IO]:
Don’t bother with locks, since this app is single-threaded.
There may be similar linking problems with lib/nl_langinfo.c and
lib/setlocale_null.c but my GNU Tar build didn’t run into them, so
I left them alone for now.

4 years ago* modules/parse-datetime2: New file.
Paul Eggert [Mon, 1 Mar 2021 08:48:47 +0000 (00:48 -0800)]
* modules/parse-datetime2: New file.

4 years agounlocked-io: do not redefine getc_unlocked etc.
Paul Eggert [Mon, 1 Mar 2021 08:27:25 +0000 (00:27 -0800)]
unlocked-io: do not redefine getc_unlocked etc.

I ran into this problem on AIX 7.1 with GNU Tar, which
enables visibility of getc_unlocked etc. after testing
whether they’re declared, causing argp-namefrob.h and
unlocked-io.h to redefine the macros.
* lib/argp-namefrob.h, lib/unlocked-io.h:
(clearerr_unlocked, feof_unlocked ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unlocked): Do not define if already defined.

4 years agoparse-datetime2: new module
Paul Eggert [Mon, 1 Mar 2021 08:24:05 +0000 (00:24 -0800)]
parse-datetime2: new module

This splits the old parse-datetime into two parts; the
first is parse-datetime2 which supports all the new bells
and whistles, the second is parse-datetime, which reverts to
its original intent.  This avoids some bogus diagnostics
when build GNU Tar with gcc -flto -fanalyze and
with --enable-gcc-warnings.  And it slims down the
executable a bit.
* NEWS: Mention this.
* lib/parse-datetime.y (parser_control) [!GNULIB_PARSE_DATETIME2]:
Omit parse_datetime_debug member.
(debugging): New function.  Use it everywhere the old code
would load parse_datetime_debug.
(parse_datetime_body): New static function, with the body
of the old parse_datetime2.  Set pc.parse_datetime_debug
only if GNULIB_PARSE_DATETIME2.
(parse_datetime2, parse_datetime): Use this new function.
(parse_datetime2) [!GNULIB_PARSE_DATETIME2]: Remove.

4 years agostring-buffer: Fixes.
Bruno Haible [Sat, 27 Feb 2021 17:12:09 +0000 (18:12 +0100)]
string-buffer: Fixes.

* modules/string-buffer (License): Change to LGPL.
* tests/test-string-buffer.c (main): Add another sb_appendf call, that
is more likely to fail.

4 years agogitlog-to-changelog: output SHA in "empty commit message" warning
Bernhard Voelker [Wed, 24 Feb 2021 23:58:25 +0000 (00:58 +0100)]
gitlog-to-changelog: output SHA in "empty commit message" warning

* build-aux/gitlog-to-changelog: Add $sha to above warning diagnostic.

4 years agoglob: include libc-config.h only if needed
Paul Eggert [Wed, 24 Feb 2021 19:36:06 +0000 (11:36 -0800)]
glob: include libc-config.h only if needed

4 years agoglob: include libc-config.h in a more-standard way
Paul Eggert [Wed, 24 Feb 2021 18:52:59 +0000 (10:52 -0800)]
glob: include libc-config.h in a more-standard way

Inspired by Tom Tromey’s report for RHEL 6 in:
https://lists.gnu.org/r/bug-gnulib/2021-02/msg00088.html
* lib/glob.c [!_LIBC]: Include libc-config.h, not just config.h

4 years agoautoupdate
Karl Berry [Wed, 24 Feb 2021 17:40:33 +0000 (09:40 -0800)]
autoupdate

4 years agostring-buffer: Add tests.
Bruno Haible [Sun, 21 Feb 2021 20:41:53 +0000 (21:41 +0100)]
string-buffer: Add tests.

* tests/test-string-buffer.c: New file.
* modules/string-buffer-tests: New file.

4 years agostring-buffer: New module.
Bruno Haible [Sun, 21 Feb 2021 20:39:07 +0000 (21:39 +0100)]
string-buffer: New module.

* lib/string-buffer.h: New file.
* lib/string-buffer.c: New file.
* modules/string-buffer: New file.
* doc/posix-functions/open_memstream.texi: Mention the new module.

4 years agoscratch_buffer: Document the exported API.
Bruno Haible [Sun, 21 Feb 2021 18:32:36 +0000 (19:32 +0100)]
scratch_buffer: Document the exported API.

* lib/scratch_buffer.h: Add comments, taken from
lib/malloc/scratch_buffer.h.

4 years agoDEPENDENCIES: Update.
Bruno Haible [Sun, 21 Feb 2021 18:21:42 +0000 (19:21 +0100)]
DEPENDENCIES: Update.

* DEPENDENCIES: Require GCC >= 3.1. Tell where to find working GNU m4
tarballs. Mention awk. Point to pre-built packages for gettext, bison,
gperf, texinfo.

4 years agoparse-datetime: Fix comment.
Bruno Haible [Sat, 20 Feb 2021 13:13:17 +0000 (14:13 +0100)]
parse-datetime: Fix comment.

* modules/parse-datetime (Makefile.am): Fix comment.

4 years agopassfd: Fix test failure on FreeBSD >= 12 and NetBSD in 64-bit mode.
Bruno Haible [Wed, 17 Feb 2021 02:22:58 +0000 (03:22 +0100)]
passfd: Fix test failure on FreeBSD >= 12 and NetBSD in 64-bit mode.

* lib/passfd.c (recvfd): Use the CMSG_SPACE macro to compute the value
for msg_controllen.

4 years agoPort better to macOS Mojave
Paul Eggert [Tue, 16 Feb 2021 19:41:19 +0000 (11:41 -0800)]
Port better to macOS Mojave

Problem reported by Tom Shields in:
https://lists.gnu.org/r/bug-gnulib/2021-02/msg00064.html
* config/srclist.txt: Comment out dynarray_finalize.c.
* lib/dynarray.h (__libc_dynarray_at_failure): Don’t include
libc-config.h here, as that’s the includer’s responsibility.
* lib/malloc/dynarray_at_failure.c:
* lib/malloc/dynarray_emplace_enlarge.c:
* lib/malloc/dynarray_finalize.c:
* lib/malloc/dynarray_resize.c:
* lib/malloc/dynarray_resize_clear.c:
If _LIBC is not defined, include libc-config.h.

4 years agolinked-list test: Add test for SIGNAL_SAFE_LIST. (It currently fails.)
Bruno Haible [Tue, 16 Feb 2021 00:31:39 +0000 (01:31 +0100)]
linked-list test: Add test for SIGNAL_SAFE_LIST. (It currently fails.)

* tests/test-asyncsafe-linked_list.sh: New file.
* tests/test-asyncsafe-linked_list.c: New file.
* modules/linked-list-tests (Files): Add them.
(Depends-on): Add thread, yield, nanosleep, sigaction, sigprocmask.
(Makefile.am): Arrange to compile test-asyncsafe-linked_list.c and run
test-asyncsafe-linked_list.sh.

4 years agosimple-atomic: Add tests.
Bruno Haible [Mon, 15 Feb 2021 03:29:18 +0000 (04:29 +0100)]
simple-atomic: Add tests.

* tests/test-simple-atomic.c: New file.
* modules/simple-atomic-tests: New file.

4 years agosimple-atomic: New module.
Bruno Haible [Mon, 15 Feb 2021 03:25:38 +0000 (04:25 +0100)]
simple-atomic: New module.

* lib/simple-atomic.h: New file.
* lib/simple-atomic.c: New file, based on lib/asyncsafe-spin.c.
* modules/simple-atomic: New file.

4 years agoFix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX.
Bruno Haible [Mon, 15 Feb 2021 02:41:12 +0000 (03:41 +0100)]
Fix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI, gl_HOST_CPU_C_ABI_32BIT):
Test __LP64__ instead of _ARCH_PPC64.
* m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
* lib/stddef.in.h: Likewise.

4 years agoCorrect placement of last ChangeLog entry.
Bruno Haible [Mon, 15 Feb 2021 02:35:27 +0000 (03:35 +0100)]
Correct placement of last ChangeLog entry.

4 years agolib-symbol-visibility: Make it work with -Wmissing-prototypes.
Ozkan Sezer [Thu, 11 Feb 2021 15:39:56 +0000 (18:39 +0300)]
lib-symbol-visibility: Make it work with -Wmissing-prototypes.

* m4/visibility.m4 (gl_VISIBILITY): Avoid error from simultaneous use of
-Wmissing-prototypes and -Werror.

4 years agostddef: Fix test-stddef compilation error on MidnightBSD/x86.
Bruno Haible [Mon, 8 Feb 2021 22:18:34 +0000 (23:18 +0100)]
stddef: Fix test-stddef compilation error on MidnightBSD/x86.

* lib/stddef.in.h (_GL_STDDEF_ALIGNAS, rpl_max_align_t, max_align_t):
Don't ignore HAVE_MAX_ALIGN_T if the compiler is clang.

4 years agoDocument non-standard prototypes on MidnightBSD.
Bruno Haible [Mon, 8 Feb 2021 20:35:14 +0000 (21:35 +0100)]
Document non-standard prototypes on MidnightBSD.

* doc/posix-functions/initstate.texi: Mention different prototype on
MidnightBSD 2.0.
* doc/posix-functions/srandom.texi: Likewise.
* doc/posix-functions/getlogin_r.texi: Likewise.
* doc/glibc-functions/sethostname.texi: Likewise.

4 years agoposixtm tests: Fix warnings seen on MidnightBSD/x86.
Bruno Haible [Mon, 8 Feb 2021 20:32:22 +0000 (21:32 +0100)]
posixtm tests: Fix warnings seen on MidnightBSD/x86.

* tests/test-posixtm.c (main): Convert two 'time_t' values to 'long' for
printing.

4 years agoAdd cross-compilation guesses for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 20:33:13 +0000 (21:33 +0100)]
Add cross-compilation guesses for MidnightBSD.

* m4/malloc.m4 (_AC_FUNC_MALLOC_IF): When cross-compiling, use the
result from native compilation.
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Likewise.
* m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Likewise.
* m4/mprotect.m4 (gl_FUNC_MPROTECT_WORKS): Likewise.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_SECURE): Likewise.
* m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_INFINITE,
gl_PRINTF_INFINITE_LONG_DOUBLE, gl_PRINTF_DIRECTIVE_F,
gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_RETVAL_C99,
gl_SNPRINTF_DIRECTIVE_N, gl_VSNPRINTF_ZEROSIZE_C99): Likewise.
* m4/strfmon_l.m4 (gl_FUNC_STRFMON_L): Likewise.
* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Use predetermined
result on MidnightBSD.

4 years agothreadlib: Add support for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 19:26:12 +0000 (20:26 +0100)]
threadlib: Add support for MidnightBSD.

* m4/threadlib.m4 (gl_WEAK_SYMBOLS, gl_THREADLIB_BODY): On MidnightBSD,
use the same test as on FreeBSD.

4 years agohost-os: Add support for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 19:00:55 +0000 (20:00 +0100)]
host-os: Add support for MidnightBSD.

* m4/host-os.m4 (gl_HOST_OS): On MidnightBSD, set HOST_OPERATING_SYSTEM
to "MidnightBSD", not "Midnightbsd".

4 years agoc-stack: Adjust for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 18:55:47 +0000 (19:55 +0100)]
c-stack: Adjust for MidnightBSD.

* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): On MidnightBSD,
set FAULT_YIELDS_SIGBUS.

4 years agorelocatable-prog: Add support for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 18:31:02 +0000 (19:31 +0100)]
relocatable-prog: Add support for MidnightBSD.

* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Use the ELF $ORIGIN trick
also on MidnightBSD >= 1.1.
* build-aux/config.libpath: Treat MidnightBSD like FreeBSD.
* build-aux/reloc-ldflags: Likewise.

4 years agohavelib: Add support for MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 18:25:29 +0000 (19:25 +0100)]
havelib: Add support for MidnightBSD.

* build-aux/config.rpath: Treat MidnightBSD like FreeBSD >= 4.

4 years agowcwidth: Document MidnightBSD bug.
Bruno Haible [Sun, 7 Feb 2021 16:34:59 +0000 (17:34 +0100)]
wcwidth: Document MidnightBSD bug.

* doc/posix-functions/wcwidth.texi: Mention MidnightBSD as an affected
platform.
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Update comments.

4 years agopthread_sigmask: Document MidnightBSD bug.
Bruno Haible [Sun, 7 Feb 2021 16:31:24 +0000 (17:31 +0100)]
pthread_sigmask: Document MidnightBSD bug.

* doc/posix-functions/pthread_sigmask.texi: Mention MidnightBSD as an
affected platform.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Update
cross-compilation guess accordingly.

4 years agoimmutable: Avoid test failures on MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 16:24:32 +0000 (17:24 +0100)]
immutable: Avoid test failures on MidnightBSD.

* tests/test-immutable.c (install_segv_handler): On FreeBSD, install the
handler also for SIGBUS.

4 years agoc32is*: Avoid test failures on MidnightBSD.
Bruno Haible [Sun, 7 Feb 2021 16:17:29 +0000 (17:17 +0100)]
c32is*: Avoid test failures on MidnightBSD.

* tests/test-c32isalnum.c (main): On FreeBSD, disable tests that fail on
MidnightBSD 1.1.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isblank.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.

4 years agoregex: fix comment location
Paul Eggert [Sat, 6 Feb 2021 01:08:45 +0000 (17:08 -0800)]
regex: fix comment location

* lib/regexec.c (update_regs): Move comment.

4 years agoregex-tests: add bug 11053 test
Paul Eggert [Sat, 6 Feb 2021 01:08:39 +0000 (17:08 -0800)]
regex-tests: add bug 11053 test

* tests/test-regex.c (main): New test case for glibc bug 11053.

4 years agoregex: debug check for set member duplicates
Paul Eggert [Sat, 6 Feb 2021 01:08:29 +0000 (17:08 -0800)]
regex: debug check for set member duplicates

* lib/regex_internal.c (re_node_set_insert): Add a DEBUG_ASSERT
that would have caught some recently-fixed performance bugs
that caused sets to contain duplicate members.

4 years agoregex: fix longstanding backref match bug
Paul Eggert [Sat, 6 Feb 2021 01:08:10 +0000 (17:08 -0800)]
regex: fix longstanding backref match bug

This fixes a longstanding glibc bug concerning backreferences
<https://sourceware.org/11053> (2009-12-04).
* lib/regexec.c (proceed_next_node, push_fail_stack)
(pop_fail_stack): Push and pop the previous registers
as well as the current ones.  All callers changed.
(set_regs): Also pop if CUR_NODE has already been checked,
so that it does not get added as a duplicate set entry.
(update_regs): Fix comment location.
* tests/test-regex.c (tests): New constant.
(bug_regex11): New test function.
(main): Bump alarm value.  Call new test function.

4 years agoregex: avoid duplicate in espilon closure
Paul Eggert [Sat, 6 Feb 2021 00:35:46 +0000 (16:35 -0800)]
regex: avoid duplicate in espilon closure

* lib/regcomp.c (calc_eclosure_iter): Insert NODE into epsilon
closure first rather than last.  Otherwise, the epsilon closure
might contain a duplicate of NODE.

4 years agoregex-tests: fix typo
Paul Eggert [Sat, 6 Feb 2021 00:35:46 +0000 (16:35 -0800)]
regex-tests: fix typo

* tests/test-regex.c (main): Fix typo that would have caused an
old test case to report incorrect values on failure.

4 years agoregex: make it easier to merge into glibc
Paul Eggert [Sat, 6 Feb 2021 00:35:46 +0000 (16:35 -0800)]
regex: make it easier to merge into glibc

* lib/regex_internal.h [_LIBC]: Do not include Gnulib’s dynarray.h.

4 years agoregex: minor refactoring
Paul Eggert [Sat, 6 Feb 2021 00:35:45 +0000 (16:35 -0800)]
regex: minor refactoring

* lib/regexec.c (proceed_next_node): Use more-local decls.

4 years agoregex: avoid undefined behavior
Paul Eggert [Sat, 6 Feb 2021 00:35:45 +0000 (16:35 -0800)]
regex: avoid undefined behavior

* lib/regexec.c (pop_fail_stack): If the stack is empty, return -1
instead of indulging in undefined behavior.  This simplifies
callers, and avoids undefined behavior in some cases (see glibc
bug 11053, though this change does not fix that overall bug).

4 years agoregex: improve comments
Paul Eggert [Sat, 6 Feb 2021 00:35:45 +0000 (16:35 -0800)]
regex: improve comments

* lib/regexec.c: Add and correct comments about return values.

4 years agorelocatable-prog-wrapper: Tweak today's patch.
Bruno Haible [Sun, 31 Jan 2021 13:28:03 +0000 (14:28 +0100)]
relocatable-prog-wrapper: Tweak today's patch.

* build-aux/install-reloc (func_create_wrapper): Clean up free.o.

4 years agofmaf: Document QEMU bug
Bruno Haible [Sun, 31 Jan 2021 12:27:42 +0000 (13:27 +0100)]
fmaf: Document QEMU bug

* doc/posix-functions/fmaf.texi: Add note about QEMU bug.

4 years agoremainderl: Work around musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:21:24 +0000 (13:21 +0100)]
remainderl: Work around musl libc bug.

* doc/posix-functions/remainderl.texi: Document musl libc bug.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL_WORKS): Add more tests. Update
cross compilation guess.

4 years agolog2l: Work around musl libc bugs.
Bruno Haible [Sun, 31 Jan 2021 12:20:28 +0000 (13:20 +0100)]
log2l: Work around musl libc bugs.

* doc/posix-functions/log2l.texi: Document musl libc bugs.
* m4/log2l.m4 (gl_FUNC_LOG2L_WORKS): Add more tests. Update cross
compilation guess.

4 years agolog1pl: Work around musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:19:17 +0000 (13:19 +0100)]
log1pl: Work around musl libc bug.

* doc/posix-functions/log1pl.texi: Document musl libc bug.
* m4/log1pl.m4 (gl_FUNC_LOG1PL_WORKS): New macro.
(gl_FUNC_LOG1PL): Invoke it.

4 years agolog10l: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:16:30 +0000 (13:16 +0100)]
log10l: Document musl libc bug.

* doc/posix-functions/log10l.texi: Document musl libc bug.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Update comment and cross
compilation guess.

4 years agologl: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:15:38 +0000 (13:15 +0100)]
logl: Document musl libc bug.

* doc/posix-functions/logl.texi: Document musl libc bug.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Update comment and cross
compilation guess.

4 years agoexpm1l: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:14:29 +0000 (13:14 +0100)]
expm1l: Document musl libc bug.

* doc/posix-functions/expm1l.texi: Document musl libc bug.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Update comment and cross
compilation guess.

4 years agoexpl: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:10:58 +0000 (13:10 +0100)]
expl: Document musl libc bug.

* doc/posix-functions/expl.texi: Document musl libc bug.
* m4/expl.m4 (gl_FUNC_EXPL): Update comment and cross
compilation guess.

4 years agorelocatable-prog-wrapper: Update after recent changes.
Bruno Haible [Sun, 31 Jan 2021 11:42:47 +0000 (12:42 +0100)]
relocatable-prog-wrapper: Update after recent changes.

* lib/relocwrapper.c: Update comments.
* modules/relocatable-prog-wrapper (Files): Add lib/scratch_buffer.h,
lib/malloc/scratch_buffer*, lib/malloc.c, lib/realloc.c, lib/free.c,
lib/mempcpy.c, lib/rawmemchr.c, m4/lstat.m4. Remove lib/lstat.c.
(Depends-on): Add c99, eloop-threshold, fcntl-h, idx, intprops,
libc-config, stddef, sys_stat. Remove alloca-opt.
(configure.ac): Invoke gl_FUNC_MALLOC_POSIX, gl_FUNC_REALLOC_POSIX,
gl_FUNC_FREE, gl_FUNC_MEMPCPY, gl_FUNC_RAWMEMCHR.
* lib/canonicalize-lgpl.c (memmove): Undefine in the relocwrapper.
* build-aux/install-reloc (func_create_wrapper): Compile also
malloc/scratch_buffer_*.c, malloc.c, realloc.c, free.c, mempcpy.c,
rawmemchr.c. Don't compile lstat.c.

4 years agoMake it possible to compile rawmemchr.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:42:33 +0000 (12:42 +0100)]
Make it possible to compile rawmemchr.c separately, unconditionally.

* lib/rawmemchr.c: Don't define rawmemchr if not needed.

4 years agoMake it possible to compile mempcpy.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:42:21 +0000 (12:42 +0100)]
Make it possible to compile mempcpy.c separately, unconditionally.

* lib/mempcpy.c: Don't define mempcpy if not needed.

4 years agoMake it possible to compile free.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:41:33 +0000 (12:41 +0100)]
Make it possible to compile free.c separately, unconditionally.

* m4/free.m4 (gl_FUNC_FREE): Define HAVE_FREE_POSIX.
* lib/free.c: Don't define rpl_free if not needed.

4 years agoMake it possible to compile realloc.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:39:31 +0000 (12:39 +0100)]
Make it possible to compile realloc.c separately, unconditionally.

* modules/realloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/realloc.c: Don't define rpl_realloc if not needed.

4 years agoMake it possible to compile malloc.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:30:18 +0000 (12:30 +0100)]
Make it possible to compile malloc.c separately, unconditionally.

* modules/malloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/malloc.c: Don't define rpl_malloc if not needed.

4 years agocanonicalize-lgpl: Simplify.
Bruno Haible [Sun, 31 Jan 2021 11:35:45 +0000 (12:35 +0100)]
canonicalize-lgpl: Simplify.

* lib/canonicalize-lgpl.c (_GL_USE_STDLIB_ALLOC): Remove macro.

4 years agocanonicalize, canonicalize-lgpl: Straighten dependencies.
Bruno Haible [Sun, 31 Jan 2021 11:29:47 +0000 (12:29 +0100)]
canonicalize, canonicalize-lgpl: Straighten dependencies.

* modules/canonicalize-lgpl (Depends-on): Remove free-posix,
malloc-posix. Add unistd.
* modules/canonicalize (Depends-on): Remove free-posix, xalloc.
Add unistd.

4 years agoscratch_buffer: Fix dependencies.
Bruno Haible [Sat, 30 Jan 2021 15:16:04 +0000 (16:16 +0100)]
scratch_buffer: Fix dependencies.

* modules/scratch_buffer (Depends-on): Add malloc-posix, realloc-posix,
free-posix.

4 years agoautoupdate
Karl Berry [Fri, 29 Jan 2021 16:25:17 +0000 (08:25 -0800)]
autoupdate

4 years agodoc: More precise wording.
Bruno Haible [Tue, 26 Jan 2021 16:36:05 +0000 (17:36 +0100)]
doc: More precise wording.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00300.html>.

* doc/relocatable.texi (Enabling Relocatability): Talk about package
management systems in general.

4 years agodoc: Remove obsolete text.
Bruno Haible [Tue, 26 Jan 2021 16:24:09 +0000 (17:24 +0100)]
doc: Remove obsolete text.

Suggested by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00299.html>.

* doc/relocatable.texi (Enabling Relocatability): Stop mentioning an
issue of libtool 1.5.x.

4 years agoautoupdate
Karl Berry [Tue, 26 Jan 2021 15:50:36 +0000 (07:50 -0800)]
autoupdate

4 years agomaintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.
Simon Josefsson [Tue, 26 Jan 2021 15:24:54 +0000 (16:24 +0100)]
maintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.

* top/maint.mk (gnulib_dir): If $(srcdir)/gnulib doesn't exist,
fall back to $GNULIB_SRCDIR.

4 years agoposix_spawn_file_actions_* tests: Fix module dependencies.
Bruno Haible [Mon, 25 Jan 2021 09:12:51 +0000 (10:12 +0100)]
posix_spawn_file_actions_* tests: Fix module dependencies.

* modules/posix_spawn_file_actions_addclose-tests (Depends-on): Add
posix_spawn_file_actions_destroy.
* modules/posix_spawn_file_actions_addopen-tests (Depends-on): Likewise.
* modules/posix_spawn_file_actions_adddup2-tests (Depends-on): Likewise.
* modules/posix_spawn_file_actions_addchdir-tests (Depends-on):
Likewise.
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on):
Likewise.

4 years agoposix_spawn_file_actions_addclose: Relax configure test.
Bruno Haible [Mon, 25 Jan 2021 08:59:20 +0000 (09:59 +0100)]
posix_spawn_file_actions_addclose: Relax configure test.

* m4/posix_spawn.m4 (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE): Test a
negative file descriptor, not an out-of-range file descriptor.
* tests/test-posix_spawn_file_actions_addclose.c (main): Add comment.
* doc/posix-functions/posix_spawn_file_actions_addclose.texi: Update.

4 years agogetaddrinfo: Doc fix.
Simon Josefsson [Mon, 25 Jan 2021 07:51:29 +0000 (08:51 +0100)]
getaddrinfo: Doc fix.

* doc/posix-functions/getaddrinfo.texi (getaddrinfo): Gnulib does
not support IDN.

4 years agogetcwd: Fix cross-compilation guess for musl libc.
Bruno Haible [Sun, 24 Jan 2021 09:12:00 +0000 (10:12 +0100)]
getcwd: Fix cross-compilation guess for musl libc.

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Guess no also on
musl libc.
* doc/posix-functions/getcwd.texi: Update platform info.

4 years agoexpm1l: Fix configure test result with GCC 10 on powerpc64le.
Bruno Haible [Sun, 24 Jan 2021 08:03:05 +0000 (09:03 +0100)]
expm1l: Fix configure test result with GCC 10 on powerpc64le.

* m4/expm1l.m4 (gl_FUNC_EXPM1L): Change test to avoid GCC optimization.

4 years agoutime: Fix configure test (regression 2020-12-04).
Bruno Haible [Sat, 23 Jan 2021 21:10:25 +0000 (22:10 +0100)]
utime: Fix configure test (regression 2020-12-04).

Reported by Ryan Schmidt <wget@ryandesign.com> via Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00282.html>.

* m4/utime.m4 (gl_FUNC_UTIME): In the test program, include <utime.h>,
not <time.h>.

4 years agolibc-config: port to Xcode 7
Paul Eggert [Sat, 23 Jan 2021 18:19:24 +0000 (10:19 -0800)]
libc-config: port to Xcode 7

Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2021-01/msg01089.html
* lib/cdefs.h (__nonnull): If already defined but glibc is not in
use, override the definition with Gnulib’s _GL_ATTRIBUTE_NONNULL.
This is needed for Xcode 7, which has a ‘#define __nonnull
_Nonnull’ builtin for backwards-compatibility with an older Xcode
syntax that GNUish code never uses.

4 years agoexplicit_bzero: Add fallback for other compilers.
Bastien Roucariès [Sat, 23 Jan 2021 13:31:44 +0000 (14:31 +0100)]
explicit_bzero: Add fallback for other compilers.

* lib/explicit_bzero.c (explicit_bzero): For other compilers, invoke
memset through a volatile function pointer.

4 years agoexplicit_bzero: Add support for clang.
Bastien Roucariès [Sat, 23 Jan 2021 11:22:10 +0000 (11:22 +0000)]
explicit_bzero: Add support for clang.

* lib/explicit_bzero.c (explicit_bzero): Add a compiler barrier for
clang.

4 years agoPort FALLTHROUGH to clang 3.4 and earlier
Paul Eggert [Thu, 21 Jan 2021 21:40:16 +0000 (13:40 -0800)]
Port FALLTHROUGH to clang 3.4 and earlier

Problem reported by Akim Demaille in:
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html
* lib/cdefs.h (__glibc_has_attribute):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Do not trust __has_attribute in clang 3.4 and earlier, as
<https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html>
says that __has_attribute is unreliable in these old versions.

4 years agogc-random: Fix link error in tests.
Bruno Haible [Wed, 20 Jan 2021 20:44:36 +0000 (21:44 +0100)]
gc-random: Fix link error in tests.

* modules/crypto/gc-random (Link): New section.
* modules/crypto/gc-tests (Makefile.am): Link test-gc with
$(LIB_GETRANDOM).

4 years agogc-random: Replace implementation with call to getrandom.
Simon Josefsson [Wed, 20 Jan 2021 10:50:21 +0000 (11:50 +0100)]
gc-random: Replace implementation with call to getrandom.

* lib/gc-gnulib.c [GNULIB_GC_RANDOM]: Replace #include's with
those needed for getrandom.
(gc_init): Remove old randomness code.
(gc_done): Likewise.
(randomize): Rewrite using getrandom, inspired by getentropy.
* m4/gc-random.m4: Remove file.
* modules/crypto/gc-random: Drop gc-random.m4, gl_GC_RANDOM, and
LIB_GC_RANDOM.  Add conditional dependency on getrandom.
* modules/crypto/gc-tests (test_gc_LDADD): Drop LIB_GC_RANDOM.

4 years agoexec*e tests: Avoid test failures on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 08:39:55 +0000 (09:39 +0100)]
exec*e tests: Avoid test failures on Cygwin.

* tests/test-execle-main.c (main): On Cygwin, add /bin to the new PATH.
* tests/test-execve-main.c (main): Likewise.
* tests/test-execvpe-main.c (main): Likewise.

4 years agocanonicalize-lgpl: Work around a Cygwin bug.
Bruno Haible [Wed, 20 Jan 2021 08:14:18 +0000 (09:14 +0100)]
canonicalize-lgpl: Work around a Cygwin bug.

* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Test for lstat. Add a
test case that involves a symbolic link to an existing file.
* doc/posix-functions/realpath.texi: Mention the Cygwin bug.

4 years agodoc: Document ptsname_r bug on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 08:08:50 +0000 (09:08 +0100)]
doc: Document ptsname_r bug on Cygwin.

* doc/glibc-functions/ptsname_r.texi: Mention Cygwin bug.

4 years agosethostname tests: Avoid test failure on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 06:40:56 +0000 (07:40 +0100)]
sethostname tests: Avoid test failure on Cygwin.

* tests/test-sethostname2.c (main): Treat errno EACCESS like EPERM.

4 years agofnmatch, regex, fts: FALLTHROUGH consistency
Paul Eggert [Wed, 20 Jan 2021 02:35:30 +0000 (18:35 -0800)]
fnmatch, regex, fts: FALLTHROUGH consistency

Be more consistent about how FALLTHROUGH is defined.
For Gnulib, use attribute.h.  For glibc, use __GNUC__ >= 7.
Problem for glibc reported by Vaseeharan Vinayagamoorthy in:
https://sourceware.org/pipermail/libc-alpha/2021-January/121778.html
* lib/fnmatch.c (FALLTHROUGH) [_LIBC]:
* lib/regex_internal.h (FALLTHROUGH) [_LIBC]:
Don’t worry about Clang, as it’s not needed and provokes GCC.
* lib/fts.c (FALLTHROUGH) [!_LIBC]:
* lib/regex_internal.h (FALLTHROUGH) [!_LIBC]:
Rely on attribute.h for FALLTHROUGH
* modules/regex: Depend on attribute module.

4 years agospawn-pipe: Fix SIGSEGV on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:13 +0000 (01:40 +0900)]
spawn-pipe: Fix SIGSEGV on OS/2 kLIBC.

* lib/spawn-pipe.c [OS/2 kLIBC]: Check directory correctly if it means
a current directory.

4 years agodirent: Fix compilation error in C++ mode on OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 18:23:39 +0000 (19:23 +0100)]
dirent: Fix compilation error in C++ mode on OS/2 kLIBC.

* lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function
always.

4 years agozerosize-ptr: Fix compilation on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:11 +0000 (01:40 +0900)]
zerosize-ptr: Fix compilation on OS/2 kLIBC.

* tests/zerosize-ptr.h [OS/2 kLIBC]: Don't use mmap().

4 years agostddef: Fix compilation for max_align_t on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:09 +0000 (01:40 +0900)]
stddef: Fix compilation for max_align_t on OS/2 kLIBC.

* lib/stddef.in.h [OS/2 kLIBC]: Include <cstddef> in C++ mode.

4 years agoyield: Implement for OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 17:44:19 +0000 (18:44 +0100)]
yield: Implement for OS/2 kLIBC.

* modules/yield (Depends-on): Add sched_yield.

4 years agosched_yield: Implement for OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 17:41:09 +0000 (18:41 +0100)]
sched_yield: Implement for OS/2 kLIBC.

* lib/sched_yield.c (sched_yield) [OS/2 kLIBC]: New implementation.