]> Savannah Git Hosting - gnulib.git/log
gnulib.git
10 months agodprintf-posix tests: Skip the memory leak test on macOS.
Bruno Haible [Mon, 3 Jun 2024 13:34:21 +0000 (15:34 +0200)]
dprintf-posix tests: Skip the memory leak test on macOS.

* tests/test-dprintf-posix2.c: Skip the test on macOS.
(main): Return a different exit code at each point. Allow 100 KB extra
memory consumption.
* tests/test-dprintf-posix2.sh: Update.

10 months agopthread-* tests, regex tests: Prepare for use of 'alarm'.
Bruno Haible [Mon, 3 Jun 2024 10:51:08 +0000 (12:51 +0200)]
pthread-* tests, regex tests: Prepare for use of 'alarm'.

* modules/pthread-cond-tests (configure.ac): Test whether 'alarm' is
declared.
* modules/pthread-mutex-tests (configure.ac): Likewise.
* modules/pthread-once-tests (configure.ac): Likewise.
* modules/pthread-rwlock-tests (configure.ac): Likewise.
* modules/pthread-tss-tests (configure.ac): Likewise.
* modules/regex-tests (configure.ac): Likewise.

10 months agomtx tests: Fix a possible link error.
Bruno Haible [Mon, 3 Jun 2024 10:43:06 +0000 (12:43 +0200)]
mtx tests: Fix a possible link error.

* modules/mtx-tests (Files): Add m4/semaphore.m4.
(configure.ac): Require gl_SEMAPHORE.
(Makefile.am): Link test-mtx with @LIB_SEMAPHORE@.

10 months agopthread-mutex, pthread-rwlock: Fix a compilation error.
Bruno Haible [Mon, 3 Jun 2024 10:30:32 +0000 (12:30 +0200)]
pthread-mutex, pthread-rwlock: Fix a compilation error.

* modules/pthread-mutex-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
* modules/pthread-rwlock-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.

10 months agoc-strtod, c-strtof, c-strtold: Fix link error on AIX.
Bruno Haible [Sun, 2 Jun 2024 20:35:23 +0000 (22:35 +0200)]
c-strtod, c-strtof, c-strtold: Fix link error on AIX.

* lib/c-strtod.c (newlocale): Undefine before use.

10 months agoisnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
Bruno Haible [Sun, 2 Jun 2024 16:34:36 +0000 (18:34 +0200)]
isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.

* lib/isnanf-nolibm.h (HAVE_ISNANF_NOLIBM): New macro.
* lib/isnand-nolibm.h (HAVE_ISNAND_NOLIBM): New macro.
* lib/isnanl-nolibm.h (HAVE_ISNANL_NOLIBM): New macro.
* lib/math.h (isnanf): Don't define via isnan if HAVE_ISNANF_NOLIBM is
defined.
(isnand): Don't define via isnan if HAVE_ISNAND_NOLIBM is defined.
(isnanl): Don't define via isnan if HAVE_ISNANL_NOLIBM is defined.

10 months agowindows-once: Improve comments.
Bruno Haible [Sat, 1 Jun 2024 00:31:25 +0000 (02:31 +0200)]
windows-once: Improve comments.

* lib/windows-once.c (glwthread_once): Mention the 'started' field in
the comments.

11 months agoassert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.
Bruno Haible [Thu, 30 May 2024 18:06:58 +0000 (20:06 +0200)]
assert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.

Reported by Harmen <harmen@stoppels.ch> at
<https://savannah.gnu.org/bugs/index.php?65811>.

* lib/verify.h (static_assert): In C++ mode with g++ < 6 and
-std=gnu++11, define in a way that supports also the 1-argument
invocations and the invocations inside C++ struct and class.

11 months agowindows-once: Free allocated resources when done.
Bruno Haible [Thu, 30 May 2024 08:23:22 +0000 (10:23 +0200)]
windows-once: Free allocated resources when done.

