]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 months agorenameatu: Work around a GNU/Hurd bug.
Collin Funk [Sun, 19 Jan 2025 05:06:49 +0000 (21:06 -0800)]
renameatu: Work around a GNU/Hurd bug.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Check if renameat2 handles trailing
slashes.

3 months agoalignasof: port to IBM XL C V16.1
Paul Eggert [Sat, 18 Jan 2025 06:11:54 +0000 (22:11 -0800)]
alignasof: port to IBM XL C V16.1

* m4/stdalign.m4 (gl_ALIGNASOF):
Work around similar bug in IBM XL C V16.1.0 cc (non-clang).
Since this is the last version of this obsolescent compiler,
assume the bug is in earlier versions.

3 months agoAvoid -Wformat=security failures with --disable-nls
Pádraig Brady [Fri, 17 Jan 2025 13:01:40 +0000 (13:01 +0000)]
Avoid -Wformat=security failures with --disable-nls

This was noticed with GCC 14.

* lib/xmemcoll.c: Always use format arguments.
* lib/xprintf.c: Likewise.

3 months agogetopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
Bruno Haible [Thu, 16 Jan 2025 22:10:10 +0000 (23:10 +0100)]
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).

Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00135.html>.

* lib/getopt-pfx-core.h: On several platforms, include <unistd.h> first.
* modules/getopt-posix (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

3 months agowchar_h: Fix for glibc 2.5.
Bruno Haible [Thu, 16 Jan 2025 20:14:45 +0000 (21:14 +0100)]
wchar_h: Fix for glibc 2.5.

* lib/wchar.in.h (__need_wint_t): Clean up after including glibc's
<wchar.h>.

3 months agoassert-h: Fix compilation error with gcc >= 13 on Solaris 11.
Bruno Haible [Tue, 14 Jan 2025 21:47:43 +0000 (22:47 +0100)]
assert-h: Fix compilation error with gcc >= 13 on Solaris 11.

Reported by Pádraig Brady <P@draigBrady.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00120.html>.

* m4/assert_h.m4 (gl_ASSERT_H): Don't assume that on Solaris with gcc or
clang, static_assert works: /usr/include/assert.h is in the way.

3 months agoprogname: also set program_invocation_short_name
Pádraig Brady [Sun, 12 Jan 2025 16:47:57 +0000 (16:47 +0000)]
progname: also set program_invocation_short_name

* lib/progname.c (set_program_name): Keep program_invocation_name
and program_invocation_short_name consistent.

3 months agoeealloc, malloca: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:20:48 +0000 (15:20 +0100)]
eealloc, malloca: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/eealloc (Depends-on): Add stdlib-h.
* modules/malloca (Depends-on): Likewise.

3 months agocanonicalize: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:19:57 +0000 (15:19 +0100)]
canonicalize: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/canonicalize (Depends-on): Add stdlib.

3 months agofcntl-h: port better to musl on GNU/Linux
Paul Eggert [Wed, 8 Jan 2025 08:32:23 +0000 (00:32 -0800)]
fcntl-h: port better to musl on GNU/Linux

* lib/fcntl.in.h (O_SEARCH): Redefine to O_RDONLY on musl,
which mistakenly defines it to be O_PATH on GNU/Linux.
Problem reported by Lasse Collin in:
https://bugs.gnu.org/75405

3 months agosigsegv tests: Work around a longjmp bug on GNU/Hurd.
Bruno Haible [Mon, 6 Jan 2025 00:16:11 +0000 (01:16 +0100)]
sigsegv tests: Work around a longjmp bug on GNU/Hurd.

* tests/test-sigsegv-catch-stackoverflow1.c (_FORTIFY_SOURCE,
__USE_FORTIFY_LEVEL): Undefine, as a workaround to the Hurd longjmp bug.
* tests/test-sigsegv-catch-stackoverflow2.c (_FORTIFY_SOURCE,
__USE_FORTIFY_LEVEL): Likewise.
* doc/posix-functions/longjmp.texi: Document the Hurd bug.

3 months agotests: Don't use module 'getcwd' as dependency.
Bruno Haible [Sun, 5 Jan 2025 12:21:35 +0000 (13:21 +0100)]
tests: Don't use module 'getcwd' as dependency.

* modules/getcwd (Comment): New section.
* modules/xgetcwd (Comment): Likewise.
* modules/xgetcwd-lgpl: New file, based on modules/xgetcwd.
* modules/chown-tests (Depends-on): Add xgetcwd-lgpl. Remove xgetcwd.
* modules/fchownat-tests (Depends-on): Likewise.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.
* modules/lchown-tests (Depends-on): Likewise.
* modules/stat-time-tests (Depends-on): Likewise.
* modules/utime-tests (Depends-on): Likewise.
* modules/utimens-tests (Depends-on): Likewise.
* modules/utimensat-tests (Depends-on): Likewise.

4 months agogetcwd: Return "/bin" instead of "//bin" on Adélie Linux.
Bruno Haible [Tue, 31 Dec 2024 18:38:42 +0000 (19:38 +0100)]
getcwd: Return "/bin" instead of "//bin" on Adélie Linux.

