]> Savannah Git Hosting - gnulib.git/log
gnulib.git
7 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Wed, 4 Sep 2024 17:38:52 +0000 (19:38 +0200)]
Resolve conflicts for functions introduced in Android API level 35.

Reported by Po Lu <luangruo@yahoo.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00024.html>.

* lib/time.in.h (timezone_t, tzalloc, tzfree): Don't require _GNU_SOURCE
to be defined. Define depending on HAVE_TZALLOC, not HAVE_TIMEZONE_T.
(localtime_rz, mktime_z): Likewise. Override if REPLACE_LOCALTIME_RZ or
REPLACE_MKTIME_Z is 1, respectively.
* lib/time_rz.c: If NEED_TIMEZONE_NULL_SUPPORT, define only localtime_rz
and mktime_z and only as wrappers around the system function.
* m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z.
* m4/time_rz.m4 (gl_TIME_RZ): Conditionally set HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z. Conditionally define
NEED_TIMEZONE_NULL_SUPPORT.
* modules/time-h (Makefile.am): Substitute HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z.
* modules/time_rz (Depends-on, configure.ac): Consider HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z. Ignore HAVE_TIMEZONE_T.

7 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Wed, 4 Sep 2024 08:34:04 +0000 (10:34 +0200)]
Resolve conflicts for functions introduced in Android API level 35.

* m4/strerrorname_np.m4 (gl_FUNC_COPY_FILE_RANGE): Conditionally set
REPLACE_STRERRORNAME_NP.
(gl_CHECK_STRERRORNAME_NP): Test for strerrorname_np using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

7 months agounlockpt tests: Avoid test failure on Haiku.
Bruno Haible [Tue, 3 Sep 2024 11:32:40 +0000 (13:32 +0200)]
unlockpt tests: Avoid test failure on Haiku.

* tests/test-unlockpt.c (main): Skip the test on Haiku.
* doc/posix-functions/unlockpt.texi: Update platforms list.

7 months agoutime, futimens tests: Avoid test failure on Haiku.
Bruno Haible [Mon, 2 Sep 2024 07:27:04 +0000 (09:27 +0200)]
utime, futimens tests: Avoid test failure on Haiku.

* tests/test-utimens-common.h (checkable_atime): On Haiku, return false.

7 months agostrtold: Work around a Haiku bug.
Bruno Haible [Sun, 1 Sep 2024 21:25:42 +0000 (23:25 +0200)]
strtold: Work around a Haiku bug.

* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Set to 0 for 'long double'
parsing on Haiku.
* doc/posix-functions/strtold.texi: Mention the bug.

7 months agomath: Remove workaround for an older Haiku bug.
Bruno Haible [Sun, 1 Sep 2024 16:09:28 +0000 (18:09 +0200)]
math: Remove workaround for an older Haiku bug.

* lib/math.in.h (FP_ILOGB0, FP_ILOGBNAN): Don't override on Haiku.

7 months agoFix mbscasestr test failure on native Windows with MSVC.
Bruno Haible [Sun, 1 Sep 2024 11:09:59 +0000 (13:09 +0200)]
Fix mbscasestr test failure on native Windows with MSVC.

* lib/c32to-impl.h (FUNC): On native Windows, ignore the system's
towlower/towupper function entirely.
* tests/test-c32tolower.c (main): On native Windows, reenable test that
previously failed.
* tests/test-c32toupper.c (main): Likewise. Disable two other tests on
native Windows.
* doc/posix-functions/towlower.texi: Mention bug in the native Windows
UTF-8 locale.
* doc/posix-functions/towupper.texi: Likewise.

7 months agotests: Avoid some test failures on Android.
Bruno Haible [Sat, 31 Aug 2024 22:13:49 +0000 (00:13 +0200)]
tests: Avoid some test failures on Android.

* tests/test-c32isalpha.c (main): Disable tests that fail on Android.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

7 months agotests: Avoid some test failures on OpenBSD 7.5.
Bruno Haible [Sat, 31 Aug 2024 22:13:39 +0000 (00:13 +0200)]
tests: Avoid some test failures on OpenBSD 7.5.

* tests/test-c32isalpha.c (main): Disable tests that fail on
OpenBSD 7.5.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

7 months agoiswxdigit: Work around OpenBSD, Android, Haiku bug.
Bruno Haible [Sat, 31 Aug 2024 22:12:54 +0000 (00:12 +0200)]
iswxdigit: Work around OpenBSD, Android, Haiku bug.

* m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): Require gt_LOCALE_EN_UTF8 instead
of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
Update cross-compilation guess.
* modules/iswxdigit (Files): Add m4/locale-en.m4. Remove m4/locale-fr.m4.
* doc/posix-functions/iswxdigit.texi: Update list of platforms.

7 months agoiswdigit: Work around OpenBSD, Android, Haiku bug.
Bruno Haible [Sat, 31 Aug 2024 22:11:12 +0000 (00:11 +0200)]
iswdigit: Work around OpenBSD, Android, Haiku bug.

* m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Require gt_LOCALE_EN_UTF8 instead
of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
Update cross-compilation guess.
* modules/iswdigit (Files): Add m4/locale-en.m4.
* doc/posix-functions/iswdigit.texi: Update list of platforms.

7 months agoPrepare for stronger LC_CTYPE tests on OpenBSD, Android, Haiku.
Bruno Haible [Sat, 31 Aug 2024 17:22:37 +0000 (19:22 +0200)]
Prepare for stronger LC_CTYPE tests on OpenBSD, Android, Haiku.

* m4/locale-en.m4: New file, based on m4/locale-fr.m4.
* m4/locale-ar.m4 (gt_LOCALE_AR): Update comments.
* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
* m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.

7 months agotrim, unicodeio tests: Fix module description.
Bruno Haible [Sat, 31 Aug 2024 16:23:33 +0000 (18:23 +0200)]
trim, unicodeio tests: Fix module description.

* modules/trim-tests (configure.ac): Invoke the respective gt_LOCALE_*
macros.
* modules/unicodeio-tests (Makefile.am): Augment TESTS_ENVIRONMENT.

