]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agosigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.
Bruno Haible [Sat, 11 Feb 2023 17:48:08 +0000 (18:48 +0100)]
sigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.

* lib/sigsegv.c (install_for): Add a cast when assigning to
action.sa_sigaction.

2 years agomkfifoat: Fix crash on macOS 12.
Bruno Haible [Thu, 2 Mar 2023 19:52:16 +0000 (20:52 +0100)]
mkfifoat: Fix crash on macOS 12.

* m4/gnulib-common.m4 (gl_PREPARE_CHECK_FUNCS_MACOS,
gl_CHECK_FUNCS_MACOS): New macros.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat and mkfifoat using
gl_CHECK_FUNCS_MACOS instead of AC_CHECK_FUNCS_ONCE.

2 years agochown, lchown, fchownat tests: Avoid test failure on macOS 12.
Bruno Haible [Fri, 10 Feb 2023 12:46:22 +0000 (13:46 +0100)]
chown, lchown, fchownat tests: Avoid test failure on macOS 12.

* tests/test-chown.h (test_chown): Skip some assertions if
getgid() == (gid_t)-1.
* tests/test-lchown.h (test_lchown): Likewise.

2 years agomath: Fix compilation error in C++ mode on macOS 12.5.
Bruno Haible [Thu, 9 Feb 2023 18:27:37 +0000 (19:27 +0100)]
math: Fix compilation error in C++ mode on macOS 12.5.

* lib/math.in.h (isnan): On macOS, treat clang version 14 again like
clang versions < 12.

2 years agoFix compilation errors in C++ mode on macOS 12.5.
Bruno Haible [Thu, 9 Feb 2023 17:37:55 +0000 (18:37 +0100)]
Fix compilation errors in C++ mode on macOS 12.5.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't define
_GL_ATTRIBUTE_MAYBE_UNUSED to [[__maybe_unused__]] if the compiler is
an Apple variant of clang.

2 years agolimits-h: Work around a clang 15 bug.
Bruno Haible [Thu, 9 Feb 2023 12:30:04 +0000 (13:30 +0100)]
limits-h: Work around a clang 15 bug.

* m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
* lib/limits.in.h: Handle the case where BOOL_WIDTH is present and
BOOL_MAX is missing.
* doc/posix-headers/limits.texi: Mention the clang bug.

2 years agoFix error in C++ mode on glibc systems (regression 2022-04-28).
Bruno Haible [Thu, 9 Feb 2023 12:16:31 +0000 (13:16 +0100)]
Fix error in C++ mode on glibc systems (regression 2022-04-28).

* lib/string.in.h (rpl_free): Add exception specification like
stdlib.in.h does.
* lib/wchar.in.h (rpl_free): Likewise.

2 years agogetcwd: Fix compilation error in C23 mode.
Bruno Haible [Thu, 9 Feb 2023 11:53:22 +0000 (12:53 +0100)]
getcwd: Fix compilation error in C23 mode.

* lib/getcwd.c: Include <stdio.h>.

2 years agoFix a copyright header - module license mismatch.
Bruno Haible [Tue, 7 Feb 2023 12:36:23 +0000 (13:36 +0100)]
Fix a copyright header - module license mismatch.

Reported by Bjarni Ingi Gislason <bjarniig@simnet.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00057.html>.

* lib/gen-uni-tables.c (output_predicate): For uniwidth/width2.h, use an
LGPLv2+ license.
(output_nonspacing_property): Use an LGPLv2+ license.
* lib/uniwidth/width0.h: Regenerated.
* lib/uniwidth/width2.h: Likewise.

2 years agosetlocale-null: Don't use a lock in Cygwin >= 3.4.6.
Bruno Haible [Mon, 6 Feb 2023 17:33:37 +0000 (18:33 +0100)]
setlocale-null: Don't use a lock in Cygwin >= 3.4.6.

Road paved by Corinna Vinschen <vinschen@redhat.com>.

* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Assume that
setlocale (LC_ALL, NULL) is multithread-safe in Cygwin >= 3.4.6.
* lib/setlocale_null.c: Update comments.
* tests/test-setlocale_null-mt-all.c: Likewise.

2 years agoUpdate build-aux/po/Makefile.in.in.
Bruno Haible [Sun, 5 Feb 2023 16:20:50 +0000 (17:20 +0100)]
Update build-aux/po/Makefile.in.in.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00020.html>.

* build-aux/po/Makefile.in.in: Sync from GNU gettext 0.21.1.
Fixes:
- In the .po -> .gmo rules, consider the newest changes to the POT file.
- Emit a warning when creating a tarball without POT file.

2 years agoassert-h, verify: Fix compilation error in C++ mode with MSVC 14.
Bruno Haible [Sun, 5 Feb 2023 10:19:28 +0000 (11:19 +0100)]
assert-h, verify: Fix compilation error in C++ mode with MSVC 14.

* lib/verify.h (static_assert): Define _ALLOW_KEYWORD_MACROS.
* tests/test-assert-h-c++.cc: Strengthen test.
* tests/test-assert-h-c++2.cc: Likewise.

