]> Savannah Git Hosting - gnulib.git/log
gnulib.git
12 months agomanywarnings: update C warnings for GCC 14
Paul Eggert [Wed, 24 Apr 2024 06:18:07 +0000 (23:18 -0700)]
manywarnings: update C warnings for GCC 14

Adjust for C programs compiled by GCC 14.
(A C++ expert still needs to look at manywarnings-c++.m4.)
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 14.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add -Wflex-array-member-not-at-end, -Wmissing-variable-declarations.

12 months agogetlogin_r tests: Fix compilation error on some OpenSolaris derivatives.
Bruno Haible [Fri, 19 Apr 2024 22:54:53 +0000 (00:54 +0200)]
getlogin_r tests: Fix compilation error on some OpenSolaris derivatives.

* tests/test-getlogin_r.c (getlogin_r): Don't check the signature on
Solaris.

12 months agomemset_explicit: Fix compilation error on some OpenSolaris derivatives.
Bruno Haible [Fri, 19 Apr 2024 22:09:11 +0000 (00:09 +0200)]
memset_explicit: Fix compilation error on some OpenSolaris derivatives.

* m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Arrange to define
__STDC_WANT_LIB_EXT1__ to 1.
* modules/memset_explicit (Depends-on): Add extensions.
* m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Require
gl_USE_SYSTEM_EXTENSIONS.
* lib/memset_explicit.c (__STDC_WANT_LIB_EXT1__): Remove definition.

12 months agoptsname_r: Work around ptsname_r bug on NetBSD 10.0.
Bruno Haible [Mon, 8 Apr 2024 23:16:15 +0000 (01:16 +0200)]
ptsname_r: Work around ptsname_r bug on NetBSD 10.0.

* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On NetBSD, arrange to override
ptsname_r.
* lib/ptsname_r.c (ptsname_r): Add workaround for NetBSD bug.

12 months agosigsegv tests: Avoid a crash on NetBSD 10.0/i386.
Bruno Haible [Sun, 7 Apr 2024 14:53:02 +0000 (16:53 +0200)]
sigsegv tests: Avoid a crash on NetBSD 10.0/i386.

* tests/test-sigsegv-catch-stackoverflow1.c
(stackoverflow_handler_continuation): On NetBSD/i386, align the stack
pointer before calling longjmp.

12 months agoexpm1l: Work around a NetBSD 10.0/i386 bug.
Bruno Haible [Sat, 6 Apr 2024 10:01:59 +0000 (12:01 +0200)]
expm1l: Work around a NetBSD 10.0/i386 bug.

* m4/expm1l.m4 (gl_FUNC_EXPM1L): Test the value of
expm1l(2^LDBL_MIN_EXP).
* tests/test-expm1.h (test_function): Allow more deviation on
NetBSD/i386.

12 months agoexp2l: Work around a NetBSD 10.0/i386 bug.
Bruno Haible [Fri, 5 Apr 2024 14:45:25 +0000 (16:45 +0200)]
exp2l: Work around a NetBSD 10.0/i386 bug.

* m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1).

12 months agoroundl: Fix a link error on Linux/powerpc64le.
Bruno Haible [Fri, 5 Apr 2024 14:04:59 +0000 (16:04 +0200)]
roundl: Fix a link error on Linux/powerpc64le.

* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Accept an additional TYPE
argument.
* m4/isfinite.m4 (gl_ISFINITE): Use the type 'double'.
* m4/isinf.m4 (gl_ISINF): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Use the type 'float'.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Use the type 'long double'.

12 months agoexpl tests: Avoid test failure on NetBSD 10.0/i386.
Bruno Haible [Fri, 5 Apr 2024 13:16:27 +0000 (15:16 +0200)]
expl tests: Avoid test failure on NetBSD 10.0/i386.

* tests/test-exp.h (test_function): Allow more deviation on NetBSD/i386.

12 months agoquotearg: fix shell-escape quoting with single quotes
Pádraig Brady [Wed, 3 Apr 2024 14:46:47 +0000 (15:46 +0100)]
quotearg: fix shell-escape quoting with single quotes

With shell-escape quoting, we misquoted strings
where the first and last characters required escaping,
while the string also contained single quotes.

* lib/quotearg.c (quotearg_buffer_restyled): Ensure that
pending_shell_escape_end is reset to the initial state
when reprocessing input due to single quotes.
Reported by Grisha Levit