7 months agombrtoc32: Fix a cross-compilation guess.
Bruno Haible [Sat, 31 Aug 2024 11:57:39 +0000 (13:57 +0200)]
mbrtoc32: Fix a cross-compilation guess.

* m4/mbrtoc32.m4 (gl_MBRTOC32_UTF8_LOCALE): Guess no on Cygwin.

7 months agomkfifoat: Work around a Haiku bug.
Bruno Haible [Fri, 30 Aug 2024 23:28:32 +0000 (01:28 +0200)]
mkfifoat: Work around a Haiku bug.

* lib/mknodat.c (rpl_mknodat): On Haiku, handle S_IFIFO explicitly.
* doc/posix-functions/mknodat.texi: Mention the S_IFIFO flag bug.

7 months agoposix_openpt tests: Fix test failure on Haiku.
Bruno Haible [Fri, 30 Aug 2024 21:48:44 +0000 (23:48 +0200)]
posix_openpt tests: Fix test failure on Haiku.

* tests/test-posix_openpt.c (main): On Haiku, create a child process and
call setsid().

7 months agosigsegv: Clarify license of the *.m4 files.
Bruno Haible [Fri, 30 Aug 2024 11:41:14 +0000 (13:41 +0200)]
sigsegv: Clarify license of the *.m4 files.

* m4/sigaltstack.m4: In the license notice, clarify which version of the
GPL is meant.
* m4/stack-direction.m4: Likewise.

7 months agognulib-tool: Fix description of --lgpl option (missed on 2021-06-04).
Bruno Haible [Thu, 29 Aug 2024 15:49:33 +0000 (17:49 +0200)]
gnulib-tool: Fix description of --lgpl option (missed on 2021-06-04).

* gnulib-tool.sh (func_usage): Remove "Also modify license template"
sentence.
* pygnulib/GLInfo.py (GLInfo.usage): Likewise.

7 months agoobstack-printf-gnu: Fix mistake (reported by check-AC_LIBOBJ).
Bruno Haible [Thu, 29 Aug 2024 14:07:24 +0000 (16:07 +0200)]
obstack-printf-gnu: Fix mistake (reported by check-AC_LIBOBJ).

* modules/obstack-printf-gnu (Files): Add lib/obstack_printf.c.

7 months agoavoid GCC -Wmaybe-uninitialized false positives with LTO
Pádraig Brady [Wed, 28 Aug 2024 11:10:43 +0000 (12:10 +0100)]
avoid GCC -Wmaybe-uninitialized false positives with LTO

Avoids false warnings with GCC 14.2.1 with -flto

* lib/canonicalize.c: Initialize END_IDX.
* lib/getndelim2.c: Initialize C.

7 months agothreads-h: Don't override the C++ keyword 'thread_local'.
Bruno Haible [Wed, 28 Aug 2024 15:03:39 +0000 (17:03 +0200)]
threads-h: Don't override the C++ keyword 'thread_local'.

* lib/threads.in.h (thread_local): Don't define as a macro in C++ 11
or newer.

7 months agomcel: Fix compilation error with MSVC.
Bruno Haible [Tue, 27 Aug 2024 22:34:53 +0000 (00:34 +0200)]
mcel: Fix compilation error with MSVC.

* modules/builtin-expect (Description): Improve.
* m4/builtin-expect.m4: Improve comment.
* modules/mcel (Depends-on): Add builtin-expect.

7 months agosimple-atomic: Fix a clang warning on native Windows.
Bruno Haible [Tue, 27 Aug 2024 21:01:33 +0000 (23:01 +0200)]
simple-atomic: Fix a clang warning on native Windows.

* lib/simple-atomic.c (atomic_compare_and_swap_ptr): Add a cast.

7 months agowrite-any-file: Don't reference an undefined function on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:50:05 +0000 (22:50 +0200)]
write-any-file: Don't reference an undefined function on native Windows.

* m4/write-any-file.m4 (gl_WRITE_ANY_FILE): Remove test for <priv.h>,
obsolete since 2009-05-03. Test for geteuid.
* lib/write-any-file.c (geteuid): Define a fallback.

7 months agomkdir-p: Don't reference an undefined function on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:28:36 +0000 (22:28 +0200)]
mkdir-p: Don't reference an undefined function on native Windows.

* m4/mkdir-p.m4 (gl_MKDIR_PARENTS): Test whether fchown exists.
* lib/dirchownmod.c (fchown): Define to a fallback if the system does
not have fchown.
(dirchownmod): Test HAVE_FCHOWN.

7 months agogetusershell: Don't completely ignore lines that contain a comment.
Bruno Haible [Tue, 27 Aug 2024 20:17:18 +0000 (22:17 +0200)]
getusershell: Don't completely ignore lines that contain a comment.

* lib/getusershell.c (getusershell): Truncate the line where a comment
starts, instead of ignoring the line entirely.

7 months agofts: Don't assume that a pointer is as wide as a 'long'.
Bruno Haible [Tue, 27 Aug 2024 20:08:00 +0000 (22:08 +0200)]
fts: Don't assume that a pointer is as wide as a 'long'.

* lib/fts.c (fts_sort): Cast pointers to 'uintptr_t', not to 'long'.

7 months agomkdir: Fix for use of posixcheck module on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:00:54 +0000 (22:00 +0200)]
mkdir: Fix for use of posixcheck module on native Windows.

* lib/sys_stat.in.h (mkdir): Give priority to the native Windows
definition over the GNULIB_POSIXCHECK redefinition.

7 months agowindows-spawn: Fix clang warning.
Bruno Haible [Tue, 27 Aug 2024 19:43:36 +0000 (21:43 +0200)]
windows-spawn: Fix clang warning.

* lib/windows-spawn.c (convert_CreateProcess_error): Remove unreachable
'break;' statements.

7 months agoImprove support for clang on Windows.
Bruno Haible [Tue, 27 Aug 2024 19:40:15 +0000 (21:40 +0200)]
Improve support for clang on Windows.

