]> Savannah Git Hosting - gnulib.git/log
gnulib.git
12 months agointprops: pacify GCC < 10 -Wsign-compare
Paul Eggert [Fri, 29 Mar 2024 22:56:45 +0000 (15:56 -0700)]
intprops: pacify GCC < 10 -Wsign-compare

Problem reported by Martin Dorey in:
https://savannah.gnu.org/bugs/index.php?65537
* lib/intprops-internal.h (_GL_INT_MULTIPLY_WRAPV):
When working around GCC bug 91450, pacify -Wsign-compare by
casting 0 to the result type.

12 months agoattribute: Work around compiler bug of Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 13:35:01 +0000 (14:35 +0100)]
attribute: Work around compiler bug of Oracle cc 12.6.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Expand _GL_ATTRIBUTE_PACKED to
empty on SunPRO C.

12 months agofenv-exceptions-state-c99: Fix test failures with Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 02:50:44 +0000 (03:50 +0100)]
fenv-exceptions-state-c99: Fix test failures with Oracle cc 12.6.

* lib/fenv-except-state-set.c (mask387cw): New function.
(fesetexceptflag): Use it on glibc.

12 months agomcel tests: Fix test failure with Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 01:14:21 +0000 (02:14 +0100)]
mcel tests: Fix test failure with Oracle cc 12.6.

* tests/test-mcel.c (main): Explicitly return 0 at the end.

12 months agopthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.
Bruno Haible [Thu, 28 Mar 2024 21:05:39 +0000 (22:05 +0100)]
pthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.

* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Define through AC_DEFUN_ONCE.
Require gl_PTHREAD_H_PART1, not gl_PTHREAD_H.
* m4/pthread_h.m4 (gl_PTHREAD_H_PART1): New macro, extracted from
gl_PTHREAD_H.
(gl_PTHREAD_H): Require it. Invoke gl_PTHREAD_SPIN.
* lib/pthread.in.h (pthread_spinlock_t,
GNULIB_defined_pthread_spin_types): Don't define if
HAVE_PTHREAD_SPIN_INIT && !REPLACE_PTHREAD_SPIN_INIT.
* modules/pthread-h (Files): Add m4/pthread-spin.m4.

12 months agohavelib: Recognize ELF platform despite SunPRO C on Linux.
Bruno Haible [Thu, 28 Mar 2024 16:50:55 +0000 (17:50 +0100)]
havelib: Recognize ELF platform despite SunPRO C on Linux.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Recognize Linux as an ELF
platform, even with the SunPRO C compiler that does not define __ELF__.

12 months agoobstack: Work around ICE with Oracle cc 12.6 (regr. 2023-12-01).
Bruno Haible [Wed, 27 Mar 2024 20:34:40 +0000 (21:34 +0100)]
obstack: Work around ICE with Oracle cc 12.6 (regr. 2023-12-01).

* lib/obstack.in.h (__PTR_ALIGN): Use SMALL_PTRDIFF_T, instead of
testing sizeof (ptrdiff_t) < sizeof (void *) at compile time.
* m4/obstack.m4 (gl_FUNC_OBSTACK): Set SMALL_PTRDIFF_T.
* modules/obstack (Makefile.am): Substitute SMALL_PTRDIFF_T.

13 months agogettime-res: Fix test failure on Solaris 11.4/SPARC.
Bruno Haible [Tue, 26 Mar 2024 11:12:23 +0000 (12:12 +0100)]
gettime-res: Fix test failure on Solaris 11.4/SPARC.

* lib/gettime-res.c (gettime_res): On Solaris/SPARC, just return 1 ns.

13 months agojit/cache: Fix a compilation error on Solaris 11.4/SPARC.
Bruno Haible [Tue, 26 Mar 2024 00:56:46 +0000 (01:56 +0100)]
jit/cache: Fix a compilation error on Solaris 11.4/SPARC.

* lib/jit/cache.h: On Solaris, include <stddef.h>.

13 months agognulib-tool: Don't remove comments referencing @NMD@, part 2.
Collin Funk [Sun, 10 Mar 2024 09:02:30 +0000 (01:02 -0800)]
gnulib-tool: Don't remove comments referencing @NMD@, part 2.

* gnulib-tool (func_emit_tests_Makefile_am): Replace lines that start
with @NMD@ or @!NMD@ instead of lines that contain them.

13 months agognulib-tool: Don't remove comments referencing @NMD@.
Collin Funk [Fri, 8 Mar 2024 10:28:11 +0000 (02:28 -0800)]
gnulib-tool: Don't remove comments referencing @NMD@.

* gnulib-tool (func_emit_lib_Makefile_am): Replace lines that start with
@NMD@ or @!NMD@ instead of lines that contain them.

13 months agoc-strtod, c-strtold: Make multithread-safe.
Bruno Haible [Tue, 5 Mar 2024 16:10:38 +0000 (17:10 +0100)]
c-strtod, c-strtold: Make multithread-safe.

* lib/c-strtod.c: Include <langinfo.h>, c-ctype.h.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(C_STRTOD): On platforms that don't have STRTOD_L nor a working
uselocale(), pre-parse the number and call STRTOD after having replaced
the '.' with the locale-dependent decimal point character.
* m4/c-strtod.m4 (gl_C_STRTOD, gl_C_STRTOLD): Test for nl_langinfo().
* modules/c-strtod (Depends-on): Add c-ctype. Remove strdup-posix.
* modules/c-strtold (Depends-on): Likewise.

13 months agoisnan: Fix compilation error in C++ mode on OpenBSD 7.5-beta.
Bruno Haible [Tue, 27 Feb 2024 23:33:49 +0000 (00:33 +0100)]
isnan: Fix compilation error in C++ mode on OpenBSD 7.5-beta.

Reported by Christian Weisgerber <naddy@mips.inka.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00261.html>.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISNAN): Define on all platforms
with clang ≥ 14.

13 months agostriconveha tests: Avoid test failure on macOS 12.5.
Bruno Haible [Sat, 24 Feb 2024 12:56:30 +0000 (13:56 +0100)]
striconveha tests: Avoid test failure on macOS 12.5.

* tests/test-striconveha.c (main): Skip transliteration tests when using
Apple's modified GNU libiconv or the bastard Apple iconv.