12 months agorenameatu: handle ENOSYS from renameatx_np
Pádraig Brady [Tue, 2 Apr 2024 12:21:41 +0000 (13:21 +0100)]
renameatu: handle ENOSYS from renameatx_np

* lib/renameatu.c(): Fall back to renameat() when
renameatx_np(RENAME_EXCL) returns "Function not implemented".
This issue was seen with macFUSE.
Reported at https://github.com/coreutils/coreutils/issues/79

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 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__.

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 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 2023.

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: Port to Android NDK r26.
Bruno Haible [Sun, 21 Jan 2024 16:50:52 +0000 (17:50 +0100)]
readutmp: 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: (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 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 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 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 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.

15 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

15 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.

15 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.

15 months agosethostname tests: Fix a compilation error on FreeBSD 14.0.
Bruno Haible [Fri, 1 Dec 2023 10:47:31 +0000 (11:47 +0100)]
sethostname tests: Fix a compilation error on FreeBSD 14.0.

* tests/test-sethostname1.c: Skip the SIGNATURE_CHECK on some platforms.
* doc/glibc-functions/sethostname.texi: Update platforms list.

15 months agofloorf, ceilf tests: Strengthen against compiler optimizations.
Bruno Haible [Fri, 24 Nov 2023 19:02:37 +0000 (20:02 +0100)]
floorf, ceilf tests: Strengthen against compiler optimizations.

Reported by René Rebe <rene@t2-project.org>.

* tests/test-floorf1.c (main): Mark my_floorf as 'volatile'.
* tests/test-floorf-ieee.c (main): Likewise.
* tests/test-ceilf1.c (main): Mark my_ceilf as 'volatile'.
* tests/test-ceilf-ieee.c (main): Likewise.

17 months agostrerrorname_np: Work around glibc bug on HPPA systems.
Bruno Haible [Tue, 21 Nov 2023 15:18:44 +0000 (16:18 +0100)]
strerrorname_np: Work around glibc bug on HPPA systems.

* m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also
strerrorname_np (ENOSYM).
* lib/strerrorname_np.c (strerrorname_np): Update comments.
* tests/test-strerrorname_np.c (main): Likewise.
* doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.37
still needs a workaround.

17 months agorealloc-gnu: Fix wrong configure test result with optimizing ibm-clang.
Bruno Haible [Fri, 17 Nov 2023 23:18:37 +0000 (00:18 +0100)]
realloc-gnu: Fix wrong configure test result with optimizing ibm-clang.

* m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Use 'volatile', to defeat an
ibm-clang optimization.
* m4/malloc.m4 (_AC_FUNC_MALLOC_IF): Likewise.

17 months agogettext: Recognize a statically built libintl on macOS and AIX.
Bruno Haible [Fri, 17 Nov 2023 11:49:40 +0000 (12:49 +0100)]
gettext: Recognize a statically built libintl on macOS and AIX.

Reported by David Edelsohn <dje.gcc@gmail.com> in
<https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636558.html>.

* m4/gettext.m4 (AM_GNU_GETTEXT): In the
"checking for GNU gettext in libintl..." test, add also the special
system library dependencies needed on macOS and AIX.

17 months agostriconveha: pacify gcc -Wcast-align
Paul Eggert [Wed, 15 Nov 2023 08:09:03 +0000 (00:09 -0800)]
striconveha: pacify gcc -Wcast-align

* lib/striconveha.c (uniconv_register_autodetect): Rewrite to
avoid the need to cast from char * to a pointer to a more strictly
aligned type.  Use decls after statements to avoid some repetition.

17 months agovasnprintf: Re-enable parsing of directive with I64 (regr. 2023-03-24).
Johannes Schindelin [Sat, 11 Nov 2023 21:53:33 +0000 (22:53 +0100)]
vasnprintf: Re-enable parsing of directive with I64 (regr. 2023-03-24).

In 480a59ba60 (*printf-posix: ISO C 23: Support size specifiers 'wN' and
'wfN'., 2023-03-24), a major refactoring hides a bug in the conversion
of the code handling Windows' "%I64*" family of printf() formats:
before the refactoring, the "64" part was skipped (as desired), but
afterwards that part is not skipped and therefore the '6' is mistaken
for a conversion character. Which is invalid, of course, causing the
code to error out.

Fix this by skipping the "64" part again.

This bug was uncovered by the Git for Windows project when gettext
v0.22.3 switched to the gnulib code as work horse of the
libintl_vsnprintf() function.

* lib/printf-parse.c (PRINTF_PARSE): When parsing a size specifier
"I64", increment cp by 3, not 1.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copyright-paperwork-exempt: Yes

17 months agotests: In multithreaded tests, use random() instead of rand().
Bruno Haible [Fri, 10 Nov 2023 18:01:40 +0000 (19:01 +0100)]
tests: In multithreaded tests, use random() instead of rand().

* tests/test-asyncsafe-spin2.c (random_account, lock_mutator_thread):
Use random() instead of rand().
* tests/test-lock.c (random_account, lock_mutator_thread,
rwlock_mutator_thread, recshuffle): Likewise.
* tests/test-mtx.c (random_account, lock_mutator_thread, recshuffle):
Likewise.
* tests/test-pthread-mutex.c (random_account, lock_mutator_thread,
recshuffle): Likewise.
* tests/test-pthread-rwlock.c (random_account, rwlock_mutator_thread):
Likewise.
* tests/test-pthread-spin.c (random_account, lock_mutator_thread):
Likewise.
* tests/test-pthread-tss.c (perhaps_yield, worker_thread,
racecheck_thread): Likewise.
* tests/test-thread_local.c (perhaps_yield, worker_thread): Likewise.
* tests/test-tls.c (perhaps_yield, worker_thread, racecheck_thread):
Likewise.
* tests/test-tss.c (perhaps_yield, worker_thread, racecheck_thread):
Likewise.
* asyncsafe-spin-tests (Depends-on): Add random.
* lock-tests (Depends-on): Likewise.
* mtx-tests (Depends-on): Likewise.
* pthread-mutex-tests (Depends-on): Likewise.
* pthread-rwlock-tests (Depends-on): Likewise.
* pthread-spin-tests (Depends-on): Likewise.
* pthread-tss-tests (Depends-on): Likewise.
* threads-h-tests (Depends-on): Likewise.
* tls-tests (Depends-on): Likewise.
* tss-tests (Depends-on): Likewise.

17 months agorandom: Fix multithread-safety bug.
Bruno Haible [Thu, 9 Nov 2023 14:56:32 +0000 (15:56 +0100)]
random: Fix multithread-safety bug.

* m4/random.m4 (gl_FUNC_RANDOM): Override on macOS, FreeBSD, Solaris,
Cygwin, Haiku.
* lib/random.c: Include glthread/lock.h.
(__libc_lock_define_initialized, __libc_lock_lock, __libc_lock_unlock):
Define to do real locking.
* modules/random (Depends-on): Add lock.
* doc/posix-functions/random.texi: Mention the multithread-safety
problem.

17 months agostdio: port better to older macOS
Paul Eggert [Thu, 9 Nov 2023 18:50:30 +0000 (10:50 -0800)]
stdio: port better to older macOS

* lib/stdio.in.h: Do not define _POSIX_C_SOURCE on older macOS,
as it is not needed and defining it causes other problems.
Problem reported by Sevan Janiyan in:
https://mail.gnu.org/r/bug-gnulib/2023-11/msg00039.html

17 months agopthread-rwlock: Port to Mac OS X 10.4.
Bruno Haible [Thu, 9 Nov 2023 02:32:20 +0000 (03:32 +0100)]
pthread-rwlock: Port to Mac OS X 10.4.

Reported by Sevan Janiyan <venture37@geeklan.co.uk>.

* m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): On macOS, test for the
presence of PTHREAD_RWLOCK_INITIALIZER. If it is not defined, don't
attempt to use pthread_rwlock_init.