2 years agoassert-h, verify: Fix conflict with standard C++ header files on macOS.
Bruno Haible [Sat, 4 Feb 2023 13:31:08 +0000 (14:31 +0100)]
assert-h, verify: Fix conflict with standard C++ header files on macOS.

* lib/verify.h (_Static_assert): Don't redefine with clang ≥ 3.8.0
in C++ mode.
* tests/test-assert-h-c++.cc: Also check against conflict with the
standard C++ header files.
* tests/test-assert-h-c++2.cc: Likewise.

2 years agorelocatable-prog: Fix compiler warning.
Bruno Haible [Sat, 4 Feb 2023 01:51:04 +0000 (02:51 +0100)]
relocatable-prog: Fix compiler warning.

* lib/progreloc.c (full_read): Use a non-const pointer.

2 years agoat-internal: Fix support for z/OS.
Bruno Haible [Mon, 30 Jan 2023 22:10:21 +0000 (23:10 +0100)]
at-internal: Fix support for z/OS.

* lib/openat-proc.c (openat_proc_name) [z/OS]: Proper error handling.
Convert only the relevant part of the dir[] buffer.

2 years agoat-internal: Add support for z/OS.
Bruno Haible [Mon, 30 Jan 2023 11:30:21 +0000 (12:30 +0100)]
at-internal: Add support for z/OS.

Reported and draft patch by Igor Todorovski <itodorov@ca.ibm.com>.

* lib/openat-proc.c [z/OS]: Include <termios.h>.
(openat_proc_name): For z/OS, use an approach similar to kLIBC, with
3 lines of z/OS specific code by Igor Todorovski <itodorov@ca.ibm.com>.

2 years agoFix compilation errors with CC="clang -D_FORTIFY_SOURCE=2" on Android.
Bruno Haible [Sun, 29 Jan 2023 22:51:42 +0000 (23:51 +0100)]
Fix compilation errors with CC="clang -D_FORTIFY_SOURCE=2" on Android.

Reported by Alexey Rochev <equeim@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnu-libiconv/2023-01/msg00019.html>.

* lib/cdefs.h (__bos, __bos0, __glibc_objsize0, __glibc_objsize,
__glibc_safe_len_cond, __glibc_unsigned_or_positive,
__glibc_safe_or_unknown_len, __glibc_unsafe_len, __glibc_fortify,
__glibc_fortify_n): Don't define these macros in Gnulib.
* lib/libc-config.h: Don't undefine these macros in Gnulib.

2 years agoClarify _GL_ATTRIBUTE_NODISCARD code.
Bruno Haible [Sat, 28 Jan 2023 19:22:02 +0000 (20:22 +0100)]
Clarify _GL_ATTRIBUTE_NODISCARD code.

Reported by Paul Eggert.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add comment regarding
_GL_ATTRIBUTE_NODISCARD definition.