Reported by Zach van Rijn <me@zv.io> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00072.html>
and <https://git.adelielinux.org/adelie/packages/-/issues/987>.

* lib/getcwd.c (__getcwd_generic): Remove a trailing slash from the
result of readlink().

4 months agoendian: Fix link error on CentOS 5.
Bruno Haible [Sat, 28 Dec 2024 17:39:24 +0000 (18:39 +0100)]
endian: Fix link error on CentOS 5.

* m4/endian_h.m4 (gl_ENDIAN_H): Use AC_LINK_IFELSE, not
AC_COMPILE_IFELSE.

4 months agoassert-h, verify: Make static_assert work in C++ mode on FreeBSD 11.
Bruno Haible [Sat, 28 Dec 2024 16:40:44 +0000 (17:40 +0100)]
assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11.

* lib/verify.h (static_assert): Override when using old versions of
clang++.

4 months agoendian: Fix compilation error on NetBSD 7.1.
Bruno Haible [Sat, 28 Dec 2024 15:47:16 +0000 (16:47 +0100)]
endian: Fix compilation error on NetBSD 7.1.

* m4/endian_h.m4 (gl_ENDIAN_H): Test for <sys/endian.h>. Set
HAVE_SYS_ENDIAN_H.
* lib/endian.in.h: Test HAVE_SYS_ENDIAN_H as an alternative to
HAVE_ENDIAN_H.
* modules/endian (Makefile.am): Substitute HAVE_SYS_ENDIAN_H.

4 months agowchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0.
Bruno Haible [Sat, 28 Dec 2024 15:38:23 +0000 (16:38 +0100)]
wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0.

* lib/wchar.in.h (rpl_mbstate_t): Don't define on OpenBSD.

4 months agoaccess, euidaccess tests: Avoid test failure in Cygwin 3.5.5.
Bruno Haible [Wed, 25 Dec 2024 00:34:23 +0000 (01:34 +0100)]
access, euidaccess tests: Avoid test failure in Cygwin 3.5.5.

* tests/test-access.h [__CYGWIN__]: Include <grp.h>, <string.h>,
<unistd.h>.
(is_administrator): New function.
(is_root): New macro.
(test_access): Reenable F_OK test for non-administrators on Cygwin.
Disable X_OK test for administrators on Cygwin.

4 months agowchar: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:23:45 +0000 (11:23 +0100)]
wchar: Support several gnulib-tool invocations better.

* lib/wchar.in.h (_GL_ALREADY_INCLUDING_WCHAR_H): Rename to a macro that
depends on GUARD_PREFIX.
(mbszero): Avoid duplicate definition.

4 months agothreads-h: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:22:40 +0000 (11:22 +0100)]
threads-h: Support several gnulib-tool invocations better.

* lib/threads.in.h (_GL_ALREADY_INCLUDING_THREADS_H): Rename to a macro
that depends on GUARD_PREFIX.
(struct thrd_with_exitcode): Avoid duplicate definition.

4 months agosys_socket: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:21:51 +0000 (11:21 +0100)]
sys_socket: Support several gnulib-tool invocations better.

* lib/sys_socket.in.h (_GL_ALREADY_INCLUDING_SYS_SOCKET_H): Rename to a
macro that depends on GUARD_PREFIX.
(struct msghdr): Avoid duplicate definition.

4 months agostring: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:20:52 +0000 (11:20 +0100)]
string: Support several gnulib-tool invocations better.

* lib/string.in.h (_GL_ALREADY_INCLUDING_STRING_H): Rename to a macro
that depends on GUARD_PREFIX.

4 months agostdio: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:19:49 +0000 (11:19 +0100)]
stdio: Support several gnulib-tool invocations better.

* lib/stdio.in.h: Test _GL_SKIP_GNULIB_STDIO_H.
(_GL_ALREADY_INCLUDING_STDIO_H): Rename to a macro that depends on
GUARD_PREFIX.
* lib/fopen.c: Set _GL_SKIP_GNULIB_STDIO_H instead of
_GL_ALREADY_INCLUDING_STDIO_H.
* lib/freopen.c: Likewise.

4 months agospawn: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:17:31 +0000 (11:17 +0100)]
spawn: Support several gnulib-tool invocations better.

* lib/spawn.in.h (_GL_ALREADY_INCLUDING_SPAWN_H): Rename to a macro that
depends on GUARD_PREFIX.

4 months agosignal-h: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:25:01 +0000 (11:25 +0100)]
signal-h: Support several gnulib-tool invocations better.

* lib/signal.in.h (_GL_ALREADY_INCLUDING_SIGNAL_H): Rename to a macro
that depends on GUARD_PREFIX.

4 months agopthread-h: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:16:25 +0000 (11:16 +0100)]
pthread-h: Support several gnulib-tool invocations better.

* lib/pthread.in.h (_GL_ALREADY_INCLUDING_PTHREAD_H): Rename to a macro
that depends on GUARD_PREFIX.

4 months agomalloc-h: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:15:25 +0000 (11:15 +0100)]
malloc-h: Support several gnulib-tool invocations better.

* lib/malloc.in.h (_GL_ALREADY_INCLUDING_MALLOC_H): Rename to a macro
that depends on GUARD_PREFIX.