17 months agotests/unistr/u16-chr-tests: pacify -Wcast-align
Paul Eggert [Wed, 25 Oct 2023 01:40:07 +0000 (18:40 -0700)]
tests/unistr/u16-chr-tests: pacify -Wcast-align

* tests/unistr/test-chr.h (main): Redo types to pacify
gcc -Wcast-align.

17 months agoexplicit_bzero-tests: pacify GCC 13.2.1
Paul Eggert [Wed, 25 Oct 2023 01:33:44 +0000 (18:33 -0700)]
explicit_bzero-tests: pacify GCC 13.2.1

* tests/test-explicit_bzero.c:
* tests/test-memset_explicit.c:
Ignore -Wdangling pointer.

17 months agomemset_explicit, explicit_bzero tests: Fix test failures with new gcc.
Bruno Haible [Mon, 23 Oct 2023 00:04:03 +0000 (02:04 +0200)]
memset_explicit, explicit_bzero tests: Fix test failures with new gcc.

Reported by Sam James <sam@gentoo.org> in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111904>.

Fix by Alexandre Oliva <aoliva@gcc.gnu.org>.

* tests/test-memset_explicit.c (do_secret_stuff): Declare with
attributes 'noclone' and 'noipa'.
* tests/test-explicit_bzero.c (do_secret_stuff): Likewise.