* lib/c++defs.h (_GL_CXXALIASWARN_2): Treat clang like gcc 4.2.
* lib/stdio.in.h (fwrite, fwrite_unlocked): Likewise.
* lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): Likewise.
* lib/libc-config.h (__GNUC_PREREQ): Override glibc's definition to
handle clang in disguise.

7 months agoExplicitly exclude clang when we test for a GCC version >= 4.3.
Bruno Haible [Tue, 27 Aug 2024 14:20:16 +0000 (16:20 +0200)]
Explicitly exclude clang when we test for a GCC version >= 4.3.

Rationale: clang can disguise as any possible GCC version.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__,
exclude clang.
* lib/_Noreturn.h (_Noreturn): Likewise.
* lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise.
* lib/base32.h: Likewise.
* lib/base64.h: Likewise.
* lib/dfa.c (FALLTHROUGH): Likewise.
* lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise.
* lib/intprops-internal.h: Likewise.
* lib/jit/cache.h (clear_cache): Likewise.
* lib/malloc.in.h (memalign): Likewise.
* lib/mcel.h: Likewise.
* lib/regex.h: Likewise.
* lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile):
Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc,
canonicalize_file_name, malloc, realloc): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise.
* lib/verify.h: Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise.
* lib/xalloc-oversized.h (xalloc_oversized): Likewise.
* lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR,
_FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different
builtins for clang.
* lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude
clang. Enable for clang >= 4.
* lib/astrxfrm.c: Use _GL_GNUC_PREREQ.
* lib/readutmp.c: Likewise.
* lib/strftime.c: Likewise.
* tests/test-asyncsafe-linked_list-strong.c: Likewise.
* tests/test-asyncsafe-linked_list-weak.c: Likewise.
* tests/test-c-strtod-mt.c: Likewise.
* tests/test-c-strtof-mt.c: Likewise.
* tests/test-c-strtold-mt.c: Likewise.
* tests/test-gmtime_r-mt.c: Likewise.
* tests/test-intprops.c: Likewise.
* tests/test-limits-h.c: Likewise.
* tests/test-localtime_r-mt.c: Likewise.
* tests/test-memrchr.c: Likewise.
* tests/test-nl_langinfo-mt.c: Likewise.
* tests/test-setlocale_null-mt-all.c: Likewise.
* tests/test-setlocale_null-mt-one.c: Likewise.
* tests/test-statat.c: Likewise.
* tests/test-xvasprintf.c: Likewise.

7 months agoreadutmp: In systemd mode, show sessions of type "web".
Bruno Haible [Tue, 27 Aug 2024 09:46:33 +0000 (11:46 +0200)]
readutmp: In systemd mode, show sessions of type "web".

Reported by Allison Karlitskaya <allison.karlitskaya@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00160.html>.

* lib/readutmp.c (read_utmp_from_systemd): For a systemd session of type
"web", add a single USER_PROCESS entry.

7 months agoFix a test failure from a clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 22:49:07 +0000 (00:49 +0200)]
Fix a test failure from a clang that masquerades as gcc 13.

* tests/test-fenv-except-trapping-2.c (main): Skip the '4' test on
clang, since clang 17 still generates buggy comparisons, like gcc
versions < 8.

7 months agoFix some of the warnings from a clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 22:19:14 +0000 (00:19 +0200)]
Fix some of the warnings from a clang that masquerades as gcc 13.

* lib/c-stack.c: Use _GL_GNUC_PREREQ to test for the gcc version.
* lib/canonicalize.c: Likewise.
* lib/diffseq.h: Likewise.
* lib/file-has-acl.c: Likewise.
* lib/freopen-safer.c: Likewise.
* lib/getndelim2.c: Likewise.
* lib/mini-gmp-gnulib.c: Likewise.
* lib/propername.c: Likewise.
* lib/quotearg.c: Likewise.
* lib/savedir.c: Likewise.
* lib/vasnprintf.c: Likewise.
* tests/test-argmatch.c: Likewise.
* tests/test-dup2.c: Likewise.
* tests/test-explicit_bzero.c: Likewise.
* tests/test-fcntl.c: Likewise.
* tests/test-fopen.h: Likewise.
* tests/test-getdtablesize.c: Likewise.
* tests/test-getgroups.c: Likewise.
* tests/test-listen.c: Likewise.
* tests/test-localename.c: Likewise.
* tests/test-memset_explicit.c: Likewise.
* tests/test-open.h: Likewise.
* tests/test-perror2.c: Likewise.
* tests/test-select.h: Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD): Don't use
gnu_printf with clang.
* lib/string-buffer.h: Likewise.
* lib/textstyle.in.h: Likewise.

7 months agoFix compilation errors with clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 19:13:50 +0000 (21:13 +0200)]
Fix compilation errors with clang that masquerades as gcc 13.

Reported by Sam James and Paul Eggert.

* m4/gnulib-common.m4 (gl_COMMON_BODY): For _GL_GNUC_PREREQ, ignore the
values of __GNUC__ and __GNUC_MINOR__ defined by clang.
* lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): Don't treat
clang like GCC.
* lib/wchar.in.h (wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr): Disable
the _GL_CXXALIASWARN1 and _GL_CXXALIASWARN invocations for masquerading
clang++.

7 months agorelocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64.
Bruno Haible [Sat, 24 Aug 2024 14:33:05 +0000 (16:33 +0200)]
relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64.

Reference: <https://savannah.gnu.org/patch/?10469>.

* build-aux/config.libpath: Accept a second argument. Use it on
FreeBSD/powerpc64.
(func_usage): Document it.
* m4/relocatable.m4 (AC_LIB_LIBPATH): Require gl_HOST_CPU_C_ABI_32BIT.
Pass HOST_CPU_C_ABI_32BIT to the config.libpath script.
* modules/relocatable-prog (Files): Add m4/host-cpu-c-abi.m4.

7 months agodiffseq: port to GCC 14.2.1 in ‘patch’
Paul Eggert [Fri, 23 Aug 2024 20:50:32 +0000 (13:50 -0700)]
diffseq: port to GCC 14.2.1 in ‘patch’