4 months agolocale: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:14:20 +0000 (11:14 +0100)]
locale: Support several gnulib-tool invocations better.

* lib/locale.in.h (_GL_ALREADY_INCLUDING_LOCALE_H): Rename to a macro
that depends on GUARD_PREFIX.
(struct lconv): Avoid duplicate definition.

4 months agolimits-h: Support several gnulib-tool invocations better.
Bruno Haible [Tue, 24 Dec 2024 10:13:16 +0000 (11:13 +0100)]
limits-h: Support several gnulib-tool invocations better.

* lib/limits.in.h (_GL_ALREADY_INCLUDING_LIMITS_H): Rename to a macro
that depends on GUARD_PREFIX.

4 months agostdlib: fix MB_CUR_MAX on older Android
Paul Eggert [Mon, 23 Dec 2024 20:57:12 +0000 (12:57 -0800)]
stdlib: fix MB_CUR_MAX on older Android

Android NDK r16 MB_CUR_MAX doesn’t link when compiling C.
Problem found in GNU Emacs, which worked around it this way:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=39a7e6b79fdeafc539a36f6831d922a2622cb679
... but this ran afoul of the recent Gnulib change that
added lib/stdlib.c.
* lib/stdlib.in.h (gl_MB_CUR_MAX): If @REPLACE_MB_CUR_MAX@
is positive, use its value directly.
* m4/stdlib_h.m4 (gl_STDLIB_H): Set REPLACE_MB_CUR_MAX to (-1)
if the Solaris bug, and to 4 if the Android bug.
* tests/test-stdlib.c (main): Check that MB_CUR_MAX compiles
and is nonzero.

4 months agostdlib: MB_CUR_MAX is type size_t
Paul Eggert [Mon, 23 Dec 2024 20:23:22 +0000 (12:23 -0800)]
stdlib: MB_CUR_MAX is type size_t

* lib/stdlib.in.h (gl_MB_CUR_MAX): Return size_t, not int,
to conform to POSIX.

4 months agosetlocale: Support the UTF-8 environment on native Windows.
Bruno Haible [Mon, 23 Dec 2024 15:57:15 +0000 (16:57 +0100)]
setlocale: Support the UTF-8 environment on native Windows.

* lib/setlocale.c: Include <windows.h>.
(setlocale_unixlike): In the UTF-8 environment, append a suffix ".65001"
to the locale names passed to the native setlocale().

4 months agolocalename-unsafe: Support the UTF-8 environment on native Windows.
Bruno Haible [Mon, 23 Dec 2024 15:56:57 +0000 (16:56 +0100)]
localename-unsafe: Support the UTF-8 environment on native Windows.

* lib/localename-unsafe.c (gl_locale_name_from_win32_LANGID): Append a
suffix ".UTF-8" to the result if GetACP() is UTF-8.

4 months agolocalcharset: Support the UTF-8 environment on native Windows.
Bruno Haible [Mon, 23 Dec 2024 15:56:15 +0000 (16:56 +0100)]
localcharset: Support the UTF-8 environment on native Windows.

* lib/localcharset.c (locale_charset): Recognize also the special case
of a setlocale() result that ends in ".UTF-8".

4 months agosetlocale: Handle LC_MESSAGES correctly on native Windows.
Bruno Haible [Mon, 23 Dec 2024 15:43:17 +0000 (16:43 +0100)]
setlocale: Handle LC_MESSAGES correctly on native Windows.

* lib/setlocale.c (setlocale_improved): Revamp the LC_ALL case if
LC_MESSAGES is 1729.

4 months agoc32isprint tests: Avoid test failure on mingw/ucrt.
Bruno Haible [Sun, 22 Dec 2024 13:34:29 +0000 (14:34 +0100)]
c32isprint tests: Avoid test failure on mingw/ucrt.

* tests/test-c32isprint.c (main): Disable test that fails on mingw/ucrt.

4 months agobtowc: Fix declaration on mingw/ucrt.
Bruno Haible [Sun, 22 Dec 2024 11:40:17 +0000 (12:40 +0100)]
btowc: Fix declaration on mingw/ucrt.

* m4/btowc.m4 (gl_FUNC_BTOWC): Require gt_TYPE_WINT_T. If gnulib
overrides wint_t, set REPLACE_BTOWC to 1.

4 months agoposix_spawn_file_actions_addchdir tests: Avoid test failure on MSYS2.
Bruno Haible [Sun, 22 Dec 2024 11:10:14 +0000 (12:10 +0100)]
posix_spawn_file_actions_addchdir tests: Avoid test failure on MSYS2.

* tests/test-posix_spawn-chdir.c (test): Recognize also the 'pwd' output
for root on MSYS2.

4 months agotest-framework-sh: Avoid test suite failures on MSYS2.
Bruno Haible [Sun, 22 Dec 2024 11:03:22 +0000 (12:03 +0100)]
test-framework-sh: Avoid test suite failures on MSYS2.

* tests/init.sh (compare_) [MSys]: Use a temporary file on MSYS2.
* tests/test-update-copyright.sh: Use the test framework.
(compare): Remove function.
* modules/update-copyright-tests (Depends-on): Add test-framework-sh.