17 months agonet_if tests: Fix gcc warning.
Bruno Haible [Sun, 15 Oct 2023 21:15:55 +0000 (23:15 +0200)]
net_if tests: Fix gcc warning.

* tests/test-net_if.c: Include <string.h>.

17 months agopthread-spin: Fix warnings on FreeBSD 5.2.1/i386.
Bruno Haible [Sun, 15 Oct 2023 21:03:59 +0000 (23:03 +0200)]
pthread-spin: Fix warnings on FreeBSD 5.2.1/i386.

* lib/pthread.in.h (pthread_spinlock_t): Override if <pthread.h> defines
pthread_spinlock_t but we need to approximate spinlocks with mutexes.
* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): When the pthread_spin_*
functions are declared but don't exist, mark them as REPLACEd.

17 months agopthread-spin: Fix link errors on FreeBSD 5.2.1/i386.
Bruno Haible [Sun, 15 Oct 2023 20:00:04 +0000 (22:00 +0200)]
pthread-spin: Fix link errors on FreeBSD 5.2.1/i386.

* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Test not only whether
<pthread.h> defines the pthread_spinlock_t type, but also whether the
function pthread_spin_init is actually defined.

17 months agopthread_mutex_timedlock: Fix link errors on FreeBSD 5.2.1/i386.
Bruno Haible [Sun, 15 Oct 2023 19:57:26 +0000 (21:57 +0200)]
pthread_mutex_timedlock: Fix link errors on FreeBSD 5.2.1/i386.

* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Test
not only whether pthread_mutex_timedlock is declared, but also whether
it is actually defined.

17 months agothreadlib: Fix link errors on FreeBSD 5.2.1/i386.
Bruno Haible [Sun, 15 Oct 2023 19:55:28 +0000 (21:55 +0200)]
threadlib: Fix link errors on FreeBSD 5.2.1/i386.

* m4/threadlib.m4 (gl_PTHREADLIB_BODY): When pthread_kill could not be
found in -lpthread, try -lthr.

17 months agolock: Make Autoconf macro more robust.
Bruno Haible [Sun, 15 Oct 2023 17:10:29 +0000 (19:10 +0200)]
lock: Make Autoconf macro more robust.

* m4/pthread_rwlock_rdlock.m4 (gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER):
Require gl_THREADLIB, not gl_THREADLIB_EARLY. Needed to get the value of
LIBMULTITHREAD.

17 months agovma-iter: Fix compilation error on FreeBSD 5.2.1.
Bruno Haible [Sun, 15 Oct 2023 06:38:43 +0000 (08:38 +0200)]
vma-iter: Fix compilation error on FreeBSD 5.2.1.

* lib/vma-iter.c [FreeBSD]: Include <sys/param.h>.

17 months agoisnanf, isnand: Fix conflict with Solaris <ieeefp.h>.
Bruno Haible [Fri, 13 Oct 2023 10:05:29 +0000 (12:05 +0200)]
isnanf, isnand: Fix conflict with Solaris <ieeefp.h>.

* lib/math.in.h (isnanf, isnand): On Solaris and IRIX, declare this
function, instead of defining it as a macro.

17 months agoisfinite: Work around a bug with 'long double' in glibc 2.5/ia64.
Bruno Haible [Sun, 8 Oct 2023 07:59:03 +0000 (09:59 +0200)]
isfinite: Work around a bug with 'long double' in glibc 2.5/ia64.

* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Require
gl_LONG_DOUBLE_EXPONENT_LOCATION. Test also another NaN value.
* modules/isfinite (Files): Add m4/exponentl.m4.
* doc/posix-functions/isfinite.texi: Mention also a 'long double'
problem on ia64.

17 months ago*printf-posix: Work around bug with %#.0x on Mac OS X 10.6.
Bruno Haible [Tue, 3 Oct 2023 21:27:30 +0000 (23:27 +0200)]
*printf-posix: Work around bug with %#.0x on Mac OS X 10.6.