* lib/diffseq.h: Also suppress -Wanalyzer-use-of-uninitialized-value.
This fixes an unwanted diagnostic when compiling GNU ‘patch’
with gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1) x86-64.

7 months agomcel: port to uClibc-ng
Paul Eggert [Thu, 22 Aug 2024 06:00:38 +0000 (23:00 -0700)]
mcel: port to uClibc-ng

Problem reported by Waldemar Brodkorb in:
https://lists.gnu.org/r/bug-gnulib/2024-08/msg00130.html
* lib/mcel.h (mcel_scan): Don’t treat uClibc-ng like glibc.

7 months agostdio: Fix compilation error in C++ mode on Linux/riscv64 with musl.
Bruno Haible [Wed, 21 Aug 2024 21:22:26 +0000 (23:22 +0200)]
stdio: Fix compilation error in C++ mode on Linux/riscv64 with musl.

* lib/stdio.in.h (fpurge): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

7 months agolock: Fix pthread-rwlock crashes with clang (regr. 2024-08-07).
Bruno Haible [Sat, 17 Aug 2024 13:07:59 +0000 (15:07 +0200)]
lock: Fix pthread-rwlock crashes with clang (regr. 2024-08-07).

* lib/glthread/lock.h: Don't mark pthread_rwlock_init,
pthread_rwlockattr_init as weak if we are overriding them.

7 months agogitsub.sh: For a submodule, merge from the right remote branch.
Bruno Haible [Fri, 16 Aug 2024 20:07:19 +0000 (22:07 +0200)]
gitsub.sh: For a submodule, merge from the right remote branch.

Reported by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> at
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00101.html>.

* top/gitsub.sh (func_upgrade): For a submodule, use 'git branch' to
determine the branch to merge from, instead of assuming that it is
always the 'master' branch.

7 months agognulib-tool.py: Don't treat 'valgrind-tests' as a tests module.
Bruno Haible [Fri, 16 Aug 2024 15:57:02 +0000 (17:57 +0200)]
gnulib-tool.py: Don't treat 'valgrind-tests' as a tests module.

Reported by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00093.html>.

* pygnulib/GLModuleSystem.py (_isTestsModuleName): New function.
(GLModuleSystem.list, GLModule.isNonTests, GLModule.getApplicability,
GLModule.getDependencies, GLModule.getAutomakeSnippet_Unconditional,
GLModule.getLicense): Use it.

8 months agotests: Fix link errors (regression 2024-08-12).
Bruno Haible [Wed, 14 Aug 2024 14:14:27 +0000 (16:14 +0200)]
tests: Fix link errors (regression 2024-08-12).

* modules/chown-tests (Makefile.am): Link test-chown with LIBINTL.
* modules/lchown-tests (Makefile.am): Link test-lchown with LIBINTL.
* modules/stat-time-tests (Makefile.am): Link test-stat-time with
LIBINTL.

8 months agombrtoc16: Fix compilation error on Haiku.
Bruno Haible [Tue, 13 Aug 2024 06:38:22 +0000 (08:38 +0200)]
mbrtoc16: Fix compilation error on Haiku.

* lib/uchar.in.h (mbrtoc16): Fix typo.

8 months agofdutimensat, utimensat tests: Fix test failures on Cygwin.
Bruno Haible [Mon, 12 Aug 2024 14:15:50 +0000 (16:15 +0200)]
fdutimensat, utimensat tests: Fix test failures on Cygwin.

* tests/nap.h: Include concat-filename.h, xgetcwd.h.
(nap_file): New variable.
(nap_get_stat, clear_temp_file): Use nap_file, not TEMPFILE.
(nap): Initialize nap_file.
* modules/chown-tests (Depends-on): Add xconcat-filename, 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.

8 months agoMake sure gperf-generated files are the same in VPATH builds.
Bruno Haible [Sat, 10 Aug 2024 10:48:55 +0000 (12:48 +0200)]
Make sure gperf-generated files are the same in VPATH builds.

Reported by Patrice Dumas <pertusus@free.fr> in
<https://lists.gnu.org/archive/html/bug-texinfo/2024-08/msg00030.html>.

* modules/iconv_open (Makefile.am): Eliminate directory names from the
generated iconv_open-aix.h, iconv_open-hpux.h, iconv_open-irix.h,
iconv_open-osf.h, iconv_open-solaris.h, iconv_open-zos.h.
* modules/unicase/locale-language (Makefile.am): Eliminate directory
names from the generated unicase/locale-languages.h.
* modules/unicase/special-casing (Makefile.am): Eliminate directory
names from the generated unicase/special-casing-table.h.
* modules/unictype/bidiclass-byname (Makefile.am): Eliminate directory
names from the generated unictype/bidi_byname.h.
* modules/unictype/category-byname (Makefile.am): Eliminate directory
names from the generated unictype/categ_byname.h.
* modules/unictype/combining-class-byname (Makefile.am): Eliminate
directory names from the generated unictype/combiningclass_byname.h.
* modules/unictype/incb-byname (Makefile.am): Eliminate directory names
from the generated unictype/incb_byname.h.
* modules/unictype/joininggroup-byname (Makefile.am): Eliminate
directory names from the generated unictype/joininggroup_byname.h.
* modules/unictype/joiningtype-byname (Makefile.am): Eliminate directory
names from the generated unictype/joiningtype_byname.h.
* modules/unictype/property-byname (Makefile.am): Eliminate directory
names from the generated unictype/pr_byname.h.
* modules/unictype/scripts (Makefile.am): Eliminate directory names from
the generated unictype/scripts_byname.h.
* modules/uninorm/composition (Makefile.am): Eliminate directory names
from the generated uninorm/composition-table.h.

8 months agotest-utime: port to noatime file systems
Paul Eggert [Fri, 9 Aug 2024 21:03:44 +0000 (14:03 -0700)]
test-utime: port to noatime file systems