4 months agotest-framework-sh: Avoid test suite failures on MSYS2.
Bruno Haible [Sun, 22 Dec 2024 07:11:59 +0000 (08:11 +0100)]
test-framework-sh: Avoid test suite failures on MSYS2.

* tests/init.sh (mkdir) [MSys]: New function.

4 months agoexecl, execle, execlp: Fix compilation error with gcc 14.
Bruno Haible [Sun, 22 Dec 2024 03:38:48 +0000 (04:38 +0100)]
execl, execle, execlp: Fix compilation error with gcc 14.

* lib/execl.c (execl): Cast second argument of execv.
* lib/execle.c (execle): Cast second argument of execve.
* lib/execlp.c (execlp): Cast second argument of execvp.

4 months agoxstdopen: Improve error message.
Bruno Haible [Tue, 17 Dec 2024 17:21:03 +0000 (18:21 +0100)]
xstdopen: Improve error message.

* lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno
value.

4 months agoopenat-die: Fix a gcc -Wformat -Wformat-security warning.
Bruno Haible [Tue, 10 Dec 2024 20:19:17 +0000 (21:19 +0100)]
openat-die: Fix a gcc -Wformat -Wformat-security warning.

* lib/openat-die.c (openat_save_fail, openat_restore_fail): Put the
internationalized error message into non-format-string position.

4 months agoUpdate dependencies of modules that include "gettext.h".
Bruno Haible [Sun, 8 Dec 2024 14:24:13 +0000 (15:24 +0100)]
Update dependencies of modules that include "gettext.h".

* modules/closein (Depends-on): Add gettext-h.
* modules/dfa (Depends-on): Likewise.
* modules/error (Depends-on): Likewise.
* modules/xfreopen (Depends-on): Likewise.
* modules/xstrerror (Depends-on): Likewise.

4 months agosignbit: Fix compilation error with g++ 5.5 on Solaris 10.
Bruno Haible [Fri, 6 Dec 2024 19:48:06 +0000 (20:48 +0100)]
signbit: Fix compilation error with g++ 5.5 on Solaris 10.

Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00180.html>.

* lib/math.in.h (signbit): In C++ 11 or newer, assume that <math.h> or
<cmath> may define signbit through three inline functions.

4 months agostrerror_r-posix: Silence gcc 14 warning.
Bruno Haible [Tue, 3 Dec 2024 19:38:12 +0000 (20:38 +0100)]
strerror_r-posix: Silence gcc 14 warning.

* lib/strerror_r.c (strerror_r): Silence -Wformat-truncation warning.

4 months agoannounce-gen: Fix bug when accessing symlinks.
Bruno Haible [Sun, 1 Dec 2024 12:49:03 +0000 (13:49 +0100)]
announce-gen: Fix bug when accessing symlinks.

* build-aux/announce-gen (sizes): Pass the option -L to 'du'.

5 months agofpurge: Improve configure test.
Bruno Haible [Tue, 26 Nov 2024 08:38:42 +0000 (09:38 +0100)]
fpurge: Improve configure test.

Reported by Eli Schwartz <eschwartz@gentoo.org>.

* m4/fpurge.m4 (gl_FUNC_FPURGE): If fpurge is not declared, don't test
whether it works. Remove now-redundant cross-compilation guess.

5 months agogettext-h: Fix compilation error when pgettext is used.
Bruno Haible [Sun, 24 Nov 2024 14:15:37 +0000 (15:15 +0100)]
gettext-h: Fix compilation error when pgettext is used.

Reported by Friedrich Beckmann <friedrich.beckmann@posteo.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00189.html>.

* lib/gettext.h: Include <locale.h>.

5 months agoc-stack: Avoid a busy-looping test on macOS.
Bruno Haible [Wed, 20 Nov 2024 07:50:42 +0000 (08:50 +0100)]
c-stack: Avoid a busy-looping test on macOS.

* lib/c-stack.c: Undefine abort.

5 months agounicodeio: avoid iconv issues for most ASCII characters
Pádraig Brady [Tue, 19 Nov 2024 18:11:21 +0000 (18:11 +0000)]
unicodeio: avoid iconv issues for most ASCII characters

* lib/unicodeio.c (print_unicode_char): Avoid unicode_to_mb()
for most ASCII characters, to avoid iconv() issues
which were seen on macOS.
Addresses https://bugs.gnu.org/74428

5 months agostdlib: Adjust warning about function 'free'.
Bruno Haible [Tue, 19 Nov 2024 15:03:01 +0000 (16:03 +0100)]
stdlib: Adjust warning about function 'free'.

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

* lib/stdlib.in.h (free): Talk about POSIX:2024, not future POSIX.
Recommend module 'free-posix'.

5 months agomd5-stream, sha*-stream, sm3-stream: Avoid duplicate symbols.
Jan Palus [Sun, 17 Nov 2024 17:58:42 +0000 (18:58 +0100)]
md5-stream, sha*-stream, sm3-stream: Avoid duplicate symbols.