Based on an observation regarding Cygwin's pthread_once implementation
by Takashi Yano <takashi.yano@nifty.ne.jp> at
<https://cygwin.com/pipermail/cygwin/2024-January/255182.html> and
<https://cygwin.com/pipermail/cygwin-patches/2024q1/012600.html>

* lib/windows-once.h (glwthread_once_t): Change type of inited to LONG.
Add field 'num_threads'.
(GLWTHREAD_ONCE_INIT): Initialize it to zero.
* lib/windows-once.c (glwthread_once): Use InterlockedCompareExchange
instead of InterlockedIncrement. Increment num_threads while the thread
uses the lock. Let the last thread that uses the lock destroy it.

11 months agocall_once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Thu, 30 May 2024 08:55:40 +0000 (10:55 +0200)]
call_once: Work around Cygwin 3.5.3 bug.

* m4/call_once.m4 (gl_FUNC_CALL_ONCE): Require AC_CANONICAL_HOST.
On Cygwin, set REPLACE_CALL_ONCE to 1.
* lib/call_once.c (call_once): On Cygwin, use a cast, to avoid a
compiler warning.
* modules/call_once (Depends-on): Add pthread-once.
* doc/posix-functions/call_once.texi: Mention the Cygwin bug.

11 months agolock: Work around Cygwin 3.5.3 bug.
Bruno Haible [Wed, 29 May 2024 10:06:46 +0000 (12:06 +0200)]
lock: Work around Cygwin 3.5.3 bug.

* modules/lock (Depends-on): Add pthread-once.

11 months agopthread-once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Tue, 28 May 2024 20:35:54 +0000 (22:35 +0200)]
pthread-once: Work around Cygwin 3.5.3 bug.

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): On Cygwin, set
REPLACE_PTHREAD_ONCE to 1.
* lib/pthread-once.c (pthread_once): Add an implementation for Cygwin.
* doc/posix-functions/pthread_once.texi: Mention the Cygwin bug.

11 months agocall_once tests: Fix link error on mingw.
Bruno Haible [Wed, 29 May 2024 14:59:59 +0000 (16:59 +0200)]
call_once tests: Fix link error on mingw.

* modules/call_once-tests (Depends-on): Add mtx.

11 months agopthread-once tests: Fix crash on mingw.
Bruno Haible [Wed, 29 May 2024 11:41:20 +0000 (13:41 +0200)]
pthread-once tests: Fix crash on mingw.

* modules/pthread-once-tests (Depends-on): Add pthread-rwlock.

11 months agonstrftime: Make %r work on macOS, FreeBSD, native Windows.
Bruno Haible [Mon, 27 May 2024 21:29:36 +0000 (23:29 +0200)]
nstrftime: Make %r work on macOS, FreeBSD, native Windows.

* doc/posix-functions/strftime.texi: Mention the %r problem.
* lib/nstrftime.c (__strftime_internal): On macOS, FreeBSD, and native
Windows, for %r, use the English AM/PM format.

11 months agonstrftime: Make %h work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:17:01 +0000 (23:17 +0200)]
nstrftime: Make %h work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %h problem.
* lib/nstrftime.c (__strftime_internal): On native Windows, for %h, do a
%b directive.

11 months agonstrftime: Make %c work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:01:50 +0000 (23:01 +0200)]
nstrftime: Make %c work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %c problem.
* lib/nstrftime.c: Include <locale.h>. Include hard-locale.h.
(__strftime_internal): For %c, use a subformat that contains the weekday
name (or abbrev.) and the month name (or abbrev.).
* modules/nstrftime (Depends-on): Add hard-locale.
(Link): New section.
* modules/nstrftime-tests (Makefile.am): Link test-nstrftime with
$(HARD_LOCALE_LIB).

11 months agotests: Fix internationalization problems on native Windows.
Bruno Haible [Mon, 27 May 2024 20:33:33 +0000 (22:33 +0200)]
tests: Fix internationalization problems on native Windows.