2 years agounistdio/*printf: Fix negative width handling for %U, %lU, %llU.
Bruno Haible [Sat, 28 Jan 2023 18:39:23 +0000 (19:39 +0100)]
unistdio/*printf: Fix negative width handling for %U, %lU, %llU.

* lib/vasnprintf.c (VASNPRINTF): In the code for %U, %lU, %llU, test for
the FLAG_LEFT bit in the flags variable.

2 years agovasnprintf-posix: Fix possible bug with negative width handling for %lc.
Bruno Haible [Sat, 28 Jan 2023 18:05:24 +0000 (19:05 +0100)]
vasnprintf-posix: Fix possible bug with negative width handling for %lc.

* lib/vasnprintf.c (VASNPRINTF): In the code for %lc in vasnprintf, test
for the FLAG_LEFT bit in the flags variable.

2 years agovasnprintf-posix: Fix negative width handling for %ls directive.
Bruno Haible [Sat, 28 Jan 2023 17:17:17 +0000 (18:17 +0100)]
vasnprintf-posix: Fix negative width handling for %ls directive.

Reported by clang via Po Lu <luangruo@yahoo.com>.

* lib/vasnprintf.c (VASNPRINTF): In the code for %ls in vasnprintf and
for %s in vasnwprintf, test for the FLAG_LEFT bit in the flags variable.

2 years agoAvoid clang warnings regarding [[__nodiscard__]].
Bruno Haible [Sat, 28 Jan 2023 10:52:40 +0000 (11:52 +0100)]
Avoid clang warnings regarding [[__nodiscard__]].

* m4/gnulib-common.m4 (gl_COMMON_BODY): For clang, in C++ mode, ignore
the __has_c_attribute value and define _GL_ATTRIBUTE_NODISCARD to
__attribute__ ((__warn_unused_result__)), not [[__nodiscard__]].

2 years agoAvoid clang warnings regarding [[__maybe_unused__]].
Bruno Haible [Fri, 10 Feb 2023 02:53:24 +0000 (03:53 +0100)]
Avoid clang warnings regarding [[__maybe_unused__]].

* m4/gnulib-common.m4 (gl_COMMON_BODY): For clang versions ≥ 6, < 10,
in C++ mode, ignore the __has_c_attribute value and define
_GL_ATTRIBUTE_MAYBE_UNUSED to __attribute__ ((__unused__)), not
[[__maybe_unused__]].

2 years agoKeep config.h idempotent.
Bruno Haible [Wed, 25 Jan 2023 14:38:30 +0000 (15:38 +0100)]
Keep config.h idempotent.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add double-inclusion guards to
the definitions of the macros _GL_ATTRIBUTE_ALLOC_SIZE,
_GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_ARTIFICIAL,
_GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_CONST, _GL_ATTRIBUTE_DEALLOC,
_GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR, _GL_ATTRIBUTE_WARNING,
_GL_ATTRIBUTE_EXTERNALLY_VISIBLE, _GL_ATTRIBUTE_FALLTHROUGH,
_GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED,
_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL,
_GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED,
_GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL,
_GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNUSED, _GL_UNUSED_LABEL.

2 years agovasnprintf: Fix compilation error on Android NDK r26b.
Bruno Haible [Wed, 25 Jan 2023 08:53:21 +0000 (09:53 +0100)]
vasnprintf: Fix compilation error on Android NDK r26b.

Reported by Po Lu <luangruo@yahoo.com>.

* lib/vasnprintf.c: Include <wchar.h>.

2 years agothreadlib: Fix support for Solaris 9 and older.
Nick Bowler [Wed, 25 Jan 2023 08:38:00 +0000 (09:38 +0100)]
threadlib: Fix support for Solaris 9 and older.

* m4/threadlib.m4 (gl_PTHREADLIB_BODY): Allow case patterns to survive
m4 processing by using changequote.

2 years agostdalign: Fix a compilation error on FreeBSD 12.0.
Bruno Haible [Wed, 25 Jan 2023 14:29:13 +0000 (15:29 +0100)]
stdalign: Fix a compilation error on FreeBSD 12.0.

* lib/stdalign.in.h (_Alignof): In C mode, prefer __builtin_offsetof
over offsetof when possible, since __builtin_offsetof works also when
<stddef.h> has not been fully included yet.

2 years agoautoupdate
Karl Berry [Sun, 22 Jan 2023 16:29:03 +0000 (08:29 -0800)]
autoupdate

2 years agosigsegv, vma-iter: port to Solaris 10
Paul Eggert [Sun, 22 Jan 2023 06:49:04 +0000 (00:49 -0600)]
sigsegv, vma-iter: port to Solaris 10

On this platform, <sys/types.h> does not define off_t if neither
_LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we
of doing stdbool, since config.h now includes <stdbool.h>, and
Solaris 10 <stdbool.h> includes <sys/feature_tests.h> which
arranges for _FILE_OFFSET_BITS to always be defined (if only to 32),
which <sys/types.h> assumes.
* lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]:
Define to 32 instead of leaving undefined.

2 years agosnippet/_Noreturn: work around Clang _Noreturn bug
Paul Eggert [Fri, 20 Jan 2023 03:39:03 +0000 (19:39 -0800)]
snippet/_Noreturn: work around Clang _Noreturn bug

This is a bigger-hammer workaround for the clang _Noreturn issue
fix for dfa.c on 2023-01-01.  Unfortunately, it causes 270
-Wreturn-type and -Wsometimes-uninitialized warnings when building
bleeding-edge GNU Emacs from Git on Fedora 37 with plain
‘./configure && make’.  So the workaround is enabled only if you
compile with -D_GL_WORK_AROUND_LLVM_BUG_59792.
* lib/_Noreturn.h (_Noreturn):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
and if _GL_WORK_AROUND_LLVM_BUG_59792 is defined.

2 years agoexecute tests: Avoid test failure with GNU make 4.4.
Bruno Haible [Tue, 17 Jan 2023 21:13:36 +0000 (22:13 +0100)]
execute tests: Avoid test failure with GNU make 4.4.

Reported by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00157.html>.

* tests/test-execute-main.c (main): Reset the SIGPIPE handler to
default on all platforms.

2 years agofflush: Tweak last commit.
Bruno Haible [Tue, 17 Jan 2023 19:17:27 +0000 (20:17 +0100)]
fflush: Tweak last commit.

* lib/stdio-impl.h (fp_): Make the last change work also with newer
Android NDKs and _FILE_OFFSET_BITS=64.

2 years agofflush: Fix a buffer overrun on 32-bit Android.
Bruno Haible [Tue, 17 Jan 2023 18:16:29 +0000 (19:16 +0100)]
fflush: Fix a buffer overrun on 32-bit Android.

* lib/stdio-impl.h (fp_): On Android, change the type of _offset to
'long'.
* lib/fflush.c (update_fpos_cache): On Android, update a 'long', not an
'fpos_t'.

2 years agoexecute tests: Avoid test failure on Android.
Bruno Haible [Tue, 17 Jan 2023 14:15:57 +0000 (15:15 +0100)]
execute tests: Avoid test failure on Android.

* tests/test-execute-main.c (main): Reset the SIGPIPE handler to
default.

2 years agoautoupdate
Karl Berry [Mon, 16 Jan 2023 16:54:54 +0000 (08:54 -0800)]
autoupdate

2 years agofpending: Fix compilation error with NDK ≥ r14b and Android API < 23.
Bruno Haible [Sun, 15 Jan 2023 10:10:09 +0000 (11:10 +0100)]
fpending: Fix compilation error with NDK ≥ r14b and Android API < 23.

Report and patch by Po Lu <luangruo@yahoo.com>.

* lib/fpending.c (__fpending) [__ANDROID__]: Use the fp_ macro.

2 years agotest-framework-sh: work around AIX 7.2 diff bugs
Paul Eggert [Sun, 15 Jan 2023 00:47:41 +0000 (16:47 -0800)]
test-framework-sh: work around AIX 7.2 diff bugs

* tests/init.sh (compare_dev_null_): Run diff in the C locale.
AIX 7.2 diff messes up in UTF-8 locales; for example,
‘printf '\360\220\200\200\n' | diff - /dev/null’ incorrectly
outputs nothing and exits with status 0 when LC_ALL=en_US.UTF-8.

2 years agoverify: work around xlclang 16.1 compiler bug
Paul Eggert [Fri, 13 Jan 2023 22:32:11 +0000 (14:32 -0800)]
verify: work around xlclang 16.1 compiler bug

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
* lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE):
Define to 0 if compiler advertises itself as clang before version 5.
xlclang 16.1 advertises itself as 4.0.1 and this patch works
around what appears to be a compiler bug when compiling dfa.c in
bleeding-edge grep.

2 years agoFix link errors on Android 4.3.
Bruno Haible [Wed, 11 Jan 2023 09:50:41 +0000 (10:50 +0100)]
Fix link errors on Android 4.3.

* lib/asyncsafe-spin.c: Don't use the GCC >= 4.1 builtins on Android,
when building with GCC.
* lib/pthread-spin.c: Likewise.
* lib/simple-atomic.c: Likewise.

2 years agothreads-h: Improve portability.
Bruno Haible [Mon, 9 Jan 2023 20:31:52 +0000 (21:31 +0100)]
threads-h: Improve portability.

* lib/threads.in.h: Use INCLUDE_NEXT_AS_FIRST_DIRECTIVE when possible.
* modules/threads-h (Makefile.am): Substitute
INCLUDE_NEXT_AS_FIRST_DIRECTIVE and NEXT_AS_FIRST_DIRECTIVE_THREADS_H.

2 years agomalloc-h: Improve portability.
Bruno Haible [Mon, 9 Jan 2023 20:18:20 +0000 (21:18 +0100)]
malloc-h: Improve portability.

* lib/malloc.in.h: Use INCLUDE_NEXT_AS_FIRST_DIRECTIVE when possible.
* modules/malloc-h (Makefile.am): Substitute
INCLUDE_NEXT_AS_FIRST_DIRECTIVE and NEXT_AS_FIRST_DIRECTIVE_MALLOC_H.

2 years agocopy-file, supersede: Fix link-time requirements.
Bruno Haible [Thu, 5 Jan 2023 10:26:04 +0000 (11:26 +0100)]
copy-file, supersede: Fix link-time requirements.

* modules/copy-file (Link): Add $(LIB_ACL).
* modules/supersede (Link): Likewise.

2 years agosigsegv: Fix compilation error on Android 4.3.
Bruno Haible [Mon, 2 Jan 2023 15:57:31 +0000 (16:57 +0100)]
sigsegv: Fix compilation error on Android 4.3.

* lib/sigsegv.in.h: For Android, don't include <ucontext.h> and don't
reference ucontext_t.
* lib/sigsegv.c (SIGSEGV_FAULT_): For Android, use a plain POSIX fault
handler (cf. libsigsegv/src/fault-posix.h).

2 years agodfa: work around Clang 15 bug
Paul Eggert [Mon, 2 Jan 2023 06:06:10 +0000 (22:06 -0800)]
dfa: work around Clang 15 bug

Problem reported by Kenton Groombridge in:
https://lists.gnu.org/archive/html/bug-gawk/2022-12/msg00010.html
On x86-64, Clang 15 gets confused by a call (X ? dfaerror :
dfawarn) (Y) and generates the wrong code, presumably because
dfaerror is _Noreturn and dfawarn is not.
* lib/dfa.c (parse_bracket_exp): Reword to have one call for
dfaerror, the other for dfawarn.

2 years agoassert-h: port static_assert to strict C99
Paul Eggert [Wed, 28 Dec 2022 22:15:43 +0000 (14:15 -0800)]
assert-h: port static_assert to strict C99

* lib/verify.h (_GL_VERIFY): Port MSVC hack back to C99.
Problem found when testing bleeding-edge gzip on IBM XL C for AIX,
V12.1 (5765-J02, 5725-C72), which complained ‘"malloca.c", line
42.56: 1506-041 (E) The invocation of macro _Static_assert
contains fewer arguments than are required by the macro
definition.’  This diagnostic is valid because C99 requires
that if you #define _Static_assert(R, ...) you must call
_Static_assert with at least two arguments.  I found a similar
problem with Sun C 5.9 SunOS_sparc Patch 124867-12 2009/11/22.

2 years agoFix compilation errors in C++ mode on Solaris 11 OpenIndiana.
Bruno Haible [Tue, 27 Dec 2022 10:21:45 +0000 (11:21 +0100)]
Fix compilation errors in C++ mode on Solaris 11 OpenIndiana.

* m4/gnulib-common.m4 (gl_COMMON_BODY): In _GL_ATTRIBUTE_DEALLOC_FREE,
with GNU C++, cast the 'free' function.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): With GNU C++, cast the
'free' function.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): Likewise.

2 years agostdbool-c99: fix typo
Paul Eggert [Mon, 26 Dec 2022 18:17:17 +0000 (10:17 -0800)]
stdbool-c99: fix typo

Reported against Autoconf by Todd C. Miller in:
https://lists.gnu.org/r/autoconf/2022-12/msg00001.html
* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Sync from Autoconf master.

2 years agoposix_spawnp-tests: fix filename typo
Paul Eggert [Fri, 23 Dec 2022 05:19:34 +0000 (21:19 -0800)]
posix_spawnp-tests: fix filename typo

Problem reported for GNU m4 by Mitchell Dorrell in:
https://lists.gnu.org/r/bug-m4/2022-12/msg00000.html
* tests/test-posix_spawnp-script.c (DATA_FILENAME):
Fix typo in file name that caused race with
test-posix_spawn-script.c.

2 years agoexplicit_bzero: add poison
Paul Eggert [Mon, 28 Nov 2022 01:15:24 +0000 (17:15 -0800)]
explicit_bzero: add poison

* m4/string_h.m4 (gl_STRING_H): Poison explicit_bzero.
This was inadvertently omitted when explicit_bzero was added.

2 years agoexplicit_bzero: work with gcc -std=c99
Paul Eggert [Sun, 27 Nov 2022 17:59:32 +0000 (09:59 -0800)]
explicit_bzero: work with gcc -std=c99

* lib/explicit_bzero.c (explicit_bzero) [__GNUC__ && !__clang__]:
Use __asm__ instead of asm.

2 years agoposix_spawn tests: Fix compilation error (regression 2022-09-14).
Bruno Haible [Sun, 20 Nov 2022 10:09:19 +0000 (11:09 +0100)]
posix_spawn tests: Fix compilation error (regression 2022-09-14).

* modules/posix_spawn-tests (Makefile.am): Augment DEFS, to define
EXEEXT.

2 years agovc-list-files-tests: Avoid OpenPGP private key operations.
Simon Josefsson [Sun, 13 Nov 2022 10:50:51 +0000 (11:50 +0100)]
vc-list-files-tests: Avoid OpenPGP private key operations.

* tests/test-vc-list-files-git.sh (GIT_CONFIG_GLOBAL): Set it to /dev/null.

2 years agomaintainer-makefile: Fix last sc_indent commit.
Simon Josefsson [Tue, 1 Nov 2022 08:09:02 +0000 (09:09 +0100)]
maintainer-makefile: Fix last sc_indent commit.

* top/maint.mk (sc_indent): Don't use grep -q.
Suggested by Bruno Haible.

2 years agomaintainer-makefile: Fix Apple Xcode 'make syntax-check'.
Simon Josefsson [Mon, 31 Oct 2022 08:42:42 +0000 (09:42 +0100)]
maintainer-makefile: Fix Apple Xcode 'make syntax-check'.

* top/maint.mk (sc_indent): Don't use non-GNU indent.

2 years agogetdelim: Work around buggy implementation on macOS 10.13.
Bruno Haible [Mon, 17 Oct 2022 00:44:54 +0000 (02:44 +0200)]
getdelim: Work around buggy implementation on macOS 10.13.

* doc/posix-functions/getdelim.texi: Mention the macOS bug.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Let the "checking for working
getdelim function" test answer 'no' on macOS.

2 years agoautoupdate
Karl Berry [Sat, 8 Oct 2022 15:10:14 +0000 (08:10 -0700)]
autoupdate

2 years agolargefile: fix detection of time_t size on mingw32
Daiki Ueno [Mon, 26 Sep 2022 04:48:42 +0000 (13:48 +0900)]
largefile: fix detection of time_t size on mingw32

* modules/largefile (configure.ac-early): Ensure gl_YEAR2038_EARLY
is invoked before gl_YEAR2038_BODY.

2 years agofts: fix errno handling if dirfd fails
Paul Eggert [Mon, 26 Sep 2022 01:33:49 +0000 (18:33 -0700)]
fts: fix errno handling if dirfd fails

* lib/fts.c (fts_build): Use proper errno if dirfd failed.
Although I don’t know of any platform where dirfd can fail here,
we might as well get it right.

2 years agostdalign: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sun, 1 Jan 2023 09:31:22 +0000 (10:31 +0100)]
stdalign: Fix compilation error with MSVC in C++ mode.

* lib/stdalign.in.h: Treat MSVC in C++ mode like C++11 compliant
compilers.

2 years agoautoupdate
Karl Berry [Sun, 11 Sep 2022 14:56:05 +0000 (07:56 -0700)]
autoupdate

2 years agosnippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.
Bruno Haible [Tue, 20 Sep 2022 21:31:19 +0000 (23:31 +0200)]
snippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.

* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Use the clang command-line
option that disables implicit built-in function declarations in clang.

2 years agostdbool tests: Fix compilation error with clang/MSVC.
Bruno Haible [Tue, 20 Sep 2022 21:57:06 +0000 (23:57 +0200)]
stdbool tests: Fix compilation error with clang/MSVC.

* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.

2 years agostdbool: Ensure that 'true' can be used in the preprocessor.
Bruno Haible [Sun, 18 Sep 2022 16:45:39 +0000 (18:45 +0200)]
stdbool: Ensure that 'true' can be used in the preprocessor.

* lib/stdbool.in.h (true): Redefine if it does not evaluate to 1 in the
preprocessor.

2 years agosignal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
Bruno Haible [Sun, 18 Sep 2022 12:41:20 +0000 (14:41 +0200)]
signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.

* lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
<pthread.h> on OpenBSD ≥ 5.1.

2 years agowchar: Fix compilation errors in C++ mode on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 01:05:21 +0000 (03:05 +0200)]
wchar: Fix compilation errors in C++ mode on Solaris 11.3.

* lib/wchar.in.h (wcsnlen, wcpcpy, wcpncpy, wcscasecmp, wcsncasecmp,
wcsdup): Force declaration in C++ mode on Solaris (which does not
declare these functions in the global namespace).

2 years agoswab: Fix compilation error with Sun C++ on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 00:32:13 +0000 (02:32 +0200)]
swab: Fix compilation error with Sun C++ on Solaris 11.3.

* lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
not under Solaris 10, test also __XOPEN_OR_POSIX.

2 years agotime C++ tests: Fix link error on CentOS 5.
Bruno Haible [Sat, 17 Sep 2022 19:31:53 +0000 (21:31 +0200)]
time C++ tests: Fix link error on CentOS 5.

* modules/time-c++-tests (Makefile.am): Link test-time-c++ against
$(LIB_CLOCK_GETTIME).

2 years agotime: Fix compilation errors with clang/MSVC.
Bruno Haible [Wed, 14 Sep 2022 22:50:41 +0000 (00:50 +0200)]
time: Fix compilation errors with clang/MSVC.

* m4/time_h.m4 (gl_TIME_H): Test whether asctime_r and ctime_r are
declared.
* lib/time.in.h (asctime_r, ctime_r): Skip _GL_WARN_ON_USE invocations
when these functions are not declared.

2 years agoverify: Avoid syntax error due to static_assert with clang in C++ mode.
Bruno Haible [Sun, 18 Sep 2022 19:19:56 +0000 (21:19 +0200)]
verify: Avoid syntax error due to static_assert with clang in C++ mode.

* lib/verify.h (static_assert): Don't define in clang C++ 6 or newer.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14 in C++.
Bruno Haible [Sun, 18 Sep 2022 19:17:11 +0000 (21:17 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14 in C++.

* lib/verify.h (static_assert): For MSVC in C++ mode, use a definition
that supports both the two-arguments and the one-argument syntax.

2 years agoposix_spawn-* tests: Fix test failure on mingw when libtool is in use.
Bruno Haible [Wed, 14 Sep 2022 13:12:18 +0000 (15:12 +0200)]
posix_spawn-* tests: Fix test failure on mingw when libtool is in use.

* tests/test-posix_spawn-inherit0.c (CHILD_PROGRAM_FILENAME): Add the
EXEEXT suffix.
* tests/test-posix_spawn-inherit1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open2.c (CHILD_PROGRAM_FILENAME): Likewise.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14.
Bruno Haible [Sun, 18 Sep 2022 19:14:35 +0000 (21:14 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14.

* lib/verify.h (_Static_assert): Pass only the first argument to
_GL_VERIFY.

2 years agoverify: Avoid syntax error due to static_assert with GNU C++ 6.x.
Bruno Haible [Sun, 18 Sep 2022 19:12:52 +0000 (21:12 +0200)]
verify: Avoid syntax error due to static_assert with GNU C++ 6.x.

* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.

2 years agosupersede: Avoid a failure when writing to /dev/null in Solaris zones.
Bruno Haible [Mon, 12 Sep 2022 08:49:25 +0000 (10:49 +0200)]
supersede: Avoid a failure when writing to /dev/null in Solaris zones.

* lib/supersede.c (open_supersede): Treat EACCES (seen on Solaris 11.3)
like EINVAL (seen on Illumos).

2 years agopipe-filter-gi: Fix test failure on native Windows.
Bruno Haible [Sun, 11 Sep 2022 00:53:07 +0000 (02:53 +0200)]
pipe-filter-gi: Fix test failure on native Windows.

* lib/pipe-filter-aux.h (write): Redefine on native Windows.

2 years agostdbool C++ tests: Fix for C++20.
Bruno Haible [Sat, 10 Sep 2022 17:18:05 +0000 (19:18 +0200)]
stdbool C++ tests: Fix for C++20.

* tests/test-stdbool-c++2.cc: Don't include <cstdbool> in C++20 or
newer.

2 years agouchar: Work around error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:56:14 +0000 (18:56 +0200)]
uchar: Work around error in C++ mode on AIX 7.2 with xlclang.

* lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
these as macros.
* doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.

2 years agostring: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:20:58 +0000 (18:20 +0200)]
string: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/string.in.h (mbslen): Enable the C++ alias warning only on glibc
systems.

2 years agomath: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:03:02 +0000 (18:03 +0200)]
math: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/math.in.h (cbrtl, copysignl, exp2l, expm1l, fmal, ilogbl, log1pl,
log2l, logbl, remainderl, rintl, roundl, truncl): Enable the C++ alias
warning only on glibc systems.

2 years agoposix_spawn-internal: Don't lose flags while duplicating an fd.
Bruno Haible [Sat, 10 Sep 2022 00:26:18 +0000 (02:26 +0200)]
posix_spawn-internal: Don't lose flags while duplicating an fd.

* lib/spawni.c (do_dup2): Fix the flags of the new fd.

2 years agospawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).
Bruno Haible [Fri, 9 Sep 2022 14:49:10 +0000 (16:49 +0200)]
spawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).

* lib/windows-spawn.h (struct inheritable_handles): Widen the per-fd
flags from 8 bits to 16 bits.
(KEEP_OPEN_IN_CHILD): New macro.
(init_inheritable_handles): Change description of what it does when
duplicate == true.
* lib/windows-spawn.c (init_inheritable_handles): If duplicate == true,
add all fds to the array, regardless whether they are scheduled to be
preserved in the child process.
(compose_handles_block): Update.
(spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles): Update.
(shrink_inheritable_handles): Also close the handles not marked with
KEEP_OPEN_IN_CHILD.
(do_open, do_dup2): Mark the new fd with KEEP_OPEN_IN_CHILD.

2 years agospawn-pipe: Fix possible hangs in programs that spawn several children.
Bruno Haible [Fri, 9 Sep 2022 13:14:45 +0000 (15:14 +0200)]
spawn-pipe: Fix possible hangs in programs that spawn several children.

* lib/spawn-pipe.c (create_pipe) [Unix]: Create the ifd[] and ofd[] file
descriptors with the close-on-exec flag set.

2 years agopipe-filter-gi tests: Fix long-standing failure on native Windows.
Bruno Haible [Tue, 6 Sep 2022 13:09:41 +0000 (15:09 +0200)]
pipe-filter-gi tests: Fix long-standing failure on native Windows.

* tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

2 years agoposix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.
Bruno Haible [Fri, 9 Sep 2022 12:26:54 +0000 (14:26 +0200)]
posix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.

* modules/posix_spawn_file_actions_addclose-tests (Files): Add
m4/musl.m4.

2 years agoposix_spawn_file_actions_addclose tests: Avoid test failure on musl.
Bruno Haible [Wed, 7 Sep 2022 21:33:31 +0000 (23:33 +0200)]
posix_spawn_file_actions_addclose tests: Avoid test failure on musl.

Reported by Valery Ushakov <uwe@stderr.spb.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-09/msg00041.html>.

* modules/posix_spawn_file_actions_addclose-tests (configure.ac): Invoke
gl_MUSL_LIBC.
* tests/test-posix_spawn_file_actions_addclose.c (main): Skip one of the
tests on musl libc.

2 years agoautoupdate
Karl Berry [Tue, 6 Sep 2022 14:18:41 +0000 (07:18 -0700)]
autoupdate

2 years agopthread-h: Fix compilation error on mingw with --enable-threads=windows.
Bruno Haible [Mon, 5 Sep 2022 19:54:10 +0000 (21:54 +0200)]
pthread-h: Fix compilation error on mingw with --enable-threads=windows.

* lib/pthread.in.h: In C++ mode, if mingw's <pthread.h> has not been
used, import many pthread_* symbols from the GNULIB_NAMESPACE into the
global namespace.

2 years agoFix various test link errors on MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:53:28 +0000 (01:53 +0200)]
Fix various test link errors on MSVC.

* modules/crypto/gc-arcfour-tests (Makefile.am): Link test-gc-arcfour
with $(LIB_GETRANDOM).
* modules/crypto/gc-arctwo-tests (Makefile.am): Link test-gc-arctwo with
$(LIB_GETRANDOM).
* modules/crypto/gc-des-tests (Makefile.am): Link test-gc-des with
$(LIB_GETRANDOM).
* modules/crypto/gc-hmac-md5-tests (Makefile.am): Link test-gc-hmac-md5
with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha1-tests (Makefile.am): Link
test-gc-hmac-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha256-tests (Makefile.am): Link
test-gc-hmac-sha256 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha512-tests (Makefile.am): Link
test-gc-hmac-sha512 with $(LIB_GETRANDOM).
* modules/crypto/gc-md2-tests (Makefile.am): Link test-gc-md2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md4-tests (Makefile.am): Link test-gc-md4 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md5-tests (Makefile.am): Link test-gc-md5 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-tests (Makefile.am): Link test-gc-pbkdf2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-sha1-tests (Makefile.am): Link
test-gc-pbkdf2-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-rijndael-tests (Makefile.am): Link test-gc-rijndael
with $(LIB_GETRANDOM).
* modules/crypto/gc-sha1-tests (Makefile.am): Link test-gc-sha1 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha256-tests (Makefile.am): Link test-gc-sha256 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha512-tests (Makefile.am): Link test-gc-sha512 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sm3-tests (Makefile.am): Link test-gc-sm3 with
$(LIB_GETRANDOM).
* modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with
$(LIB_GETRANDOM).
* modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ with
$(LIB_GETRANDOM).

2 years agocount-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.
Bruno Haible [Sun, 4 Sep 2022 23:34:36 +0000 (01:34 +0200)]
count-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.

* lib/count-leading-zeros.h: Correct syntax for #pragma intrinsic.
(COUNT_LEADING_ZEROS): Fix the return value.
(count_leading_zeros_ll): Use two _BitScanReverse invocations instead
of a _BitScanReverse64 invocation.

2 years agocount-trailing-zeros: Fix a link error on 32-bit MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:29:26 +0000 (01:29 +0200)]
count-trailing-zeros: Fix a link error on 32-bit MSVC.

* lib/count-trailing-zeros.h: Correct syntax for #pragma intrinsic.
(count_trailing_zeros_ll): Use two _BitScanForward invocations instead
of a _BitScanForward64 invocation.

2 years agounictype/category-none tests: Fix a link error on MSVC.
Bruno Haible [Sun, 4 Sep 2022 22:31:33 +0000 (00:31 +0200)]
unictype/category-none tests: Fix a link error on MSVC.

* tests/unictype/test-categ_none.c (main): Disable the test on MSVC.

2 years agooset-c++: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 22:14:48 +0000 (00:14 +0200)]
oset-c++: Fix compilation error with MSVC 14.

* lib/gl_oset.hh: With MSVC, avoid 'friend'.

2 years agoglob tests: Fix link error on mingw.
Bruno Haible [Sun, 4 Sep 2022 22:02:44 +0000 (00:02 +0200)]
glob tests: Fix link error on mingw.

* modules/glob-tests (Makefile.am): Link test-glob with $(LIBINTL).

2 years agotimespec_get: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 15:09:53 +0000 (17:09 +0200)]
timespec_get: Fix compilation error with MSVC 14.

* m4/gettime.m4 (gl_CHECK_FUNC_TIMESPEC_GET): New macro.
(gl_GETTIME): Use it instead of AC_CHECK_FUNCS_ONCE.
* m4/timespec_get.m4 (gl_FUNC_TIMESPEC_GET): Likewise.

2 years agostdbool: Fix compilation error in C++ mode with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:24:56 +0000 (16:24 +0200)]
stdbool: Fix compilation error in C++ mode with MSVC 14.

* lib/stdbool.in.h (_Bool, bool, false, true): In C++ mode with MSVC 14,
don't define these as macros.

2 years agofts: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:14:17 +0000 (16:14 +0200)]
fts: Fix compilation error with MSVC 14.

* lib/fts.c (S_IFBLK): Add fallback definition.

2 years agolstat: Fix compilation error in C++ mode on mingw.
Bruno Haible [Sun, 4 Sep 2022 14:06:37 +0000 (16:06 +0200)]
lstat: Fix compilation error in C++ mode on mingw.

* lib/sys_stat.h (lstat): Move declaration after the declaration of
'stat'.

2 years agopselect: Fix compilation error in C++ mode on mingw.
Bruno Haible [Sun, 4 Sep 2022 13:51:29 +0000 (15:51 +0200)]
pselect: Fix compilation error in C++ mode on mingw.

* lib/sys_select.in.h (pselect): Enable the C++ alias warning only on
glibc systems.

2 years agonanosleep: Work around bug on newer 32-bit mingw.
Bruno Haible [Sun, 4 Sep 2022 11:26:19 +0000 (13:26 +0200)]
nanosleep: Work around bug on newer 32-bit mingw.

* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Test for 32-bit mingw bug.
* tests/test-nanosleep.c (main): Add another test.
* doc/posix-functions/nanosleep.texi: Mention the mingw bug.

2 years agofmal: Work around glibc 2.17 bug on x86_64.
Bruno Haible [Sun, 4 Sep 2022 02:48:31 +0000 (04:48 +0200)]
fmal: Work around glibc 2.17 bug on x86_64.

* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Test against bug seen on glibc 2.17
x86_64.
* doc/posix-functions/fmal.texi: Update info.