* lib/md5-stream.c (GL_OPENSSL_INLINE): Remove definition, that caused
the symbols defined in md5.o to be defined in md5-stream.o as well.
* lib/sha1-stream.c (GL_OPENSSL_INLINE): Likewise.
* lib/sha256-stream.c (GL_OPENSSL_INLINE): Likewise.
* lib/sha512-stream.c (GL_OPENSSL_INLINE): Likewise.
* lib/sm3-stream.c (GL_OPENSSL_INLINE): Likewise.

Copyright-paperwork-exempt: Yes

5 months agopthread-rwlock: Fix configure test for AIX with xlc.
Bruno Haible [Thu, 14 Nov 2024 06:06:25 +0000 (07:06 +0100)]
pthread-rwlock: Fix configure test for AIX with xlc.

* m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Cast the NULL pointer.

5 months agoftello: Fix override on mingw.
Bruno Haible [Thu, 14 Nov 2024 04:18:00 +0000 (05:18 +0100)]
ftello: Fix override on mingw.

Reported by Markus Mützel <markus.muetzel@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00108.html>.

* lib/ftello.c: Test whether module 'largefile' is in use, not only
whether it had to override 'off_t'.

5 months agofseeko: Fix potentially wrong override.
Bruno Haible [Thu, 14 Nov 2024 03:51:23 +0000 (04:51 +0100)]
fseeko: Fix potentially wrong override.

* m4/fseeko.m4 (gl_PREREQ_FSEEKO): Define the C macro HAVE_FSEEKO.

5 months agoftello: Fix override on mingw and 32-bit Solaris OpenIndiana.
Bruno Haible [Thu, 14 Nov 2024 03:42:45 +0000 (04:42 +0100)]
ftello: Fix override on mingw and 32-bit Solaris OpenIndiana.

Reported by Markus Mützel <markus.muetzel@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00108.html>.

* m4/ftello.m4 (gl_PREREQ_FTELLO): Define the C macro HAVE_FTELLO.

5 months agoftruncate: Accept lengths > 2 GiB on 32-bit mingw.
Bruno Haible [Thu, 14 Nov 2024 03:32:09 +0000 (04:32 +0100)]
ftruncate: Accept lengths > 2 GiB on 32-bit mingw.

* lib/ftruncate.c: Test whether module 'largefile' is in use, not only
whether it had to override 'off_t'.

5 months agognulib-tool.py: Fix logic of --remove-import option.
Bruno Haible [Wed, 13 Nov 2024 01:36:11 +0000 (02:36 +0100)]
gnulib-tool.py: Fix logic of --remove-import option.

Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00101.html>.

* pygnulib/GLImport.py (GLImport.__init__): Compute the modules to keep
correctly.

5 months agofts: Fix dependencies.
Bruno Haible [Mon, 11 Nov 2024 19:03:31 +0000 (20:03 +0100)]
fts: Fix dependencies.

* modules/fts (Depends-on): Add fcntl-safer.

5 months agomalloca: pacify CHERI clang
Paul Eggert [Mon, 11 Nov 2024 18:59:16 +0000 (10:59 -0800)]
malloca: pacify CHERI clang

* lib/malloca.c (freea) [__CHERI_PURE_CAPABILITY__]:
Add a cast as the code otherwise doesn’t conform to C.

5 months agoacl-permissions: Define the inline functions in this module.
Bruno Haible [Mon, 11 Nov 2024 08:53:23 +0000 (09:53 +0100)]
acl-permissions: Define the inline functions in this module.

* lib/acl-internal.c (ACL_INTERNAL_INLINE): Define here.
* lib/qset-acl.c (ACL_INTERNAL_INLINE): Don't define here.

5 months agogetpagesize: Fix use of 'extern inline' (regression 2012-11-20).
Bruno Haible [Mon, 11 Nov 2024 08:33:11 +0000 (09:33 +0100)]
getpagesize: Fix use of 'extern inline' (regression 2012-11-20).

* lib/unistd.in.h (_GL_GETPAGESIZE_INLINE): New macro.
(getpagesize): Use it.
* lib/getpagesize.c (_GL_GETPAGESIZE_INLINE): Define.
* modules/getpagesize (configure.ac): Compile getpagesize.c also when
getpagesize is missing.

5 months agorelocatable-prog-wrapper: Fix compilation error on NetBSD 7.
Bruno Haible [Sun, 10 Nov 2024 23:56:15 +0000 (00:56 +0100)]
relocatable-prog-wrapper: Fix compilation error on NetBSD 7.

Reported by Ionut Cosmin Mihai <ionut.cosmin.mihai@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnu-libiconv/2024-11/msg00000.html>.

* lib/relocwrapper.c: Fix dependency tree.
* modules/relocatable-prog-wrapper (Files): Add lib/stat-time.h,
lib/stat-time.c.
* build-aux/install-reloc (func_create_wrapper): Compile also
stat-time.c.

5 months agoassert-h: Allow mixed use of gcc/g++ also on Haiku 2022.
Bruno Haible [Thu, 31 Oct 2024 03:34:29 +0000 (04:34 +0100)]
assert-h: Allow mixed use of gcc/g++ also on Haiku 2022.

* m4/assert_h.m4 (gl_ASSERT_H): Don't assume that in C mode, <assert.h>
defines static_assert.