* doc/posix-functions/setlocale.texi: Clarify the deficiency of
setlocale() on native Windows.
* modules/dfa-tests (Depends-on): Add setlocale.
* modules/hard-locale-tests (Depends-on): Likewise.
* modules/localcharset-tests (Depends-on): Likewise.
* modules/nstrftime-tests (Depends-on): Likewise.

11 months agoparse-datetime tests: Avoid failure on native Windows.
Bruno Haible [Mon, 27 May 2024 15:42:20 +0000 (17:42 +0200)]
parse-datetime tests: Avoid failure on native Windows.

* tests/test-parse-datetime.c (SOME_TIMEPOINT): New macro.
(main): Use it. On native Windows, use Windows time zone names.
Invoke tzset() after setting TZ.
* doc/posix-functions/gmtime.texi: Mention the native Windows problem.
* doc/posix-functions/localtime.texi: Likewise.

11 months agotests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.
Bruno Haible [Mon, 27 May 2024 11:13:38 +0000 (13:13 +0200)]
tests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.

* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Add a sanity check with mbrtowc.

11 months agoeuidaccess: Fix test failure on native Windows.
Bruno Haible [Sat, 25 May 2024 13:48:32 +0000 (15:48 +0200)]
euidaccess: Fix test failure on native Windows.

* lib/euidaccess.c: Don't include <io.h>.
(euidaccess): On native Windows, invoke access, not _access.

11 months agouchar-c23: Speed up mbrtoc32 on Solaris 11.4.
Bruno Haible [Sat, 25 May 2024 10:14:29 +0000 (12:14 +0200)]
uchar-c23: Speed up mbrtoc32 on Solaris 11.4.

* lib/lc-charset-unicode.c (get_converters): Cache the return value.

11 months agombrtoc32: Work around bug in Cygwin 3.5.3.
Bruno Haible [Thu, 23 May 2024 21:46:52 +0000 (23:46 +0200)]
mbrtoc32: Work around bug in Cygwin 3.5.3.

* m4/mbrtoc32.m4 (gl_MBRTOC32_UTF8_LOCALE): New macro.
(gl_FUNC_MBRTOC32): Invoke it. If mbrtoc32 has this bug, define
MBRTOC32_MULTIBYTE_LOCALE_BUG and reset LOCALE_ZH_CN to 'none'.
* lib/mbrtoc32.c (mbrtoc32): Test MBRTOC32_MULTIBYTE_LOCALE_BUG.
* doc/posix-functions/mbrtoc32.texi: Mention the Cygwin bug.

11 months agoc32is*, c32toupper tests: Avoid test failures on Cygwin.
Bruno Haible [Thu, 23 May 2024 15:00:58 +0000 (17:00 +0200)]
c32is*, c32toupper tests: Avoid test failures on Cygwin.

* tests/test-c32isalpha.c (main): Disable tests that fail on
Cygwin 3.5.3.
* 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.

11 months agopoll tests: Avoid test failure on Cygwin.
Bruno Haible [Thu, 23 May 2024 14:25:01 +0000 (16:25 +0200)]
poll tests: Avoid test failure on Cygwin.

* tests/test-poll.c (test_pipe): Disable the POLLHUP check also on
Cygwin.
* doc/posix-functions/poll.texi: Mention also Cygwin w.r.t. POLLHUP.

11 months agorenameatu: Work around Cygwin 3.4.6 bug.
Bruno Haible [Thu, 23 May 2024 13:15:40 +0000 (15:15 +0200)]
renameatu: Work around Cygwin 3.4.6 bug.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Test whether renameat2 works, and
define HAVE_WORKING_RENAMEAT2 if so.
* lib/renameatu.c (renameatu): Test HAVE_WORKING_RENAMEAT2 instead of
HAVE_RENAMEAT2.