* lib/vasnprintf.c (VASNPRINTF): Enable NEED_PRINTF_UNBOUNDED_PRECISION-
guarded code also for NEED_PRINTF_FLAG_ALT_PRECISION_ZERO. Set
prec_ourselves to 1 if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO, precision is
0, and the directive is 'x' or 'X'. If prec_ourselves, remove the "0"
output if required.
* m4/printf.m4 (gl_PRINTF_FLAG_ALT_PRECISION_ZERO): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO): New
macro.
(gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS): Invoke it.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Require
gl_PRINTF_FLAG_ALT_PRECISION_ZERO and test its result.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX):
Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise.
* doc/glibc-functions/asprintf.texi: Mention the %#.0x bug.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* doc/glibc-functions/vasprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.

17 months agoupdate-copyright tests: Fix test failure (regression 2023-06-18).
Bruno Haible [Tue, 3 Oct 2023 12:44:21 +0000 (14:44 +0200)]
update-copyright tests: Fix test failure (regression 2023-06-18).

* build-aux/update-copyright: Add "use re 'eval';" declaration.

17 months agostring-c++-tests, uchar-c++-tests: Fix link errors on Mac OS X.
Bruno Haible [Tue, 3 Oct 2023 08:51:06 +0000 (10:51 +0200)]
string-c++-tests, uchar-c++-tests: Fix link errors on Mac OS X.

* modules/string-c++-tests (Makefile.am): Link test-string-c++ with
$(LIBC32CONV).
* modules/uchar-c++-tests (Makefile.am): Link test-uchar-c++ with
$(LIBC32CONV).

19 months agolocalename, gettext: Avoid crash on macOS 14.
Bruno Haible [Mon, 2 Oct 2023 22:28:31 +0000 (00:28 +0200)]
localename, gettext: Avoid crash on macOS 14.

Reported by Shupeng Xue <dspxue@gmail.com> at
<https://lists.gnu.org/archive/html/bug-gettext/2023-10/msg00001.html>.

Cf <https://github.com/aria2/aria2/issues/2083#issuecomment-1694662007>.

* m4/intlmacosx.m4 (gt_INTL_MACOSX): Link with the CoreServices
framework in addition to the CoreFoundation framework.

19 months agolocalcharset: Avoid internal compiler error with -Wextra on macOS 10.5.
Bruno Haible [Mon, 2 Oct 2023 22:10:08 +0000 (00:10 +0200)]
localcharset: Avoid internal compiler error with -Wextra on macOS 10.5.

* lib/localcharset.c (locale_charset): Use an empty compound statement
instead of a null statement.

19 months agoautoupdate
Karl Berry [Thu, 21 Sep 2023 14:07:09 +0000 (07:07 -0700)]
autoupdate

19 months agoautoupdate
Karl Berry [Tue, 19 Sep 2023 16:11:24 +0000 (09:11 -0700)]
autoupdate

19 months agoacl-permissions: Fix compilation error on Solaris 11 (regr. 2023-09-04).
Bruno Haible [Fri, 15 Sep 2023 23:09:31 +0000 (01:09 +0200)]
acl-permissions: Fix compilation error on Solaris 11 (regr. 2023-09-04).

* lib/set-permissions.c: Include minmax.h.
* modules/acl-permissions (Depends-on): Add minmax.

19 months agognu-web-doc-update: fix updating of manual directory
Pádraig Brady [Mon, 11 Sep 2023 18:31:53 +0000 (19:31 +0100)]
gnu-web-doc-update: fix updating of manual directory

* build-aux/gnu-web-doc-update: Correctly change to the 'manual' directory,
since $tmp is a relative path.  This avoids removing files
outside of the 'manual' directory.  Broken since commit e979787d.

19 months agoDon't use 'throw ()' in C++ 11 or newer.
Bruno Haible [Thu, 7 Sep 2023 20:22:43 +0000 (22:22 +0200)]
Don't use 'throw ()' in C++ 11 or newer.

* lib/stddef.in.h (_GL_ATTRIBUTE_NOTHROW):  Provide fallback definition.
(abort): Declare with _GL_ATTRIBUTE_NOTHROW instead of throw().
* lib/malloc.in.h (rpl_free, free): Likewise.
* lib/stdlib.in.h (free): Likewise.
* lib/string.in.h (rpl_free, free, memchr, memrchr, rawmemchr,
strchrnul, strpbrk, strstr, strcasestr): Likewise.
* lib/wchar.in.h (rpl_free, free): Likewise.
* lib/getopt-cdefs.in.h (__THROW): Define to noexcept(true) for C++ 11
or newer.
* lib/md5.h (__THROW): Likewise.