5 months agoassert-h, stdbool: Allow mixed use of gcc/g++ and clang/clang++ again.
Bruno Haible [Tue, 29 Oct 2024 12:48:36 +0000 (13:48 +0100)]
assert-h, stdbool: Allow mixed use of gcc/g++ and clang/clang++ again.

* m4/assert_h.m4 (gl_ASSERT_H): Improve indentation. With GCC and clang,
don't use the value of HAVE_C_STATIC_ASSERT.
* m4/c-bool.m4 (gl_C_BOOL): With GCC and clang, don't use the value of
HAVE_C_BOOL.

5 months agoposix_memalign-tests: fix message typo
Paul Eggert [Sat, 26 Oct 2024 17:07:53 +0000 (10:07 -0700)]
posix_memalign-tests: fix message typo

* tests/test-posix_memalign.c (main): Fix diagnostic typo.

5 months agoregex: Avoid dialog while running configure test on Haiku/x86_64.
Bruno Haible [Sat, 26 Oct 2024 19:10:30 +0000 (21:10 +0200)]
regex: Avoid dialog while running configure test on Haiku/x86_64.

Reported by Alexandru Popa <alpopa@gmail.com> in
<https://sourceforge.net/p/clisp/mailman/message/58831511/>.

* m4/regex.m4 (gl_REGEX): Disable dialog upon abort on Haiku.

5 months agoregex: Make configure test more maintainable.
Bruno Haible [Sat, 26 Oct 2024 18:58:05 +0000 (20:58 +0200)]
regex: Make configure test more maintainable.

* m4/regex.m4 (gl_REGEX): Include <malloc.h> before testing for
M_CHECK_ACTION.

5 months agopipe-filter-gi: Correct documentation.
Bruno Haible [Sat, 26 Oct 2024 17:42:10 +0000 (19:42 +0200)]
pipe-filter-gi: Correct documentation.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-10/msg00199.html>.

* lib/pipe-filter.h (pipe_filter_gi_create): Don't say that this
function may return NULL.

6 months agopthread-h tests: Fix a compilation error on MacOS X 10.4.
Bruno Haible [Wed, 16 Oct 2024 10:46:26 +0000 (12:46 +0200)]
pthread-h tests: Fix a compilation error on MacOS X 10.4.

Reported by Sevan Janiyan <venture37@geeklan.co.uk> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-11/msg00183.html>.

* tests/test-pthread.c: Omit the PTHREAD_RWLOCK_INITIALIZER test if
module 'pthread-rwlock' is not in use.

6 months agocsharpcomp-script: Handle directories with spaces correctly.
Bruno Haible [Thu, 10 Oct 2024 17:39:36 +0000 (19:39 +0200)]
csharpcomp-script: Handle directories with spaces correctly.

Reported by Michele Locati <michele@locati.it>.

* build-aux/csharpcomp.sh.in (command_for_print, command_for_eval,
options_csc_for_print, options_csc_for_eval, sources_csc_for_print,
sources_csc_for_eval): New variables.
(sed_protect_1, sed_protect_2a, sed_protect_2b, sed_protect_2c,
sed_protect_3a, sed_protect_3b): New variables, copied from
build-aux/x-to-1.in.
(func_add_word_to_command): New function, copied from
build-aux/x-to-1.in.
(func_add_word_to_options_csc, func_add_word_to_sources_csc): New
functions.
(options_csc, sources_csc): Remove variables. Use
func_add_word_to_options_csc, func_add_word_to_sources_csc instead of
augmenting them.
Use options_csc_for_print, options_csc_for_eval, sources_csc_for_print,
sources_csc_for_eval when invoking csc.
* build-aux/csharpexec.sh.in (sed_quote_subst): Remove unused variable.

6 months agocsharpcomp: Avoid error on Windows.
Bruno Haible [Wed, 9 Oct 2024 15:22:59 +0000 (17:22 +0200)]
csharpcomp: Avoid error on Windows.

Reported by Michele Locati <michele@locati.it>.

* build-aux/csharpcomp.sh.in: Don't produce -reference options for DLLs
whose name starts with a lowercase letter or contains '.Native.'.
* lib/csharpcomp.c (name_is_dll): Filter our file names that start with
a lowercase letter or contain '.Native.'.

6 months agocsharpcomp: Add support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 01:20:00 +0000 (03:20 +0200)]
csharpcomp: Add support for dotnet.

* lib/csharpcomp.c: Include <dirent.h>, concat-filename.h, xvasprintf.h.
(name_is_dll): New function, from lib/csharpexec.c.
(compile_csharp_using_dotnet): New function.
(compile_csharp_class): Invoke compile_csharp_using_dotnet.
* modules/csharpcomp (Depends-on): Add xconcat-filename, scandir,
alphasort, xvasprintf.

6 months agocsharpcomp-script: Add support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 01:14:26 +0000 (03:14 +0200)]
csharpcomp-script: Add support for dotnet.

* m4/csharpcomp.m4 (gt_CSHARPCOMP): Support 'dotnet' as implementation.
Set HAVE_DOTNET_SDK, HAVE_DOTNET_CSC.
* build-aux/csharpcomp.sh.in: Add implementations for the cases
$HAVE_DOTNET_SDK = 1 and $HAVE_DOTNET_CSC = 1.