Problem encountered on Ubuntu 24.04 zfs mounted noatime.
* tests/test-fdutimensat.c (main):
* tests/test-futimens.h (test_futimens):
* tests/test-lutimens.h (test_lutimens):
* tests/test-utime.c (test_utime):
* tests/test-utimens-common.h (checkable_atime): New function.
* tests/test-utimens.h (test_utimens):
* tests/test-utimensat.c (main):
Do not check atime on file systems mounted noatime.

8 months agoAvoid compiler warnings in some configure tests.
Bruno Haible [Wed, 7 Aug 2024 22:54:03 +0000 (00:54 +0200)]
Avoid compiler warnings in some configure tests.

* m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Allocate more room for local
array 'name'.
* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Don't
pass a NULL pointer to pthread_mutex_timedlock.

8 months agopthread-rwlock: Fix default wait queue behaviour on glibc/Linux.
Bruno Haible [Wed, 7 Aug 2024 17:53:37 +0000 (19:53 +0200)]
pthread-rwlock: Fix default wait queue behaviour on glibc/Linux.

* lib/pthread.in.h: If REPLACE_PTHREAD_RWLOCK_INIT is 1 but
REPLACE_PTHREAD_RWLOCK_DESTROY is 0, override
PTHREAD_RWLOCK_INITIALIZER.
* lib/pthread-rwlock.c
(pthread_rwlockattr_init) [PTHREAD_RWLOCK_BAD_WAITQUEUE]: New function.
(pthread_rwlock_init) [PTHREAD_RWLOCK_BAD_WAITQUEUE]: New function.
* m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Check for reasonable
pthread_rwlock wait queue handling. Set REPLACE_PTHREAD_RWLOCK_INIT and
REPLACE_PTHREAD_RWLOCKATTR_INIT and define PTHREAD_RWLOCK_BAD_WAITQUEUE
if not.
* modules/pthread-rwlock (configure.ac): Update
GL_COND_OBJ_PTHREAD_RWLOCK condition.
* doc/posix-functions/pthread_rwlock_rdlock.texi: Mark the glibc problem
as fixed.
* doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.

8 months agofchmodat: Fix cross-compilation guess.
Bruno Haible [Wed, 7 Aug 2024 10:21:05 +0000 (12:21 +0200)]
fchmodat: Fix cross-compilation guess.

* m4/fchmodat.m4 (gl_FUNC_FCHMODAT): Tolerate Linux version number
in $host_os.

8 months agowindows-mutex, windows-timedmutex: Follow pthread_mutex_trylock spec.
Bruno Haible [Tue, 6 Aug 2024 13:14:25 +0000 (15:14 +0200)]
windows-mutex, windows-timedmutex: Follow pthread_mutex_trylock spec.

* lib/windows-mutex.h (glwthread_mutex_t): Add 'owner' field.
* lib/windows-mutex.c: Include <stdlib.h>.
(glwthread_mutex_lock): Set the 'owner' field after entering the
critical section.
(glwthread_mutex_trylock): Detect whether the lock was previously locked
by this thread. Set the 'owner' field after entering the critical
section.
(glwthread_mutex_unlock): Clear the 'owner' field before leaving the
critical section.
* lib/windows-timedmutex.h (glwthread_timedmutex_t): Add 'owner' field.
* lib/windows-timedmutex.c: (glwthread_timedmutex_lock): Set the 'owner'
field after entering the critical section.
(glwthread_timedmutex_trylock): Detect whether the lock was previously
locked by this thread. Set the 'owner' field after entering the critical
section.
(glwthread_timedmutex_unlock): Clear the 'owner' field before leaving
the critical section.

8 months agognulib-tool.py: Fix testdirs created with --without-tests.
Bruno Haible [Mon, 5 Aug 2024 18:24:44 +0000 (20:24 +0200)]
gnulib-tool.py: Fix testdirs created with --without-tests.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't assume that 'gltests'
is the last subdirectory with a configure.ac.

8 months agodfa-tests: Detect test-dfa-match-aux error.
Bernhard Voelker [Sun, 4 Aug 2024 16:14:32 +0000 (18:14 +0200)]
dfa-tests: Detect test-dfa-match-aux error.

* tests/test-dfa-invalid-merge.sh: Set fail=1 if test-dfa-match-aux fails.
Remove redundant 'returns_ 0'.

8 months agotest-framework-sh: Improve returns_ example.
Bernhard Voelker [Sun, 4 Aug 2024 16:12:16 +0000 (18:12 +0200)]
test-framework-sh: Improve returns_ example.

In the shell test framework, an error is either flagged by setting
the shell variable fail=1, or by invoking the fail_ function with an
error diagnostic.

* tests/init.sh (returns_): Change example code in the comment to
use '|| fail=1' properly.

8 months agovaszprintf-posix tests: Fix a gcc warning.
Bruno Haible [Tue, 30 Jul 2024 01:14:00 +0000 (03:14 +0200)]
vaszprintf-posix tests: Fix a gcc warning.

* tests/test-vaszprintf-posix.c (test_function): Remove an unused
variable.

8 months agoFix misspelling of __clang_major__.
Bruno Haible [Mon, 29 Jul 2024 19:59:44 +0000 (21:59 +0200)]
Fix misspelling of __clang_major__.

* lib/cdefs.h (__THROW, __THROWNL, __NTH, __NTHNL): Fix misspelled macro
name.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
* lib/malloc.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stddef.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/sys_stat.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.

8 months agochdir: Fix mistake in GNULIB_POSIXCHECK.
Bruno Haible [Mon, 29 Jul 2024 18:21:06 +0000 (20:21 +0200)]
chdir: Fix mistake in GNULIB_POSIXCHECK.

* lib/unistd.in.h: Don't attach the chdir warning to the 'chown'
function.

8 months agoatoll: Fix module dependencies.
Bruno Haible [Mon, 29 Jul 2024 18:17:06 +0000 (20:17 +0200)]
atoll: Fix module dependencies.

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

8 months agognulib-tool.py: Fix an exception message.
Bruno Haible [Sun, 28 Jul 2024 21:38:45 +0000 (23:38 +0200)]
gnulib-tool.py: Fix an exception message.

* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Raise error 23,
not 3.
* pygnulib/GLError.py: Provide an error message for error 23.
* pygnulib/main.py: Likewise.

8 months agoautoupdate
Paul Eggert [Sun, 28 Jul 2024 20:07:43 +0000 (13:07 -0700)]
autoupdate

8 months agosys_time, sys_types: Remove sys directory at 'make mostlyclean'.
Collin Funk [Sat, 27 Jul 2024 01:37:09 +0000 (18:37 -0700)]
sys_time, sys_types: Remove sys directory at 'make mostlyclean'.

* modules/sys_time (Makefile.am): Add sys to MOSTLYCLEANDIRS.
* modules/sys_types (Makefile.am): Likewise.

8 months agoAvoid false select_used_without_requesting_gnulib_module_select.
Bruno Haible [Wed, 24 Jul 2024 23:29:22 +0000 (01:29 +0200)]
Avoid false select_used_without_requesting_gnulib_module_select.

* modules/select (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_select.in.h (select): Don't define to
select_used_without_requesting_gnulib_module_select if the gnulib module
'select' is in use under the same configure.ac.

8 months agoAvoid false shutdown_used_without_requesting_gnulib_module_shutdown.
Bruno Haible [Wed, 24 Jul 2024 23:27:32 +0000 (01:27 +0200)]
Avoid false shutdown_used_without_requesting_gnulib_module_shutdown.

* modules/shutdown (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (shutdown): Don't define to
shutdown_used_without_requesting_gnulib_module_shutdown if the gnulib
module 'shutdown' is in use under the same configure.ac.

8 months agoAvoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:23:52 +0000 (01:23 +0200)]
Avoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.

* modules/setsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (setsockopt): Don't define to
setsockopt_used_without_requesting_gnulib_module_setsockopt if the
gnulib module 'setsockopt' is in use under the same configure.ac.

8 months agoAvoid false sendto_used_without_requesting_gnulib_module_sendto.
Bruno Haible [Wed, 24 Jul 2024 23:21:45 +0000 (01:21 +0200)]
Avoid false sendto_used_without_requesting_gnulib_module_sendto.

* modules/sendto (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (sendto): Don't define to
sendto_used_without_requesting_gnulib_module_sendto if the gnulib module
'sendto' is in use under the same configure.ac.

8 months agoAvoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.
Bruno Haible [Wed, 24 Jul 2024 23:19:20 +0000 (01:19 +0200)]
Avoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.

* modules/recvfrom (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recvfrom): Don't define to
recvfrom_used_without_requesting_gnulib_module_recvfrom if the gnulib
module 'recvfrom' is in use under the same configure.ac.

8 months agoAvoid false send_used_without_requesting_gnulib_module_send.
Bruno Haible [Wed, 24 Jul 2024 23:17:33 +0000 (01:17 +0200)]
Avoid false send_used_without_requesting_gnulib_module_send.

* modules/send (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (send): Don't define to
send_used_without_requesting_gnulib_module_send if the gnulib module
'send' is in use under the same configure.ac.

8 months agoAvoid false recv_used_without_requesting_gnulib_module_recv.
Bruno Haible [Wed, 24 Jul 2024 23:16:05 +0000 (01:16 +0200)]
Avoid false recv_used_without_requesting_gnulib_module_recv.

* modules/recv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recv): Don't define to
recv_used_without_requesting_gnulib_module_recv if the gnulib module
'recv' is in use under the same configure.ac.

8 months agoAvoid false listen_used_without_requesting_gnulib_module_listen.
Bruno Haible [Wed, 24 Jul 2024 23:14:25 +0000 (01:14 +0200)]
Avoid false listen_used_without_requesting_gnulib_module_listen.

* modules/listen (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (listen): Don't define to
listen_used_without_requesting_gnulib_module_listen if the gnulib module
'listen' is in use under the same configure.ac.

8 months agoAvoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:12:43 +0000 (01:12 +0200)]
Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.

* modules/getsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockopt): Don't define to
getsockopt_used_without_requesting_gnulib_module_getsockopt if the
gnulib module 'getsockopt' is in use under the same configure.ac.

8 months agoAvoid false getsockname_used_without_requesting_gnulib_module_getsockname.
Bruno Haible [Wed, 24 Jul 2024 22:53:05 +0000 (00:53 +0200)]
Avoid false getsockname_used_without_requesting_gnulib_module_getsockname.

* modules/getsockname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockname): Don't define to
getsockname_used_without_requesting_gnulib_module_getsockname if the
gnulib module 'getsockname' is in use under the same configure.ac.

8 months agoAvoid false getpeername_used_without_requesting_gnulib_module_getpeername.
Bruno Haible [Wed, 24 Jul 2024 22:51:27 +0000 (00:51 +0200)]
Avoid false getpeername_used_without_requesting_gnulib_module_getpeername.

* modules/getpeername (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getpeername): Don't define to
getpeername_used_without_requesting_gnulib_module_getpeername if the
gnulib module 'getpeername' is in use under the same configure.ac.

8 months agoAvoid false bind_used_without_requesting_gnulib_module_bind.
Bruno Haible [Wed, 24 Jul 2024 22:49:21 +0000 (00:49 +0200)]
Avoid false bind_used_without_requesting_gnulib_module_bind.