11 months agoreadlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6.
Bruno Haible [Thu, 23 May 2024 10:47:00 +0000 (12:47 +0200)]
readlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6.

* tests/test-readlink.h (test_readlink): For an empty file name, allow
errno == EBADF.
* tests/test-areadlink.h (test_areadlink): Likewise.

11 months agoiconv: Reject the broken macOS 14.4 iconv implementation.
Bruno Haible [Wed, 22 May 2024 23:10:18 +0000 (01:10 +0200)]
iconv: Reject the broken macOS 14.4 iconv implementation.

Reported by Daniel Collins <solemnwarning@solemnwarning.net> at
<https://savannah.gnu.org/bugs/?65686>.

* m4/iconv.m4 (AM_ICONV_LINK): In the test "for working iconv", test
against the macOS 14.4 iconv bug.
* doc/posix-functions/iconv.texi: Document the bug.

11 months agostdlib: Handle glibc special invocation conventions correctly.
Bruno Haible [Wed, 22 May 2024 22:53:39 +0000 (00:53 +0200)]
stdlib: Handle glibc special invocation conventions correctly.

* lib/stdlib.in.h: Undefine __need_malloc_and_calloc after doing the

11 months agoc-strtod: include <stdio.h>
Paul Eggert [Wed, 22 May 2024 06:32:14 +0000 (23:32 -0700)]
c-strtod: include <stdio.h>

* lib/c-strtod.c: Include <stdio.h>, since we call sprintf.
Problem found by Oracle Developer Studio 12.6 on Solaris 10.

11 months agovasnprintf: Don't abort for pseudo-denormal arguments on macOS 12.
Bruno Haible [Mon, 20 May 2024 22:33:55 +0000 (00:33 +0200)]
vasnprintf: Don't abort for pseudo-denormal arguments on macOS 12.

Reported by Gaëtan Herfray <g.herfray@gahfy.io> via Erik Blake in
<https://lists.gnu.org/archive/html/bug-m4/2022-03/msg00002.html>
<https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00066.html>.

* lib/vasnprintf.c (safe_frexpl): New function.
(decode_long_double, floorlog10l): Invoke it instead of frexpl.

11 months agogetopt-posix: port better to Alpine 3.20.0_rc1
Paul Eggert [Mon, 20 May 2024 21:55:11 +0000 (14:55 -0700)]
getopt-posix: port better to Alpine 3.20.0_rc1

Alpine’s <sys/cdefs.h> is a stub that issues a deprecation #warning.
* m4/getopt.m4 (gl_GETOPT_SUBSTITUTE_HEADER):
* m4/sched_h.m4 (gl_SCHED_H): Use the new macro
gl_CHECK_HEADER_SYS_CDEFS_H instead of checking independently.
* m4/sys_cdefs_h.m4: New file.
* modules/getopt-posix, modules/sched (Files): Add m4/sys_cdefs_h.m4.

11 months agoutimensat, utimens: Work around NetBSD 10.0 bugs.
Collin Funk [Mon, 20 May 2024 21:23:41 +0000 (14:23 -0700)]
utimensat, utimens: Work around NetBSD 10.0 bugs.

* lib/utimens.c (fdutimens): Work around a NetBSD 10.0 UTIME_OMIT bug in
the same way as Linux kernel 2.6.32 and Solaris 11.1.
(lutimens): Likewise.
* lib/utimensat.c (rpl_utimensat): Likewise. Workaround a NetBSD 10.0
bug where invalid tv_nsec values are not rejected in the same way as
Linux kernel 2.6.22.19 on hppa.
* doc/posix-functions/utimensat.texi: Document the invalid tv_nsec bug.

11 months agomkfifoat: Work around a macOS 14 bug.
Bruno Haible [Sun, 19 May 2024 09:55:13 +0000 (11:55 +0200)]
mkfifoat: Work around a macOS 14 bug.

* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Also test the case of a dangling
symlink.
* doc/posix-functions/mkfifoat.texi: Mention the macOS bug.