13 months agoc-strtold: Use strtold_l when available (regr. 2019-01-31).
Bruno Haible [Thu, 22 Feb 2024 00:49:44 +0000 (01:49 +0100)]
c-strtold: Use strtold_l when available (regr. 2019-01-31).

* lib/c-strtod.c: Fix typo: HAVE_GOOD_STRTOLD_L was never defined.

13 months agostrtod, strtold tests: Avoid a test failure on native Windows.
Bruno Haible [Wed, 21 Feb 2024 23:47:21 +0000 (00:47 +0100)]
strtod, strtold tests: Avoid a test failure on native Windows.

* modules/strtod-tests (Depends-on): Add setlocale.
* modules/strtold-tests (Depends-on): Likewise.

13 months agoautoupdate
Karl Berry [Mon, 19 Feb 2024 15:36:19 +0000 (07:36 -0800)]
autoupdate

13 months agomath: More clang -Winclude-next-absolute-path silencing.
Collin Funk [Sat, 17 Feb 2024 10:47:36 +0000 (11:47 +0100)]
math: More clang -Winclude-next-absolute-path silencing.

* lib/math.c: Write #include <math.h> instead of #include "math.h".

Copyright-paperwork-exempt: Yes

13 months agoerror: More clang -Winclude-next-absolute-path silencing.
Bruno Haible [Sat, 17 Feb 2024 10:43:32 +0000 (11:43 +0100)]
error: More clang -Winclude-next-absolute-path silencing.

* modules/error-h (Include): Suggest <error.h>, not "error.h".
* m4/error_h.m4: Write #include <error.h>.

13 months agoDon't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
Bruno Haible [Wed, 14 Feb 2024 22:44:28 +0000 (23:44 +0100)]
Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.

* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Don't treat the bastard Apple
iconv like GNU libiconv.
* lib/striconv.c (mem_cd_iconv, str_cd_iconv): Likewise.
* lib/striconveh.c (iconv_carefully, iconv_carefully_1,
mem_cd_iconveh_internal): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.
* lib/unicodeio.c (unicode_to_mb): Likewise.
* lib/uniconv/u16-conv-from-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-conv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-strconv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u32-conv-from-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-conv-to-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-strconv-to-enc.c (UTF32_NAME): Likewise.
* tests/test-striconveh.c (main): Likewise.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.

13 months agoImprove support of Citrus/FreeBSD iconv.
Bruno Haible [Wed, 14 Feb 2024 22:16:15 +0000 (23:16 +0100)]
Improve support of Citrus/FreeBSD iconv.

* lib/striconveh.c (iconveh_open): Use //TRANSLIT with all iconv
implementations that support it.
* lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.

13 months agoisnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2.
Bruno Haible [Wed, 14 Feb 2024 19:08:15 +0000 (20:08 +0100)]
isnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2.

Reported by Paul E Reimer <reimer@anl.gov> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-02/msg00002.html>.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISNAN): Define also on macOS
with clang ≥ 14.

14 months agolimits-h: Fix BOOL_MAX value.
Bruno Haible [Mon, 12 Feb 2024 13:02:33 +0000 (14:02 +0100)]
limits-h: Fix BOOL_MAX value.

* lib/limits.in.h (BOOL_MAX): Define to 1, not to 2^BOOL_WIDTH-1.
* tests/test-limits-h.c (main): Change expected value of BOOL_MAX.

14 months agopthread_mutex_timedlock, pthread-spin: Fix configure test.
Florian Weimer [Mon, 12 Feb 2024 11:18:34 +0000 (12:18 +0100)]
pthread_mutex_timedlock, pthread-spin: Fix configure test.

* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Pass
a pointer of the correct type to pthread_mutex_timedlock.
* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Pass a pointer of the correct
type to pthread_spin_init.

Copyright-paperwork-exempt: Yes

14 months agoAvoid suboptimal definition of _GL_HAS_ATTRIBUTE on FreeBSD/sparc64.
Bruno Haible [Fri, 9 Feb 2024 16:28:31 +0000 (17:28 +0100)]
Avoid suboptimal definition of _GL_HAS_ATTRIBUTE on FreeBSD/sparc64.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_HAS_ATTRIBUTE only
once.

14 months agonstrftime tests: Avoid test failures on DragonFly BSD.
Bruno Haible [Wed, 7 Feb 2024 15:50:27 +0000 (16:50 +0100)]
nstrftime tests: Avoid test failures on DragonFly BSD.

* tests/test-nstrftime.h (LT): Disable specific test cases also on
DragonFly BSD.

14 months agonstrftime: Modernize.
Bruno Haible [Wed, 7 Feb 2024 12:37:17 +0000 (13:37 +0100)]
nstrftime: Modernize.

* lib/strftime.c (__strftime_internal): Make the strftime fallback
declaration ISO C 23 compliant.

14 months agonstrftime tests: Avoid test failures on FreeBSD, NetBSD, Android.
Bruno Haible [Wed, 7 Feb 2024 11:46:09 +0000 (12:46 +0100)]
nstrftime tests: Avoid test failures on FreeBSD, NetBSD, Android.

* tests/test-nstrftime.c (LT): Disable specific test cases on FreeBSD,
NetBSD, Android.

14 months agonl_langinfo: Fix fallback list of month names (regression 2014-07-07).
Bruno Haible [Tue, 6 Feb 2024 20:59:01 +0000 (21:59 +0100)]
nl_langinfo: Fix fallback list of month names (regression 2014-07-07).

* lib/nl_langinfo.c (nl_langinfo): In the implementation for native
Windows, fix the results for MON_8..MON_12, ALTMON_8..ALTMON_12,
ABMON_8..ABMON_12.

14 months agoctime: fix false positive
Paul Eggert [Sat, 3 Feb 2024 20:05:17 +0000 (12:05 -0800)]
ctime: fix false positive

Problem reported by Bjarni Ingi Gislason in:
https://lists.gnu.org/r/bug-gnulib/2024-02/msg00006.html
* lib/time.in.h (ctime): Do not warn about ctime portability,
as there is a more serious warning about it crashing,
and the two warning directives can cause false alarms.