6 months agocsharpexec: Add support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 01:14:04 +0000 (03:14 +0200)]
csharpexec: Add support for dotnet.

* lib/csharpexec.c: Include <dirent.h>, <errno.h>, <sys/stat.h>,
dirname.h, concat-filename.h, canonicalize.h, spawn-pipe.h,
wait-process.h, xalloc.h, copy-file.h, clean-temp-simple.h,
clean-temp.h.
(name_is_dll, execute_csharp_using_dotnet): New functions.
(execute_csharp_program): Invoke execute_csharp_using_dotnet.
* modules/csharpexec (Depends-on): Add stat, dirname, xconcat-filename,
canonicalize, spawn-pipe, wait-process, scandir, alphasort, copy-file,
clean-temp-simple, clean-temp.

6 months agocsharpexec-script: Add support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 01:12:42 +0000 (03:12 +0200)]
csharpexec-script: Add support for dotnet.

* m4/csharpexec.m4 (gt_CSHARPEXEC): Support 'dotnet' as implementation.
Set HAVE_DOTNET.
* build-aux/csharpexec.sh.in (func_tmpdir): New function, copied from
build-aux/csharpcomp.sh.in.
Add implementation for the case $HAVE_DOTNET = 1.

6 months agocsharpexec-script, csharpcomp-script: Prepare support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 01:11:32 +0000 (03:11 +0200)]
csharpexec-script, csharpcomp-script: Prepare support for dotnet.

* m4/csharp.m4 (gt_CSHARP_CHOICE): Recognize 'dotnet' as value of
--enable-csharp.

6 months agocsharpcomp: Behave like csharpcomp-script.
Bruno Haible [Wed, 9 Oct 2024 01:09:15 +0000 (03:09 +0200)]
csharpcomp: Behave like csharpcomp-script.

* lib/csharpcomp.c (compile_csharp_using_sscli): Pass the option
'-nologo' to csc.

6 months agocsharpcomp: Improve Cygwin support.
Bruno Haible [Mon, 7 Oct 2024 18:25:06 +0000 (20:25 +0200)]
csharpcomp: Improve Cygwin support.

* lib/csharpcomp.c: Include cygpath.h.
(compile_csharp_using_sscli): Convert the file names passed to 'csc' to
native Windows syntax.
* modules/csharpcomp (Depends-on): Add cygpath.

6 months agocsharpcomp-script: Improve Cygwin support.
Bruno Haible [Mon, 7 Oct 2024 18:20:14 +0000 (20:20 +0200)]
csharpcomp-script: Improve Cygwin support.

* build-aux/csharpcomp.sh.in: Convert the file names passed to 'csc' to
native Windows syntax.

6 months agocsharpexec: Improve Cygwin support.
Bruno Haible [Mon, 7 Oct 2024 18:15:44 +0000 (20:15 +0200)]
csharpexec: Improve Cygwin support.

* lib/csharpexec.c: Include cygpath.h.
(execute_csharp_using_sscli): Convert the first 'clix' argument to
native Windows syntax.
* modules/csharpexec (Depends-on): Add cygpath.

6 months agocsharpexec-script: Improve Cygwin support.
Bruno Haible [Mon, 7 Oct 2024 18:14:04 +0000 (20:14 +0200)]
csharpexec-script: Improve Cygwin support.

* build-aux/csharpexec.sh.in: Convert the first 'clix' argument to
native Windows syntax.

6 months agocygpath: New module.
Bruno Haible [Mon, 7 Oct 2024 18:10:16 +0000 (20:10 +0200)]
cygpath: New module.

* lib/cygpath.h: New file.
* lib/cygpath.c: New file, based on lib/javaversion.c.
* modules/cygpath: New file.

6 months agojavacomp, javaversion: Fix resource leak.
Bruno Haible [Sun, 6 Oct 2024 23:14:20 +0000 (01:14 +0200)]
javacomp, javaversion: Fix resource leak.

* lib/javacomp.c (execute_and_read_line): When fdopen fails, terminate
the program.
* lib/javaversion.c (execute_and_read_line): Likewise. When we can't
read a single line, call fclose and wait_subprocess, to free resources.

6 months agoiconv_open: Fix undefined behaviour.
Bruno Haible [Sat, 5 Oct 2024 00:45:49 +0000 (02:45 +0200)]
iconv_open: Fix undefined behaviour.

Reported by Tim Sweet <tsweet64@protonmail.com>
at <https://savannah.gnu.org/bugs/?66289>.

* lib/iconv.c (utf32be_mbtowc, utf32le_mbtowc): Cast 'unsigned char'
values to ucs4_t before shifting them to the left.

7 months agogetopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
Bruno Haible [Mon, 23 Sep 2024 15:52:43 +0000 (17:52 +0200)]
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).

* lib/getopt-pfx-core.h: On AIX, HP-UX, Solaris, QNX, include <stdio.h>
first.

7 months agogetopt-posix, crypto/md5-buffer: Fix __GNUC_PREREQ re clang.
Bruno Haible [Sat, 21 Sep 2024 21:10:34 +0000 (23:10 +0200)]
getopt-posix, crypto/md5-buffer: Fix __GNUC_PREREQ re clang.