11 months agodup3: Fix behavior for equal file descriptors on NetBSD.
Collin Funk [Sat, 18 May 2024 23:34:55 +0000 (16:34 -0700)]
dup3: Fix behavior for equal file descriptors on NetBSD.

* lib/dup3.c (dup3) [__NetBSD__]: Check for equal file descriptors upon
a successful call to dup3. If they are equal fail with errno == EINVAL.

11 months agounistd: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sat, 18 May 2024 00:49:02 +0000 (02:49 +0200)]
unistd: Fix compilation error with MSVC in C++ mode.

* lib/unistd.in.h (read, write): Use _GL_CXXALIAS_MDA_CAST instead of
_GL_CXXALIAS_MDA.

11 months agotests: Fix dependencies to test-framework-sh.
Bruno Haible [Fri, 17 May 2024 13:18:32 +0000 (15:18 +0200)]
tests: Fix dependencies to test-framework-sh.

* modules/argp-tests (Depends-on): Add test-framework-sh.
* modules/argp-version-etc-tests (Depends-on): Likewise.
* modules/dfa-tests (Depends-on): Likewise.
* modules/error-tests (Depends-on): Likewise.
* modules/readtokens-tests (Depends-on): Likewise.
* modules/string-desc-tests (Depends-on): Likewise.
* modules/verror-tests (Depends-on): Likewise.
* modules/xstdopen-tests (Depends-on): Remove test-framework-sh.

11 months agosys_select: Fix compilation error in C++ mode on macOS 13, 14.
Bruno Haible [Fri, 17 May 2024 10:09:30 +0000 (12:09 +0200)]
sys_select: Fix compilation error in C++ mode on macOS 13, 14.

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

11 months agoerror-h: Avoid namespace pollution on mingw.
Bruno Haible [Sat, 11 May 2024 21:21:08 +0000 (23:21 +0200)]
error-h: Avoid namespace pollution on mingw.

* lib/error.in.h: Don't include mingw's <error.h>.

11 months agounistr/u8-strstr tests: Avoid test failure with ASAN.
Bruno Haible [Thu, 9 May 2024 14:30:01 +0000 (16:30 +0200)]
unistr/u8-strstr tests: Avoid test failure with ASAN.

* tests/unistr/test-u8-strstr.c (main): Increase timeout to 50 sec.
* tests/unistr/test-u16-strstr.c (main): Likewise.
* tests/unistr/test-u32-strstr.c (main): Likewise.

11 months agofree tests: Avoid test failure with ASAN.
Bruno Haible [Thu, 9 May 2024 13:06:40 +0000 (15:06 +0200)]
free tests: Avoid test failure with ASAN.

* tests/test-free.c (main): Skip mmap/munmap based test if ASAN is
enabled.

11 months agoexplicit_bzero, memset_explicit tests: Avoid test failures with ASAN.
Bruno Haible [Thu, 9 May 2024 12:01:10 +0000 (14:01 +0200)]
explicit_bzero, memset_explicit tests: Avoid test failures with ASAN.

* tests/test-explicit_bzero.c (test_heap, test_stack): Define to empty
if ASAN is enabled.
* tests/test-memset_explicit.c (test_heap, test_stack): Likewise.

11 months agodprintf-posix, fprintf-posix tests: Avoid test failures with ASAN.
Bruno Haible [Thu, 9 May 2024 10:56:55 +0000 (12:56 +0200)]
dprintf-posix, fprintf-posix tests: Avoid test failures with ASAN.

* tests/test-dprintf-posix2.c (main): Skip the test if ASAN is enabled.
* tests/test-fprintf-posix3.c (main): Likewise.
* tests/test-dprintf-posix2.sh: Update.
* tests/test-fprintf-posix3.sh: Likewise.

11 months agosigsegv, c-stack tests: Avoid test failures with ASAN.
Bruno Haible [Wed, 8 May 2024 23:41:52 +0000 (01:41 +0200)]
sigsegv, c-stack tests: Avoid test failures with ASAN.