15 months agoUpdate copyright year in tests/unictype/*.
Bruno Haible [Tue, 30 Jan 2024 15:50:08 +0000 (16:50 +0100)]
Update copyright year in tests/unictype/*.

* tests/unictype/*: Bump copyright years range to include 2024.

15 months agoPort FALLTHROUGH to Mac OS X 10.9.
Bruno Haible [Mon, 29 Jan 2024 17:26:41 +0000 (18:26 +0100)]
Port FALLTHROUGH to Mac OS X 10.9.

Report and fix by Ryan Carsten Schmidt <gnulib@ryandesign.com>
at <https://savannah.gnu.org/bugs/?63866>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): For _GL_HAS_ATTRIBUTE, don't use
__has_attribute for Apple clang versions < 7000000.
* lib/cdefs.h (__glibc_has_attribute): Don't use __has_attribute for
Apple clang versions < 7000000.

15 months agohost-cpu-c-abi: Let gl_HOST_CPU_C_ABI_32BIT never return 'unknown'.
Bruno Haible [Sun, 28 Jan 2024 19:23:10 +0000 (20:23 +0100)]
host-cpu-c-abi: Let gl_HOST_CPU_C_ABI_32BIT never return 'unknown'.

Reported by Mohammad-Reza Nabipoor <mnabipoor@gnu.org>.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI_32BIT): Use the list of
always-32-bit CPUs and the list of always-64-bit CPUs also when
gl_HOST_CPU_C_ABI has already been run. As a fallback, use a test of
'sizeof (void *)' to always return 'yes' or 'no', never 'unknown'.

15 months agoexecute tests: Avoid test failure on macOS 14.
Bruno Haible [Fri, 26 Jan 2024 00:12:08 +0000 (01:12 +0100)]
execute tests: Avoid test failure on macOS 14.

Reported by Guangyu Li <gl343@cornell.edu> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-01/msg00006.html>.

* tests/test-execute-main.c (main): In the tests 17, 18, 19, 20, use the
file descriptors 15, 16 instead of 10, 11, respectively.
* tests/test-execute-child.c (main): Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Thu, 25 Jan 2024 23:55:45 +0000 (00:55 +0100)]
Resolve conflicts for functions introduced in Android API level 35.

* lib/time.in.h (timespec_getres): Consider REPLACE_TIMESPEC_GETRES.
* m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize REPLACE_TIMESPEC_GETRES.
* modules/time-h (Makefile.am): Substitute REPLACE_TIMESPEC_GETRES.
* m4/timespec_getres.m4 (gl_FUNC_TIMESPEC_GETRES): Test for
timespec_getres using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_TIMESPEC_GETRES.
* modules/timespec_getres (Depends-on, configure.ac): Consider
REPLACE_TIMESPEC_GETRES.
* m4/gettime.m4 (gl_GETTIME_RES): Test for timespec_getres using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* doc/posix-functions/timespec_getres.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:55 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE): On platforms without
glibc, test for copy_file_range using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_COPY_FILE_RANGE.
* doc/glibc-functions/copy_file_range.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:52 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test for
posix_spawn_file_actions_addchdir_np and
posix_spawn_file_actions_addfchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* m4/posix_spawn_faction_addchdir.m4
(gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR): Test for
posix_spawn_file_actions_addchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* m4/posix_spawn_faction_addfchdir.m4
(gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR): Test for
posix_spawn_file_actions_addfchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi: Mention
the Android API levels.
* doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:49 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* lib/string.in.h (memset_explicit): Consider REPLACE_MEMSET_EXPLICIT.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize
REPLACE_MEMSET_EXPLICIT.
* modules/string (Makefile.am): Substitute REPLACE_MEMSET_EXPLICIT.
* m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Test for
memset_explicit using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_MEMSET_EXPLICIT.
* modules/memset_explicit (configure.ac): Consider
REPLACE_MEMSET_EXPLICIT.
* doc/posix-functions/memset_explicit.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:45 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/freadahead.m4 (gl_FUNC_FREADAHEAD): Test for __freadahead using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* lib/freadahead.h: Update comment.

15 months agoResolve conflicts for functions introduced in Android API level 30.
Bruno Haible [Thu, 25 Jan 2024 19:15:10 +0000 (20:15 +0100)]
Resolve conflicts for functions introduced in Android API level 30.

* lib/threads.in.h (thrd_sleep): Consider REPLACE_THRD_SLEEP.
(thrd_yield): Consider REPLACE_THRD_YIELD.
(mtx_init): Consider REPLACE_MTX_INIT.
(mtx_lock): Consider REPLACE_MTX_LOCK.
(mtx_trylock): Consider REPLACE_MTX_TRYLOCK.
(mtx_timedlock): Consider REPLACE_MTX_TIMEDLOCK.
(mtx_unlock): Consider REPLACE_MTX_UNLOCK.
(mtx_destroy): Consider REPLACE_MTX_DESTROY.
(call_once): Consider REPLACE_CALL_ONCE. Fix warning message.
(cnd_init): Consider REPLACE_CND_INIT.
(cnd_wait): Consider REPLACE_CND_WAIT.
(cnd_timedwait): Consider REPLACE_CND_TIMEDWAIT.
(cnd_signal): Consider REPLACE_CND_SIGNAL.
(cnd_broadcast): Consider REPLACE_CND_BROADCAST.
(cnd_destroy): Consider REPLACE_CND_DESTROY.
(tss_create): Consider REPLACE_TSS_CREATE.
(tss_set): Consider REPLACE_TSS_SET.
(tss_get): Consider REPLACE_TSS_GET.
(tss_delete): Consider REPLACE_TSS_DELETE.
* m4/threads_h.m4 (gl_THREADS_H_DEFAULTS): Initialize REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* modules/threads-h (Makefile.am): Substitute REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* m4/thrd.m4 (gl_FUNC_THRD_CREATE): New macro.
* modules/thrd (configure.ac): Invoke gl_FUNC_THRD_CREATE.
* m4/call_once.m4: New file.
* modules/call_once (Files): Add m4/call_once.m4.
(configure.ac): Invoke gl_FUNC_CALL_ONCE. Consider REPLACE_CALL_ONCE.
* m4/cnd.m4: New file.
* modules/cnd (Files): Add m4/cnd.m4.
(configure.ac): Invoke gl_FUNC_CND_INIT. Consider REPLACE_CND_INIT.
* m4/mtx.m4: New file.
* modules/mtx (Files): Add m4/mtx.m4.
(configure.ac): Invoke gl_FUNC_MTX_INIT. Consider REPLACE_MTX_INIT.
* m4/tss.m4: New file.
* modules/tss (Files): Add m4/tss.m4.
(configure.ac): Invoke gl_FUNC_TSS_CREATE. Consider REPLACE_TSS_CREATE.
* doc/posix-functions/call_once.texi: Mention the Android API levels.
* doc/posix-functions/cnd_broadcast.texi: Likewise.
* doc/posix-functions/cnd_destroy.texi: Likewise.
* doc/posix-functions/cnd_init.texi: Likewise.
* doc/posix-functions/cnd_signal.texi: Likewise.
* doc/posix-functions/cnd_timedwait.texi: Likewise.
* doc/posix-functions/cnd_wait.texi: Likewise.
* doc/posix-functions/mtx_destroy.texi: Likewise.
* doc/posix-functions/mtx_init.texi: Likewise.
* doc/posix-functions/mtx_lock.texi: Likewise.
* doc/posix-functions/mtx_timedlock.texi: Likewise.
* doc/posix-functions/mtx_trylock.texi: Likewise.
* doc/posix-functions/mtx_unlock.texi: Likewise.
* doc/posix-functions/thrd_create.texi: Likewise.
* doc/posix-functions/thrd_current.texi: Likewise.
* doc/posix-functions/thrd_detach.texi: Likewise.
* doc/posix-functions/thrd_equal.texi: Likewise.
* doc/posix-functions/thrd_exit.texi: Likewise.
* doc/posix-functions/thrd_join.texi: Likewise.
* doc/posix-functions/thrd_sleep.texi: Likewise.
* doc/posix-functions/thrd_yield.texi: Likewise.
* doc/posix-functions/tss_create.texi: Likewise.
* doc/posix-functions/tss_delete.texi: Likewise.
* doc/posix-functions/tss_get.texi: Likewise.
* doc/posix-functions/tss_set.texi: Likewise.

15 months agoreadutmp, boot-time: Port to Android NDK r26.
Bruno Haible [Sun, 21 Jan 2024 16:50:52 +0000 (17:50 +0100)]
readutmp, boot-time: Port to Android NDK r26.

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

* lib/readutmp.h: Update comments.
(UTMP_NAME_FUNCTION): Define as a no-op for Android with HAVE_UTMPX_H.

15 months agoasyncsafe-spin: Fix link error on various platforms.
Bruno Haible [Sun, 21 Jan 2024 14:59:32 +0000 (15:59 +0100)]
asyncsafe-spin: Fix link error on various platforms.

* m4/atomic-cas.m4: New file.
* lib/asyncsafe-spin.c: Test HAVE_ATOMIC_COMPARE_AND_SWAP_GCC41 instead
of a condition that considers only __sparc__, __ANDROID__, __ibmxl__.
* lib/pthread-spin.c: Likewise.
* lib/simple-atomic.c: Likewise.
* modules/asyncsafe-spin (Files): Add m4/atomic-cas.m4.
(configure.ac): Require gl_ATOMIC_COMPARE_AND_SWAP.
* modules/pthread-spin: Likewise.
* modules/simple-atomic: Likewise.

15 months agofenv-environment: Fix for NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:58:43 +0000 (22:58 +0100)]
fenv-environment: Fix for NetBSD/powerpc.

* m4/fenv-environment.m4 (gl_FENV_ENVIRONMENT): For feupdateenv, use
the same configure test on NetBSD/powerpc as on glibc/hppa.
* doc/posix-functions/feupdateenv.texi: Mention the NetBSD/powerpc bug.

15 months agofenv-exceptions-trapping: Avoid a test failure on *BSD/powerpc*.
Bruno Haible [Fri, 19 Jan 2024 21:43:55 +0000 (22:43 +0100)]
fenv-exceptions-trapping: Avoid a test failure on *BSD/powerpc*.

* tests/test-fenv-except-trapping-2.c (main): Skip the '4' tests also on
FreeBSD/powerpc* and NetBSD/powerpc*.

15 months agofenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:34:27 +0000 (22:34 +0100)]
fenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.

* m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): On
FreeBSD/powerpc64 and NetBSD/powerpc, set REPLACE_FESETEXCEPTFLAG.
* doc/posix-functions/fesetexceptflag.texi: Mention the FreeBSD and
NetBSD bug.

15 months agofenv-*: Avoid test failures on FreeBSD/powerpc64 and NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:04:33 +0000 (22:04 +0100)]
fenv-*: Avoid test failures on FreeBSD/powerpc64 and NetBSD/powerpc.

On these platforms, FE_ALL_EXCEPT contains additional bits.

* tests/test-fenv-except-tracking-1.c (FE_VXSOFT, FE_VXZDZ): Define
fallbacks.
(main): Allow fetestexcept(FE_ALL_EXCEPT) to contain FE_VXSOFT or
FE_VXZDZ in addition to FE_INVALID.
* tests/test-fenv-except-tracking-4.c (FE_VXSOFT): Define fallback.
(main): Allow fetestexcept(FE_ALL_EXCEPT) to contain FE_VXSOFT in
addition to FE_INVALID.
* tests/test-fenv-env-2.c: Likewise.
* tests/test-fenv-env-3.c: Likewise.
* tests/test-fenv-env-4.c: Likewise.
* tests/test-fenv-env-5.c: Likewise.

15 months agofenv-*: Fix test failures on NetBSD 9.3/arm64.
Bruno Haible [Fri, 19 Jan 2024 14:07:05 +0000 (15:07 +0100)]
fenv-*: Fix test failures on NetBSD 9.3/arm64.

* m4/fenv-exceptions-trapping.m4 (gl_FENV_EXCEPTIONS_TRAPPING): Override
feenableexcept() also on NetBSD/arm64.
* doc/glibc-functions/feenableexcept.texi: Update platforms list.

15 months agofenv-*: Avoid test failures on OpenBSD/sparc64.
Bruno Haible [Fri, 19 Jan 2024 09:55:13 +0000 (10:55 +0100)]
fenv-*: Avoid test failures on OpenBSD/sparc64.

* tests/test-fenv-except-tracking-2.c (main): On OpenBSD/sparc64, skip
the 'long double' test.
* tests/test-fenv-except-trapping-2.c (main): Skip the 'long double'
tests also on OpenBSD/sparc64.

15 months agofenv-rounding: Avoid a test failure on OpenBSD/arm64.
Bruno Haible [Thu, 18 Jan 2024 23:54:13 +0000 (00:54 +0100)]
fenv-rounding: Avoid a test failure on OpenBSD/arm64.

* tests/test-fenv-round.c (test_towardzero, test_upward, test_downward):
Skip the 'long double' tests on OpenBSD/arm64.
* doc/posix-functions/fesetround.texi: Update platforms list.

15 months agoAvoid test failures in FreeBSD's GB18030 locale.
Bruno Haible [Thu, 18 Jan 2024 21:17:07 +0000 (22:17 +0100)]
Avoid test failures in FreeBSD's GB18030 locale.

The FreeBSD 14.0 iconv converter (GB18030 → UTF-8) cannot convert e.g.
0x94 0x32 0xBB 0x34 to U+1D100.

* tests/test-c32isalnum.c (main): Skip the GB18030 locale tests on
FreeBSD, if GL_CHAR32_T_IS_UNICODE (or, equivalently,
GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) is defined.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isblank.c (main): Likewise.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isdigit.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32isspace.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32isxdigit.c (main): Likewise.
* tests/test-c32rtomb.c (main): Likewise.
* tests/test-c32snrtombs.c (main): Likewise.
* tests/test-c32srtombs.c (main): Likewise.
* tests/test-c32stombs.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.
* tests/test-mbrtoc16.c (main): Likewise.
* tests/test-mbrtoc32.c (main): Likewise.
* tests/test-mbsnrtoc32s.c (main): Likewise.
* tests/test-mbsrtoc32s.c (main): Likewise.
* tests/test-mbstoc32s.c (main): Likewise.

15 months agoget-rusage-data: Avoid test failure on NetBSD 9.3.
Bruno Haible [Thu, 18 Jan 2024 18:59:34 +0000 (19:59 +0100)]
get-rusage-data: Avoid test failure on NetBSD 9.3.

* tests/test-get-rusage-data.c (main): Don't expect a strict increase on
NetBSD systems.

15 months agolog10l: Work around bug on NetBSD 9.3/arm64.
Bruno Haible [Thu, 18 Jan 2024 18:46:53 +0000 (19:46 +0100)]
log10l: Work around bug on NetBSD 9.3/arm64.

* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Add another test case, taken from
the unit test.

15 months agomodfl: Work around bug on NetBSD 9.3/arm64.
Bruno Haible [Thu, 18 Jan 2024 14:41:39 +0000 (15:41 +0100)]
modfl: Work around bug on NetBSD 9.3/arm64.

* m4/modfl.m4 (gl_FUNC_MODFL): Add test whether modfl basically works.
* doc/posix-functions/modfl.texi: Mention the NetBSD bug.

15 months agofmaf, fma, fmal: Work around bugs on OpenBSD 7.4/arm64.
Bruno Haible [Thu, 18 Jan 2024 13:55:25 +0000 (14:55 +0100)]
fmaf, fma, fmal: Work around bugs on OpenBSD 7.4/arm64.

* m4/fmaf.m4 (gl_FUNC_FMAF_WORKS): Use a volatile function pointer
variable to disable clang's inlining.
* m4/fma.m4 (gl_FUNC_FMA_WORKS): Likewise.
* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Likewise.
* doc/posix-functions/fmaf.texi: Mention the OpenBSD bug.
* doc/posix-functions/fma.texi: Likewise.
* doc/posix-functions/fmal.texi: Likewise.

15 months agogetopt-gnu: Fix out-of-bounds access (regression 2023-12-11).
Bruno Haible [Thu, 18 Jan 2024 00:12:20 +0000 (01:12 +0100)]
getopt-gnu: Fix out-of-bounds access (regression 2023-12-11).

* lib/getopt.c (process_long_option): Don't set ambig_set[option_index]
if ambig_set is &ambig_fallback.

15 months agoposixtm: pacify clang 18
Paul Eggert [Wed, 17 Jan 2024 01:21:08 +0000 (17:21 -0800)]
posixtm: pacify clang 18

Problem reported by Khem Raj in:
https://lists.gnu.org/r/bug-gnulib/2024-01/msg00045.html
* lib/posixtm.c (posixtime): Pacify clang 18 by converting bool to int.
Arguably this is a bug in draft C2x, since the non-pointer args to
ckd_add should promote just like any other expressions do;
but that’s not clang’s fault.

15 months agoautoupdate
Karl Berry [Mon, 15 Jan 2024 15:11:14 +0000 (07:11 -0800)]
autoupdate

15 months agotest-framework-sh: Improve portability to native Windows and OS/2.
Bruno Haible [Mon, 15 Jan 2024 15:05:00 +0000 (16:05 +0100)]
test-framework-sh: Improve portability to native Windows and OS/2.

Reported by KO Myung-Hun <komh78@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): Test for an absolute directory name like
Autoconf does.

15 months agotest-framework-sh: Improve portability to native Windows and OS/2.
Bruno Haible [Mon, 15 Jan 2024 14:56:40 +0000 (15:56 +0100)]
test-framework-sh: Improve portability to native Windows and OS/2.

Reported by KO Myung-Hun <komh78@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
':'.

15 months agotest-framework-sh: Improve portability to native Windows and OS/2.
Bruno Haible [Mon, 15 Jan 2024 14:50:52 +0000 (15:50 +0100)]
test-framework-sh: Improve portability to native Windows and OS/2.

Reported by KO Myung-Hun <komh78@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): Set IFS, like in Autoconf's _AS_PATH_WALK and
in build-aux/relocatable.sh.in.

15 months agojit/cache tests: Fix link error.
Bruno Haible [Fri, 12 Jan 2024 13:35:33 +0000 (14:35 +0100)]
jit/cache tests: Fix link error.

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

15 months agoqsort_r: Fix compilation error in C++ mode on FreeBSD 14.0/powerpc64.
Bruno Haible [Fri, 12 Jan 2024 06:44:59 +0000 (07:44 +0100)]
qsort_r: Fix compilation error in C++ mode on FreeBSD 14.0/powerpc64.

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

15 months agotime: Fix test failure on FreeBSD 12.2/sparc64.
Bruno Haible [Thu, 11 Jan 2024 12:50:04 +0000 (13:50 +0100)]
time: Fix test failure on FreeBSD 12.2/sparc64.

* m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on
FreeBSD/sparc.
* doc/posix-functions/time.texi: Mention the bug on FreeBSD/sparc.

15 months agojit/cache tests: Fix for powerpc64le CPUs.
Bruno Haible [Wed, 10 Jan 2024 16:26:57 +0000 (17:26 +0100)]
jit/cache tests: Fix for powerpc64le CPUs.

* tests/jit/test-cache.c: Treat Linux/powerpc64le *not* like AIX.

15 months agojit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64.
Bruno Haible [Wed, 10 Jan 2024 15:46:48 +0000 (16:46 +0100)]
jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64.

* tests/jit/test-cache.c (funcptr_to_structptr): Turn into an inline
function.

15 months agojit/cache tests: Fix for arm CPUs with GCC target arm-linux-gnueabihf.
Bruno Haible [Wed, 10 Jan 2024 15:23:23 +0000 (16:23 +0100)]
jit/cache tests: Fix for arm CPUs with GCC target arm-linux-gnueabihf.

15 months agojit/cache: Fix for arm CPUs with GCC target arm-linux-gnueabihf.
Bruno Haible [Wed, 10 Jan 2024 14:26:53 +0000 (15:26 +0100)]
jit/cache: Fix for arm CPUs with GCC target arm-linux-gnueabihf.

* tests/jit/test-cache.c (CODE): Define differently on arm.
(SET_CODE, IS, SET_IS): New macros.
(main): New variables is_of_return1, is_of_return2. Use the SET_CODE and
SET_IS macros.

15 months agojit/cache tests: Avoid compiler warnings on OpenBSD.
Bruno Haible [Wed, 10 Jan 2024 13:22:44 +0000 (14:22 +0100)]
jit/cache tests: Avoid compiler warnings on OpenBSD.

* tests/jit/test-cache.c (main): New variables size_of_return1,
size_of_return2.

15 months agojit/cache: Fix for ia64 CPUs.
Bruno Haible [Tue, 9 Jan 2024 21:55:26 +0000 (22:55 +0100)]
jit/cache: Fix for ia64 CPUs.

* lib/jit/cache.h (clear_cache): On ia64 CPUs, use the 'fc', 'sync',
'srlz' instructions.

15 months agojit/cache: Fix for hppa CPUs.
Bruno Haible [Tue, 9 Jan 2024 21:12:11 +0000 (22:12 +0100)]
jit/cache: Fix for hppa CPUs.

* lib/jit/cache.h (clear_cache): On hppa CPUs, use the 'fdc' and 'fic'
instructions.

15 months agojit/cache tests: Avoid test failure on OpenBSD.
Bruno Haible [Tue, 9 Jan 2024 20:10:19 +0000 (21:10 +0100)]
jit/cache tests: Avoid test failure on OpenBSD.

* tests/jit/test-cache.c (return1_code, return2_code): New constants.
(main): On OpenBSD, use return1_code and return2_code instead of
CODE (return1) and CODE (return2), since the latter may not be in a
readable memory area.

15 months agojit/cache tests: Avoid test failure on hppa CPUs.
Bruno Haible [Tue, 9 Jan 2024 15:56:08 +0000 (16:56 +0100)]
jit/cache tests: Avoid test failure on hppa CPUs.

* tests/jit/test-cache.c (FUNCPTR_BIAS): New macro.
(structptr_to_funcptr, funcptr_to_structptr): New functions/macros.
(xcopy_structptr): Renamed from xcopy_funcptr. Mark as inline.
(COPY_FUNCPTR, CODE): Use structptr_to_funcptr, funcptr_to_structptr.
* modules/jit/cache-tests (configure.ac): Require AC_C_INLINE.

15 months agojit/cache tests: Fix for powerpc*, ia64, hppa* CPUs.
Bruno Haible [Mon, 8 Jan 2024 21:48:46 +0000 (22:48 +0100)]
jit/cache tests: Fix for powerpc*, ia64, hppa* CPUs.

* modules/jit/cache-tests (Depends-on): Add xalloc.
* tests/jit/test-cache.c: Include xalloc.h.
(FUNCPTR_POINTS_TO_CODE, COPY_FUNCPTR): New macros.
(xcopy_funcptr): New function.
(main): Create a copy of the function pointer return1, so as not to
destructively modify return1. Fix memcpy argument.

15 months agojit/cache tests: Port to native Windows.
Bruno Haible [Mon, 8 Jan 2024 17:45:20 +0000 (18:45 +0100)]
jit/cache tests: Port to native Windows.

* tests/jit/test-cache.c (main): On native Windows, use VirtualAlloc
instead of mmap.

15 months agojit/cache tests: Avoid test failure on OpenBSD.
Bruno Haible [Mon, 8 Jan 2024 17:10:28 +0000 (18:10 +0100)]
jit/cache tests: Avoid test failure on OpenBSD.

* modules/jit/cache-tests (Files): Add m4/warnings.m4.
(configure.ac): Set and substitute DISABLE_OPENBSD_RETGUARD.
(Makefile.am): Set test_cache_CFLAGS.
* tests/jit/test-cache.c (main): If the compiler defines _RET_PROTECTOR,
skip the test.

15 months agojit/cache tests: Avoid test failure on CentOS, *BSD, macOS.
Bruno Haible [Mon, 8 Jan 2024 16:15:35 +0000 (17:15 +0100)]
jit/cache tests: Avoid test failure on CentOS, *BSD, macOS.

* tests/jit/test-cache.c: Include <fcntl.h>, <stdio.h>, <stdlib.h>.
Don't include pagealign_alloc.h. Include clean-temp-simple.h. Don't test
HAVE_MPROTECT.
(struct func): Fix #if conditions.
(main): Don't invoke pagealign_xalloc and mprotect. Instead, invoke mmap,
using a temporary file if needed.
* modules/jit/cache-tests (Files): Add m4/mmap-anon.m4.
(Depends-on): Add clean-temp-simple. Remove pagealign_alloc.
(configure.ac): Invoke gl_FUNC_MMAP_ANON. Don't test for mprotect.

15 months ago* ChangeLog: Fix macOS version typo.
Paul Eggert [Tue, 2 Jan 2024 17:19:44 +0000 (09:19 -0800)]
* ChangeLog: Fix macOS version typo.

15 months agostrverscmp: Work around bug in musl libc 1.2.3 and in Cygwin.
Bruno Haible [Tue, 2 Jan 2024 10:37:05 +0000 (11:37 +0100)]
strverscmp: Work around bug in musl libc 1.2.3 and in Cygwin.

Reported by Dmitry Bogatov <KAction@gnu.org> via Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00002.html>.

* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize REPLACE_STRVERSCMP.
* m4/strverscmp.m4 (gl_FUNC_STRVERSCMP): Test whether strverscmp works
and set REPLACE_STRVERSCMP if not.
* lib/string.in.h (strverscmp): Consider REPLACE_STRVERSCMP.
* modules/strverscmp (Depends-on, configure.ac): Likewise.
* modules/string (Makefile.am): Substitute REPLACE_STRVERSCMP.
* tests/test-strverscmp.c (main): Add test cases suggested by Dmitry
Bogatov and by Simon Josefsson.
* doc/glibc-functions/strverscmp.texi: Mention the musl and Cygwin bug.
Update version info regarding FreeBSD.

15 months agoupdate-copyright-tests: immunize against self
Paul Eggert [Tue, 2 Jan 2024 00:51:51 +0000 (16:51 -0800)]
update-copyright-tests: immunize against self

Problem reported by Bernhard Voelker in:
https://lists.gnu.org/r/bug-gnulib/2024-01/msg00003.html
* tests/test-update-copyright.sh (ight): New var.
Use it in tests, to prevent update-copyright from
messing with the test data.

16 months agomaint: run 'make update-copyright'
Simon Josefsson [Mon, 1 Jan 2024 09:31:48 +0000 (10:31 +0100)]
maint: run 'make update-copyright'

16 months agoautoupdate
Karl Berry [Sun, 31 Dec 2023 16:33:17 +0000 (08:33 -0800)]
autoupdate

16 months agotests: don’t skip if LONG_MAX < pid
Paul Eggert [Sat, 30 Dec 2023 03:20:19 +0000 (19:20 -0800)]
tests: don’t skip if LONG_MAX < pid

* modules/pthread_sigmask-tests, modules/sigprocmask-tests:
(Depends-on): Add inttypes.
* tests/test-pthread_sigmask1.c, tests/test-sigprocmask.c:
Include inttypes.h.
(main): Don’t skip test if pid exceeds LONG_MAX.

16 months agoOmit no-longer-needed pragmas
Paul Eggert [Fri, 29 Dec 2023 18:33:42 +0000 (10:33 -0800)]
Omit no-longer-needed pragmas

* lib/anytostr.c, lib/poll.c, lib/regex.c:
Omit pragmas that should no longer be needed.

16 months agognulib-common: suppress -Wtautological-constant-out-of-range-compare
Paul Eggert [Fri, 29 Dec 2023 18:33:03 +0000 (10:33 -0800)]
gnulib-common: suppress -Wtautological-constant-out-of-range-compare

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Pass
-Wno-tautological-constant-out-of-range-compare to clang, as it’s
the warning is enabled by default and in portable code where type
ranges are platform dependent it is generally more trouble than
it’s worth.

16 months agoannounce-gen: Improve links.
Simon Josefsson [Fri, 29 Dec 2023 18:28:17 +0000 (19:28 +0100)]
announce-gen: Improve links.

* build-aux/announce-gen: Use https:// URLs.

16 months agoerror: More clang -Winclude-next-absolute-path silencing.
Bruno Haible [Fri, 29 Dec 2023 09:39:52 +0000 (10:39 +0100)]
error: More clang -Winclude-next-absolute-path silencing.

* modules/error (Include): Suggest <error.h>, not "error.h".
* tests/test-error.c: Write #include <error.h>.
* tests/test-exclude.c: Likewise.
* tests/test-verror.c: Likewise.
* tests/test-xstrtol.c: Likewise.

16 months agoinclude_next: pacify clang -Winclude-next-absolute-path
Paul Eggert [Thu, 28 Dec 2023 20:25:16 +0000 (12:25 -0800)]
include_next: pacify clang -Winclude-next-absolute-path

Without this change, Ubuntu clang version 16.0.6 (15) issues
warnings like this: “In file included from xalloc-die.c:25:
./error.h:28:3: warning: #include_next in file found relative to
primary source file or found by absolute path; will search from
start of include path [-Winclude-next-absolute-path]”.
And sure enough, each file includes itself rather than the
next include file and it’s only the subsidiary include that
gets around to including the next include file.
* lib/argmatch.c, lib/chdir-long.c, lib/clean-temp-simple.c:
* lib/clean-temp.c, lib/closein.c, lib/closeout.c, lib/copy-acl.c:
* lib/copy-file.c, lib/creat.c, lib/csharpcomp.c:
* lib/csharpexec.c, lib/error.c, lib/exclude.c, lib/execute.c:
* lib/faccessat.c, lib/fopen.c, lib/freopen.c, lib/getopt.c:
* lib/getopt1.c, lib/git-merge-changelog.c, lib/javacomp.c:
* lib/javaexec.c, lib/javaversion.c, lib/mkdir-p.c, lib/open.c:
* lib/openat-die.c, lib/openat.c, lib/os2-spawn.c:
* lib/pagealign_alloc.c, lib/pipe-filter-gi.c:
* lib/pipe-filter-ii.c, lib/same.c, lib/set-acl.c:
* lib/sigpipe-die.c, lib/spawn-pipe.c, lib/sys_socket.c, lib/truncate.c:
* lib/unistd.c, lib/verror.c, lib/wait-process.c, lib/wctype-h.c:
* lib/xalloc-die.c, lib/xfreopen.c, lib/xmemcoll.c, lib/xprintf.c:
* lib/xsetenv.c, lib/xstdopen.c, lib/xstrtol-error.c:
Use ‘#include <foo.h>’ instead of ‘#include "foo.h"’ if foo.h
possibly uses #include_next.  (However, don’t do this on OSF/1
which has its own problems.)

16 months agostat-time: fix macOS bug with negative file times
Paul Eggert [Thu, 28 Dec 2023 19:15:56 +0000 (11:15 -0800)]
stat-time: fix macOS bug with negative file times

macOS has a bug similar (but not identical) to Solaris when
file timestamps are negative: tv_nsec might go negative.
Problem reported on Darwin 8.11.0 for GNU Tar by Gordon Steemson in:
https://lists.gnu.org/r/bug-tar/2023-12/msg00001.html
This was evidently Mac OS X 10.4.11; I reproduced it on
Darwin 21.6.0 (macOS 12.5).
* lib/stat-time.h (STAT_TIMESPEC_OFFSETOF): New macro.
(stat_time_normalize): Also normalize timestamps on macOS.
* m4/fstat.m4 (gl_FUNC_FSTAT):
* m4/fstatat.m4 (gl_FUNC_FSTATAT):
* m4/lstat.m4 (gl_FUNC_LSTAT):
* m4/stat.m4 (gl_FUNC_STAT):
Also replace on macOS.

16 months agojit/cache: Fix compilation error on m68k, sparc, etc.
Bruno Haible [Tue, 19 Dec 2023 21:10:58 +0000 (22:10 +0100)]
jit/cache: Fix compilation error on m68k, sparc, etc.

* lib/jit/cache.h: Include <stdint.h>.
* modules/jit/cache (Depends-on): Add stdint.

16 months agojit/cache tests: Make more portable.
Marc Nieper-Wißkirchen [Tue, 19 Dec 2023 19:04:12 +0000 (20:04 +0100)]
jit/cache tests: Make more portable.

* tests/jit/test-cache.c (CODE): New macro.
(struct func): New type.
(main): Initialize f more carefully.
* modules/jit/cache-tests (Depends-on): Add host-cpu-c-abi.

16 months agoselinux-h: add stubs and wrappers for raw counterparts
Christian Göttsche [Tue, 19 Dec 2023 14:54:37 +0000 (15:54 +0100)]
selinux-h: add stubs and wrappers for raw counterparts

Add stubs and wrappers of already covered libselinux interfaces for
their `raw` counterparts.  These counterparts perform the same
operation expect for context translation.  Context translation is used
to convert SELinux MCS/MLS labels into human readable form, see
mcstransd(8).

* lib/se-selinux.in.h: Add declarations for raw variants.
* lib/se-label.in.h: Likewise.
* lib/getfilecon.c: Add wrappers for problematic raw variants.
* m4/selinux-selinux-h.m4: Use wrappers for problematic raw variants.

16 months agomcel-tests: fix thinko in test
Paul Eggert [Fri, 15 Dec 2023 01:15:27 +0000 (17:15 -0800)]
mcel-tests: fix thinko in test

* tests/test-mcel.c (main): Fix typo in mcel_scanz test.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-12/msg00034.html

16 months ago* ChangeLog: Fix typo.
Paul Eggert [Tue, 12 Dec 2023 02:31:23 +0000 (18:31 -0800)]
* ChangeLog: Fix typo.

16 months agosavedir: scale better when sorting by name
Paul Eggert [Tue, 12 Dec 2023 01:47:38 +0000 (17:47 -0800)]
savedir: scale better when sorting by name

* lib/savedir.c: Include attribute.h.
(direntry_t): The ‘name’ member is now idx_t, not char *,
so that it survives name_space relocation.
(direntry_cmp_name, direntry_cmp_inode, comparison_function):
Adjust to qsort_r API, and to direntry_t layout change.
(streamsavedir): Redo to avoid need for xstrdup on each directory
entry.  Instead, copy the string data into name_space; this
typically scales better the memory allocator is called O(log N)
rather than O(N) times.  Use qsort_r so that name_space can be
passed to the comparison functions.  Simplify calls to ‘free’ so
that lack of leakage is more obvious.
* modules/savedir (Depends-on): Add attribute, qsort_r.

16 months agogetopt: pacify gcc -Wanalyzer-null-dereference
Paul Eggert [Mon, 11 Dec 2023 18:57:06 +0000 (10:57 -0800)]
getopt: pacify gcc -Wanalyzer-null-dereference

* lib/getopt.c (process_long_option): Simplify logic slightly.
This pacifies gcc -flto -Wanalyzer-null-dereference when compiling
GNU tar on x86-64 with gcc 13.2.1 20231205 (Red Hat 13.2.1-6).

16 months agobootstrap: fix option propagation with --bootstrap-sync
Pádraig Brady [Sun, 10 Dec 2023 14:46:58 +0000 (14:46 +0000)]
bootstrap: fix option propagation with --bootstrap-sync

* top/bootstrap: Ensure options are propagated through
upgrade_bootstrap().
* top/bootstrap-funclib.sh: Likewise.
* build-aux/bootstrap: Auto generated with `make build-aux/bootstrap`.
Fixes https://bugs.gnu.org/67731

17 months agofrexp: pacify clang re address-of-volatile
Paul Eggert [Sat, 2 Dec 2023 06:19:22 +0000 (22:19 -0800)]
frexp: pacify clang re address-of-volatile

Problem reported by Sam James in:
https://lists.gnu.org/r/bug-gnulib/2023-12/msg00013.html
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Don’t try to convert
‘double volatile *’ to ‘void const *’ as the C standard
doesn’t allow accessing volatile variables through
pointer-to-nonvolatile.
* m4/frexpf.m4 (gl_FUNC_FREXPF_WORKS): Likewise.

17 months agoUpdate portability doc for CHERI, C23
Paul Eggert [Fri, 1 Dec 2023 20:17:32 +0000 (12:17 -0800)]
Update portability doc for CHERI, C23

* doc/gnulib-readme.texi:
Prefer “null pointer” to “@code{NULL}” since C23 has nullptr.
(Portability guidelines): Mention C99 instead of C89 for what
Gnulib assumes of headers.
(C99 features avoided): Mention CHERI issue with intptr_t etc.
(Other portability assumptions): Say that C23 requires two’s
complement.  Mention CHERI’s holes.

17 months agoobstack: Avoid undefined behaviour.
Bruno Haible [Fri, 1 Dec 2023 18:39:26 +0000 (19:39 +0100)]
obstack: Avoid undefined behaviour.

Reported by Alexey Palienko <Alexey.Palienko@cma.se> in
<https://lists.gnu.org/archive/html/bug-m4/2023-02/msg00000.html>.

* lib/obstack.in.h: Include <stdint.h>.
(__BPTR_ALIGN): Remove macro.
(__PTR_ALIGN): For the optimized case, compute the alignment through
uintptr_t, instead of computing NULL + something.

17 months agodoc: Update for FreeBSD 14.0.
Bruno Haible [Fri, 1 Dec 2023 12:21:44 +0000 (13:21 +0100)]
doc: Update for FreeBSD 14.0.

* doc/posix-headers/*.texi: Update.
* doc/glibc-headers/*.texi: Likewise.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.
* m4/printf.m4: Update comments.