* lib/getopt-cdefs.in.h (__GNUC_PREREQ): Copy definition from
lib/libc-config.h.
* lib/md5.h (__GNUC_PREREQ): Likewise.

7 months agogetopt-posix: Improve definition of __GNUC_PREREQ.
Henrik Lindström [Sat, 21 Sep 2024 20:46:24 +0000 (22:46 +0200)]
getopt-posix: Improve definition of __GNUC_PREREQ.

* lib/getopt-cdefs.in.h (__GNUC_PREREQ): Test __GNUC_MINOR__, not
__GNUC_VERSION__.

Copyright-paperwork-exempt: Yes

7 months agosigsegv-tests: port to GCC 14
Paul Eggert [Sat, 21 Sep 2024 02:24:39 +0000 (19:24 -0700)]
sigsegv-tests: port to GCC 14

GCC 14 on x86-64 with -O2 apparently outsmarts our test for null
pointer dereference, and this is something the C standard allows.
Fix the test by putting ‘volatile’ at the right place.
* tests/test-sigsegv-catch-stackoverflow2.c (null_pointer):
Make it a volatile pointer, not a pointer to volatile.
Also, rename from null_pointer_to_volatile_int; use changed.

7 months agojit/cache tests: Fix crash with clang's UBSAN + ASAN.
Bruno Haible [Fri, 20 Sep 2024 15:17:36 +0000 (17:17 +0200)]
jit/cache tests: Fix crash with clang's UBSAN + ASAN.

* tests/jit/test-cache.c (clang_ubsan_workaround): New variable.
(CODE, SET_CODE): Use it.
(main): Initialize it.
* m4/libdl.m4: New file.
* modules/jit/cache-tests (Files): Add it.
(configure.ac): Invoke gl_LIBDL.
(Makefile.am): Link test-cache with $(LIBDL).

7 months agowait-process: Use waitpid() of LIBCx on OS/2 kLIBC if available.
KO Myung-Hun [Thu, 19 Sep 2024 13:45:04 +0000 (22:45 +0900)]
wait-process: Use waitpid() of LIBCx on OS/2 kLIBC if available.

* lib/wait-process.c (klibc_waitpid) [kLIBC]: New function.
(waitpid) [kLIBC]: Define it to klibc_waitpid.

7 months agoautoupdate
Karl Berry [Thu, 19 Sep 2024 21:28:57 +0000 (14:28 -0700)]
autoupdate

7 months agospawn-pipe: Simplify.
Bruno Haible [Thu, 19 Sep 2024 14:32:43 +0000 (16:32 +0200)]
spawn-pipe: Simplify.

* m4/spawn-pipe.m4 (gl_SPAWN_PIPE): Don't define HAVE_LIBCX_SPAWN2_H as
an AC_SUBSTed variable. Don't test for it on platforms other than OS/2.

7 months agospawn-pipe: Support a directory argument of create_pipe() on OS/2 kLIBC.
KO Myung-Hun [Thu, 19 Sep 2024 13:58:01 +0000 (22:58 +0900)]
spawn-pipe: Support a directory argument of create_pipe() on OS/2 kLIBC.

* lib/os2-spawn.h (spawnpvech): New declaration.
* lib/os2-spawn.c (spawnpvech): New function.
* lib/spawn-pipe.c (create_pipe) [kLIBC]: Reimplement with spawnpvech().
* m4/spawn-pipe.m4 (gl_SPAWN_PIPE) [HAVE_LIBCX_SPAWN2_H]: Check if
libcx/spawn2.h is available.

7 months agostdlib: Fix compilation error with Sun C++.
Bruno Haible [Tue, 17 Sep 2024 01:56:55 +0000 (03:56 +0200)]
stdlib: Fix compilation error with Sun C++.

* lib/stdlib.in.h: Don't obey the special invocation convention when
Sun C++ is used.

7 months agostdc_count_ones: Fix compilation error with g++ < 4.4.
Bruno Haible [Mon, 16 Sep 2024 23:44:51 +0000 (01:44 +0200)]
stdc_count_ones: Fix compilation error with g++ < 4.4.

* lib/stdbit.in.h (__gl_stdbit_popcount_wide): Suffix 64-bit integer
constant with LL.

7 months agofaccessat: Correct errno value on AIX.
Bruno Haible [Mon, 16 Sep 2024 22:52:28 +0000 (00:52 +0200)]
faccessat: Correct errno value on AIX.

* lib/faccessat.c (rpl_faccessat): Do the trailing-slash workaround also
if the original faccessat invocation failed.

7 months agombrtoc16: Fix undefined behaviour.
Bruno Haible [Tue, 10 Sep 2024 11:56:03 +0000 (13:56 +0200)]
mbrtoc16: Fix undefined behaviour.

* lib/mbrtoc16.c (SET_EXTRA_STATE): Cast to 'unsigned int' before
shifting the bits to the positions 31..16.

7 months agostring-desc: Fix undefined behaviour.
Bruno Haible [Tue, 10 Sep 2024 00:07:57 +0000 (02:07 +0200)]
string-desc: Fix undefined behaviour.

* lib/string-desc-contains.c (string_desc_contains): Handle the case of
an empty haystack before invoking 'memmem'.