* tests/test-sigsegv-catch-stackoverflow1.c
(HAVE_STACK_OVERFLOW_RECOVERY): Undefine if ASAN is enabled.
* tests/test-sigsegv-catch-stackoverflow2.c
(HAVE_STACK_OVERFLOW_RECOVERY): Likewise.
* tests/test-c-stack.c (main): Skip the test if ASAN is enabled.

11 months agoargp: Fix test failure with clang's ASAN.
Bruno Haible [Wed, 8 May 2024 23:25:15 +0000 (01:25 +0200)]
argp: Fix test failure with clang's ASAN.

Reported in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-12/msg00035.html>.

* m4/argp.m4 (gl_ARGP): Rename argp_parse to rpl_argp_parse.

11 months agomaint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk.
Simon Josefsson [Fri, 3 May 2024 06:44:03 +0000 (08:44 +0200)]
maint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk.

* top/maint.mk (indent_args): Use --ignore-profile.

11 months agostddef: A better workaround against GCC bug 114870.
Bruno Haible [Wed, 1 May 2024 22:10:21 +0000 (00:10 +0200)]
stddef: A better workaround against GCC bug 114870.

* lib/stddef.in.h: If STDDEF_NOT_IDEMPOTENT is 1, disable the special
invocation convention.
* m4/stddef_h.m4 (gl_STDDEF_H): Set STDDEF_NOT_IDEMPOTENT.
(gl_STDDEF_H_DEFAULTS): Initialize STDDEF_NOT_IDEMPOTENT.
* modules/stddef (Makefile.am): Substitute STDDEF_NOT_IDEMPOTENT.

11 months agoautoupdate
Karl Berry [Wed, 1 May 2024 15:12:11 +0000 (08:12 -0700)]
autoupdate

11 months agonullptr: work around GCC 14 nullptr sentinel bug
Paul Eggert [Sat, 27 Apr 2024 17:31:45 +0000 (10:31 -0700)]
nullptr: work around GCC 14 nullptr sentinel bug

* m4/nullptr.m4 (gl_NULLPTR): Work around GCC bug 114780.

11 months agostddef: work around a GCC 14 stddef.h bug
Paul Eggert [Sat, 27 Apr 2024 16:09:38 +0000 (09:09 -0700)]
stddef: work around a GCC 14 stddef.h bug

* lib/stddef.in.h: (_GCC_NULLPTR_T): Define if needed to work around
GCC bug 114869.
* m4/stddef_h.m4 (gl_STDDEF_H, gl_STDDEF_H_DEFAULTS):
* modules/stddef (stddef.h):
Detect the two bugs 114869 and 114870.

12 months agologin_tty tests: Avoid gcc warnings.
Bruno Haible [Sat, 27 Apr 2024 00:22:05 +0000 (02:22 +0200)]
login_tty tests: Avoid gcc warnings.

* tests/test-login_tty.c: Include ignore-value.h.
(main): Ignore the results of the freopen calls.
* modules/login_tty-tests (Depends-on): Add ignore-value.

12 months agoc32srtombs,mbsrtoc32s,mbsrtowcs,wcsrtombs: pacify GCC 14
Paul Eggert [Wed, 24 Apr 2024 19:43:28 +0000 (12:43 -0700)]
c32srtombs,mbsrtoc32s,mbsrtowcs,wcsrtombs: pacify GCC 14

* lib/c32srtombs-state.c (_gl_c32srtombs_state):
* lib/mbsrtoc32s-state.c (_gl_mbsrtoc32s_state):
* lib/mbsrtowcs-state.c (_gl_mbsrtowcs_state):
* lib/wcsrtombs-state.c (_gl_wcsrtombs_state):
Add an extern decl for a “private” extern symbol, to pacify GCC
14’s -Wmissing-variable-declarations option.

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.