* modules/bind (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (bind): Don't define to
bind_used_without_requesting_gnulib_module_bind if the gnulib module
'bind' is in use under the same configure.ac.

8 months agoAvoid false accept_used_without_requesting_gnulib_module_accept.
Bruno Haible [Wed, 24 Jul 2024 22:47:45 +0000 (00:47 +0200)]
Avoid false accept_used_without_requesting_gnulib_module_accept.

* modules/accept (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (accept): Don't define to
accept_used_without_requesting_gnulib_module_accept if the gnulib module
'accept' is in use under the same configure.ac.

8 months agoAvoid false socket_used_without_requesting_gnulib_module_connect.
Bruno Haible [Wed, 24 Jul 2024 22:41:00 +0000 (00:41 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_connect.

* modules/connect (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (connect): Don't define to
socket_used_without_requesting_gnulib_module_connect if the gnulib
module 'connect' is in use under the same configure.ac. Fix typo.

8 months agoAvoid false socket_used_without_requesting_gnulib_module_socket.
Bruno Haible [Wed, 24 Jul 2024 22:38:08 +0000 (00:38 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_socket.

* modules/socket (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (socket): Don't define to
socket_used_without_requesting_gnulib_module_socket if the gnulib module
'socket' is in use under the same configure.ac.

8 months agoAvoid false lstat_used_without_requesting_gnulib_module_lstat.
Bruno Haible [Wed, 24 Jul 2024 22:36:01 +0000 (00:36 +0200)]
Avoid false lstat_used_without_requesting_gnulib_module_lstat.

* modules/lstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (lstat): Don't define to
lstat_used_without_requesting_gnulib_module_lstat if the gnulib module
'lstat' is in use under the same configure.ac.

8 months agoAvoid false fstatat_used_without_requesting_gnulib_module_fstatat.
Bruno Haible [Wed, 24 Jul 2024 22:34:09 +0000 (00:34 +0200)]
Avoid false fstatat_used_without_requesting_gnulib_module_fstatat.

* modules/fstatat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstatat): Don't define to
fstatat_used_without_requesting_gnulib_module_fstatat if the gnulib
module 'fstatat' is in use under the same configure.ac.

8 months agoAvoid false fstat_used_without_requesting_gnulib_module_fstat.
Bruno Haible [Wed, 24 Jul 2024 22:32:26 +0000 (00:32 +0200)]
Avoid false fstat_used_without_requesting_gnulib_module_fstat.

* modules/fstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstat): Don't define to
fstat_used_without_requesting_gnulib_module_fstat if the gnulib module
'fstat' is in use under the same configure.ac.

8 months agoAvoid false stat_used_without_requesting_gnulib_module_stat.
Bruno Haible [Wed, 24 Jul 2024 22:30:26 +0000 (00:30 +0200)]
Avoid false stat_used_without_requesting_gnulib_module_stat.

* modules/stat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (stat): Don't define to
stat_used_without_requesting_gnulib_module_stat if the gnulib module
'stat' is in use under the same configure.ac.

8 months agoAvoid false ioctl_used_without_requesting_gnulib_module_ioctl.
Bruno Haible [Wed, 24 Jul 2024 21:59:15 +0000 (23:59 +0200)]
Avoid false ioctl_used_without_requesting_gnulib_module_ioctl.

* modules/ioctl (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_ioctl.in.h (ioctl): Don't define to
ioctl_used_without_requesting_gnulib_module_ioctl if the gnulib module
'ioctl' is in use under the same configure.ac.

8 months agoAvoid false localeconv_used_without_requesting_gnulib_module_localeconv.
Bruno Haible [Wed, 24 Jul 2024 21:56:33 +0000 (23:56 +0200)]
Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.

* modules/localeconv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/locale.in.h (localeconv): Don't define to
localeconv_used_without_requesting_gnulib_module_localeconv if the
gnulib module 'localeconv' is in use under the same configure.ac.

8 months agoAvoid false gethostname_used_without_requesting_gnulib_module_gethostname.
Bruno Haible [Wed, 24 Jul 2024 21:53:53 +0000 (23:53 +0200)]
Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.

* modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (gethostname): Don't define to
gethostname_used_without_requesting_gnulib_module_gethostname if the
gnulib module 'gethostname' is in use under the same configure.ac.

8 months agoAvoid false error close_used_without_requesting_gnulib_module_close.
Bruno Haible [Wed, 24 Jul 2024 21:35:53 +0000 (23:35 +0200)]
Avoid false error close_used_without_requesting_gnulib_module_close.

Reported by Frédéric at <https://savannah.gnu.org/bugs/?65958>.

* modules/close (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (close): Don't define to
close_used_without_requesting_gnulib_module_close if the gnulib module
'close' is in use under the same configure.ac.

8 months agogetopt-posix, getopt-gnu tests: Avoid test failure on mingw.
Bruno Haible [Wed, 24 Jul 2024 00:02:45 +0000 (02:02 +0200)]
getopt-posix, getopt-gnu tests: Avoid test failure on mingw.

* tests/test-getopt.h (test_getopt): Don't special-case mingw.

8 months agostrtod: Revisit underflow behaviour.
Bruno Haible [Tue, 23 Jul 2024 10:40:37 +0000 (12:40 +0200)]
strtod: Revisit underflow behaviour.

* doc/posix-functions/strtod.texi: Mention the macOS bug. Mention that
gradual underflow does not count as an error on Cygwin 2.9 and MSVC.
* m4/strtod.m4 (gl_FUNC_STRTOD): Update comment.
* tests/test-strtod.h (test_function): Add a gradual underflow test.
Check the sign in case of flush-to-zero underflow.

8 months agostrtof: Revisit underflow behaviour.
Bruno Haible [Tue, 23 Jul 2024 10:40:33 +0000 (12:40 +0200)]
strtof: Revisit underflow behaviour.

* doc/posix-functions/strtof.texi: Mention the macOS bug. Mention the
mingw overflow bug. Mention the underflow bugs on Cygwin 2.9 and mingw.
Mention that gradual underflow does not count as an error on Cygwin 2.9,
mingw, MSVC.
* m4/strtof.m4 (gl_FUNC_STRTOF): Test against the mingw overflow bug.
* tests/test-strtof.h (test_function): Add a gradual underflow test.
Check the sign in case of flush-to-zero underflow.

8 months agostrtof, strtod, strtold: Fix underflow behaviour of system function.
Bruno Haible [Tue, 23 Jul 2024 10:40:19 +0000 (12:40 +0200)]
strtof, strtod, strtold: Fix underflow behaviour of system function.

* m4/strtof.m4 (gl_FUNC_STRTOF): Test for strtof's behaviour upon
underflow. Conditionally define STRTOF_HAS_UNDERFLOW_BUG,
STRTOF_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* m4/strtod.m4 (gl_FUNC_STRTOD): Test for strtod's behaviour upon
underflow. Conditionally define STRTOD_HAS_UNDERFLOW_BUG,
STRTOD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Test for strtold's behaviour upon
gradual underflow. Conditionally define
STRTOLD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Test STRTOF_HAS_UNDERFLOW_BUG,
STRTOD_HAS_UNDERFLOW_BUG.
(HAS_GRADUAL_UNDERFLOW_PROBLEM): New macro.
(SET_ERRNO_UPON_GRADUAL_UNDERFLOW): New macro.
(STRTOD): Use it.

8 months agostrtof: Use the system's strtof() if available.
Bruno Haible [Tue, 23 Jul 2024 10:40:15 +0000 (12:40 +0200)]
strtof: Use the system's strtof() if available.

* m4/strtof.m4 (gl_FUNC_STRTOF): Define HAVE_STRTOF if strtof exists.

8 months agostrtof, strtod, strtold: Set errno upon gradual underflow.
Bruno Haible [Tue, 23 Jul 2024 08:39:28 +0000 (10:39 +0200)]
strtof, strtod, strtold: Set errno upon gradual underflow.

* lib/strtod.c (scale_radix_exp): If the result is a denormalized
number, set errno to ERANGE.

8 months agobootstrap: Avoid failure when gnulib-tool removed gettext.m4.
Bruno Haible [Sun, 21 Jul 2024 12:02:58 +0000 (14:02 +0200)]
bootstrap: Avoid failure when gnulib-tool removed gettext.m4.

* top/bootstrap-funclib.sh (autogen): When gnulib-tool has removed
gettext.m4 but the package needs gettext.m4, repeat the autopoint and
gnulib-tool invocations.
* build-aux/bootstrap: Regenerated.

9 months agogetpayload*: Do use glibc's implementation when it works.
Bruno Haible [Sat, 20 Jul 2024 14:38:11 +0000 (16:38 +0200)]
getpayload*: Do use glibc's implementation when it works.

Reported by Andreas K. Huettel <dilfridge@gentoo.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00206.html>.

* m4/getpayload.m4 (gl_FUNC_GETPAYLOADF, gl_FUNC_GETPAYLOAD,
gl_FUNC_GETPAYLOADL): Link the test program with -lm if needed.

9 months agostrnlen: port to Android 5.0 (API 21)
Paul Eggert [Mon, 15 Jul 2024 21:14:55 +0000 (14:14 -0700)]
strnlen: port to Android 5.0 (API 21)

This is needed for GNU Emacs, which attempts to port to these
old Android versions.
* m4/strnlen.m4 (AC_FUNC_STRNLEN): Replace if Autoconf 2.72 or
earlier, with code that detects the Android problem with strnlen.
This version works around some further bugs in the test, notably,
misplaced 'volatile' and need for volatile in the AIX 4.3 bug
check too.

9 months agomanywarnings: Don't enable -Wsystem-headers.
Bruno Haible [Mon, 15 Jul 2024 21:02:58 +0000 (23:02 +0200)]
manywarnings: Don't enable -Wsystem-headers.

* build-aux/gcc-warning.spec: Add -Wsystem-headers.
* build-aux/g++-warning.spec: Likewise.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Don't enable
-Wsystem-headers.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL): Likewise.

9 months agoqcopy-acl: Fix copying of ACLs on CentOS 7 (regression 2023-01-12).
Bruno Haible [Mon, 15 Jul 2024 12:48:41 +0000 (14:48 +0200)]
qcopy-acl: Fix copying of ACLs on CentOS 7 (regression 2023-01-12).

* lib/qcopy-acl.c: Include <string.h>, <linux/xattr.h>.
(XATTR_NAME_NFSV4_ACL, XATTR_NAME_POSIX_ACL_ACCESS,
XATTR_NAME_POSIX_ACL_DEFAULT): New macros, from file-has-acl.c.
(is_attr_permissions): Test for these names explicitly.
* m4/acl.m4 (gl_QCOPY_ACL): New macro.
* modules/qcopy-acl (Files): Add m4/acl.m4.
(configure.ac): Invoke gl_QCOPY_ACL.

9 months agostdlib: Avoid syntax errors in libstdc++ header files.
Bruno Haible [Sun, 14 Jul 2024 18:45:46 +0000 (20:45 +0200)]
stdlib: Avoid syntax errors in libstdc++ header files.

* lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
strtoull gets defined as a macro.

9 months agoActivate strtold workarounds.
Bruno Haible [Sun, 14 Jul 2024 16:39:29 +0000 (18:39 +0200)]
Activate strtold workarounds.

* modules/c-strtold-tests (Depends-on): Add strtold.
* modules/ldtoastr (Depends-on): Add strtold.

9 months agostrtold: Work around major mingw bugs.
Bruno Haible [Sun, 14 Jul 2024 16:38:16 +0000 (18:38 +0200)]
strtold: Work around major mingw bugs.

* lib/strtod.c (HAVE_UNDERLYING_STRTOD) [USE_LONG_DOUBLE]: Set to 0 on
mingw versions before 10.0.
* doc/posix-functions/strtold.texi: Mention the mingw bugs.

9 months agostdlib: Support use of clang++ on Ubuntu.
Bruno Haible [Sat, 13 Jul 2024 22:53:57 +0000 (00:53 +0200)]
stdlib: Support use of clang++ on Ubuntu.

* lib/stdlib.in.h: Ignore __need_system_stdlib_h when GCC's
c++/11/stdlib.h is being included or has been included.

9 months agotimespec-sub: Fix compilation error on clang.
Pip Cet [Wed, 10 Jul 2024 15:56:34 +0000 (15:56 +0000)]
timespec-sub: Fix compilation error on clang.

Reported by Gerd Möllmann <gerd.moellmann@gmail.com> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72036>.

* lib/timespec-sub.c (timespec_sub): Use 'int' as type of variable.
Copyright-paperwork-exempt: Yes