]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agoResolve conflicts for functions introduced in Android API level 21.
Bruno Haible [Sun, 22 Jan 2023 10:48:22 +0000 (11:48 +0100)]
Resolve conflicts for functions introduced in Android API level 21.

* lib/stdlib.in.h (_Exit): Consider REPLACE__EXIT. Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
(getprogname): Consider REPLACE_GETPROGNAME. Disable _GL_CXXALIASWARN
invocation on non-glibc systems.
(posix_openpt): Consider REPLACE_POSIX_OPENPT. Disable _GL_CXXALIASWARN
invocation on non-glibc systems.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE__EXIT,
REPLACE_GETPROGNAME, REPLACE_POSIX_OPENPT.
* modules/stdlib (Makefile.am): Substitute REPLACE__EXIT,
REPLACE_GETPROGNAME, REPLACE_POSIX_OPENPT.
* m4/_Exit.m4 (gl_FUNC__EXIT): Conditionally set REPLACE__EXIT.
* modules/_Exit (configure.ac): Consider REPLACE__EXIT.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Conditionally set
REPLACE_GETPROGNAME.
* modules/getprogname (configure.ac): Consider REPLACE_GETPROGNAME.
* m4/posix_openpt.m4 (gl_FUNC_POSIX_OPENPT): Conditionally set
REPLACE_POSIX_OPENPT.
* modules/posix_openpt (configure.ac): Consider REPLACE_POSIX_OPENPT.

2 years agoResolve conflicts for functions introduced in Android API level 21.
Bruno Haible [Sun, 22 Jan 2023 10:47:22 +0000 (11:47 +0100)]
Resolve conflicts for functions introduced in Android API level 21.

* lib/search.in.h (twalk): Consider REPLACE_TWALK.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize REPLACE_TWALK.
* modules/search (Makefile.am): Substitute REPLACE_TWALK.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TWALK.
* modules/tsearch (configure.ac): Consider REPLACE_TWALK.

2 years agoResolve conflicts for functions introduced in Android API level 19.
Bruno Haible [Sun, 22 Jan 2023 10:42:32 +0000 (11:42 +0100)]
Resolve conflicts for functions introduced in Android API level 19.

* lib/inttypes.in.h (imaxabs): Consider REPLACE_IMAXABS. Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
(imaxdiv): Consider REPLACE_IMAXDIV. Disable _GL_CXXALIASWARN invocation
on non-glibc systems.
* m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Initialize HAVE_IMAXABS,
HAVE_IMAXDIV, REPLACE_IMAXABS, REPLACE_IMAXDIV.
* modules/inttypes-incomplete (Makefile.am): Substitute REPLACE_IMAXABS,
REPLACE_IMAXDIV.
* m4/imaxabs.m4 (gl_FUNC_IMAXABS): Conditionally set HAVE_IMAXABS,
REPLACE_IMAXABS.
* modules/imaxabs (configure.ac): Consider HAVE_IMAXABS, REPLACE_IMAXABS.
* m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Conditionally set HAVE_IMAXDIV,
REPLACE_IMAXDIV.
* modules/imaxdiv (configure.ac): Consider HAVE_IMAXDIV, REPLACE_IMAXDIV.

2 years agoResolve conflicts for functions introduced in Android API level 19.
Bruno Haible [Sun, 22 Jan 2023 01:43:23 +0000 (02:43 +0100)]
Resolve conflicts for functions introduced in Android API level 19.

* m4/futimens.m4 (gl_FUNC_FUTIMENS): Conditionally set REPLACE_FUTIMENS.
* lib/sys_stat.in.h (futimens): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 18.
Bruno Haible [Sun, 22 Jan 2023 01:25:19 +0000 (02:25 +0100)]
Resolve conflicts for functions introduced in Android API level 18.

* m4/log2.m4 (gl_FUNC_LOG2): Conditionally set REPLACE_LOG2.
* m4/log2f.m4 (gl_FUNC_LOG2F): Conditionally set REPLACE_LOG2F.
* m4/log2l.m4 (gl_FUNC_LOG2L): Conditionally set REPLACE_LOG2L.
* lib/math.in.h (log2f): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 18.
Bruno Haible [Sun, 22 Jan 2023 01:22:22 +0000 (02:22 +0100)]
Resolve conflicts for functions introduced in Android API level 18.

* m4/getdelim.m4 (gl_FUNC_GETDELIM): Conditionally set REPLACE_GETDELIM.
* m4/getline.m4 (gl_FUNC_GETLINE): Conditionally set REPLACE_GETLINE.
* lib/stdio.in.h (getdelim, getline): Disable _GL_CXXALIASWARN
invocation on non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 16-17.
Bruno Haible [Sun, 22 Jan 2023 01:08:45 +0000 (02:08 +0100)]
Resolve conflicts for functions introduced in Android API level 16-17.

* m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN): Conditionally set
REPLACE_POSIX_MEMALIGN.
* lib/stdlib.in.h (posix_memalign): Disable _GL_CXXALIASWARN invocation
on non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 16.
Bruno Haible [Sun, 22 Jan 2023 01:05:15 +0000 (02:05 +0100)]
Resolve conflicts for functions introduced in Android API level 16.

* m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TSEARCH.
* lib/search.in.h (tsearch, tfind, tdelete, twalk): Disable
_GL_CXXALIASWARN invocation on non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 16.
Bruno Haible [Sun, 22 Jan 2023 01:00:51 +0000 (02:00 +0100)]
Resolve conflicts for functions introduced in Android API level 16.

* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Conditionally set
REPLACE_FACCESSAT.
* lib/unistd.in.h (faccessat): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 12.
Bruno Haible [Sun, 22 Jan 2023 00:46:21 +0000 (01:46 +0100)]
Resolve conflicts for functions introduced in Android API level 12.

* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Conditionally set
REPLACE_UTIMENSAT.
* lib/sys_stat.in.h (utimensat): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 12.
Bruno Haible [Sun, 22 Jan 2023 00:41:06 +0000 (01:41 +0100)]
Resolve conflicts for functions introduced in Android API level 12.

* m4/timegm.m4 (gl_FUNC_TIMEGM): Conditionally set REPLACE_TIMEGM.
* lib/time.in.h (timegm): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 12.
Bruno Haible [Sun, 22 Jan 2023 00:38:16 +0000 (01:38 +0100)]
Resolve conflicts for functions introduced in Android API level 12.

* m4/pwrite.m4 (gl_FUNC_PWRITE): Conditionally set REPLACE_PWRITE.
* lib/unistd.in.h (pwrite): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 12.
Bruno Haible [Sun, 22 Jan 2023 00:36:31 +0000 (01:36 +0100)]
Resolve conflicts for functions introduced in Android API level 12.

* m4/pread.m4 (gl_FUNC_PREAD): Conditionally set REPLACE_PREAD.
* lib/unistd.in.h (pread): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 12.
Bruno Haible [Sun, 22 Jan 2023 00:34:16 +0000 (01:34 +0100)]
Resolve conflicts for functions introduced in Android API level 12.

* m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Conditionally set
REPLACE_FTRUNCATE.
* lib/unistd.in.h (ftruncate): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoResolve conflicts for functions introduced in Android API level 9.
Bruno Haible [Sun, 22 Jan 2023 00:23:47 +0000 (01:23 +0100)]
Resolve conflicts for functions introduced in Android API level 9.

* lib/unistd.in.h (fdatasync): Consider REPLACE_FDATASYNC. Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
(pipe2): Consider REPLACE_PIPE2. Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_FDATASYNC,
REPLACE_PIPE2.
* modules/unistd (Makefile.am): Substitute REPLACE_FDATASYNC,
REPLACE_PIPE2.
* m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Test for fdatasync using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. Conditionally set
REPLACE_FDATASYNC.
* modules/fdatasync (Depends-on, configure.ac): Consider
REPLACE_FDATASYNC.
* m4/pipe2.m4 (gl_FUNC_PIPE2): Conditionally set REPLACE_PIPE2.

2 years agoResolve conflicts for functions introduced in Android API level 8.
Bruno Haible [Sun, 22 Jan 2023 00:19:44 +0000 (01:19 +0100)]
Resolve conflicts for functions introduced in Android API level 8.

* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Conditionally set
REPLACE_TTYNAME_R.
* lib/unistd.in.h (ttyname_r): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

2 years agoPrepare for resolving conflicts regarding future Android API levels.
Bruno Haible [Sun, 22 Jan 2023 00:19:13 +0000 (01:19 +0100)]
Prepare for resolving conflicts regarding future Android API levels.

* m4/gnulib-common.m4 (gl_CHECK_FUNCS_ANDROID): Don't check for the
function declaration on platforms other than Android. Set a variable
gl_cv_onwards_func_<func>.

2 years agoFix ChangeLog typo in previous commit.
Paul Eggert [Sun, 22 Jan 2023 06:53:15 +0000 (00:53 -0600)]
Fix ChangeLog typo in previous commit.

2 years agosigsegv, vma-iter: port to Solaris 10
Paul Eggert [Sun, 22 Jan 2023 06:49:04 +0000 (00:49 -0600)]
sigsegv, vma-iter: port to Solaris 10

On this platform, <sys/types.h> does not define off_t if neither
_LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we
#undef _FILE_OFFSET_BITS.  This became a problem with the new way
of doing stdbool, since config.h now includes <stdbool.h>, and
Solaris 10 <stdbool.h> includes <sys/feature_tests.h> which
arranges for _FILE_OFFSET_BITS to always be defined (if only to 32),
which <sys/types.h> assumes.
* lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]:
Define to 32 instead of leaving undefined.

2 years agologin_tty: Ensure declaration in <utmp.h>.
Bruno Haible [Sat, 21 Jan 2023 20:13:20 +0000 (21:13 +0100)]
login_tty: Ensure declaration in <utmp.h>.

* tests/test-utmp-c++.cc: New file.
* modules/utmp-c++-tests: New file.

* tests/test-utmp.c: New file.
* modules/utmp-tests: New file.

* lib/login_tty.c: Include <utmp.h>.
* m4/login_tty.m4: New file.
(gl_FUNC_LOGIN_TTY): Moved here from m4/pty.m4. Set HAVE_LOGIN_TTY.
* m4/pty.m4 (gl_FUNC_LOGIN_TTY): Moved to m4/login_tty.m4.
* modules/login_tty (Files): Add m4/login_tty.m4.
(Depends-on): Add utmp. Remove pty. Update condition.
(configure.ac): Update condition. Invoke gl_UTMP_MODULE_INDICATOR
instead of gl_PTY_MODULE_INDICATOR.
(Include): List <utmp.h>.
* doc/glibc-functions/login_tty.texi: Mark the include file diversity as
fixed.
* tests/test-login_tty.c: Include <utmp.h>. Don't declare login_tty
here.

* lib/utmp.in.h: New file.
* m4/utmp_h.m4: New file.
* modules/utmp: New file.
* doc/glibc-headers/utmp.texi: New file.
* doc/gnulib.texi (Glibc Header File Substitutes): Include it.

2 years agologin_tty: Fix detection of declaration (regression 2023-01-19).
Bruno Haible [Sat, 21 Jan 2023 20:00:19 +0000 (21:00 +0100)]
login_tty: Fix detection of declaration (regression 2023-01-19).

* m4/pty.m4 (gl_FUNC_LOGIN_TTY): Check for the three possible header
files.

2 years agoautoupdate
Karl Berry [Sat, 21 Jan 2023 16:09:55 +0000 (08:09 -0800)]
autoupdate

2 years agoalignasof tests: Rename test file.
Bruno Haible [Sat, 21 Jan 2023 09:07:19 +0000 (10:07 +0100)]
alignasof tests: Rename test file.

* tests/test-alignasof.c: Renamed from tests/test-stdalign.c.
* modules/alignasof-tests (Files, Makefile.am): Update accordingly.

2 years agoalignasof tests: Fix GCC warning (regression 2023-01-15).
Bruno Haible [Sat, 21 Jan 2023 09:01:45 +0000 (10:01 +0100)]
alignasof tests: Fix GCC warning (regression 2023-01-15).

* tests/test-stdalign.c (alignas): Undefine before redefine.

2 years agogetprogname: Move declaration from "getprogname.h" to <stdlib.h>.
Bruno Haible [Sat, 21 Jan 2023 08:43:50 +0000 (09:43 +0100)]
getprogname: Move declaration from "getprogname.h" to <stdlib.h>.

* lib/stdlib.in.h (getprogname): New declaration.
* lib/getprogname.h: Add deprecation warning.
(getprogname): Remove declaration.
* lib/getprogname.c: Include <stdlib.h> instead of getprogname.h.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether getprogname is declared.
(gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPROGNAME.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_GETPROGNAME.
* m4/getprogname.m4 (gl_PREREQ_GETPROGNAME): New macro, extracted from
gl_FUNC_GETPROGNAME. Set HAVE_GETPROGNAME.
(gl_FUNC_GETPROGNAME): Remove code that was moved to
gl_PREREQ_GETPROGNAME.
* modules/stdlib (Makefile.am): Substitute GNULIB_GETPROGNAME and
HAVE_GETPROGNAME.
* modules/getprogname (Depends-on): Add stdlib.
(configure.ac): Define a module indicator. Invoke gl_PREREQ_GETPROGNAME.
(Makefile.am): Don't compile getprogname.c if not needed.
(Include): List <stdlib.h> instead of getprogname.h.
* tests/test-getprogname.c: Include <stdlib.h> instead of getprogname.h.
* NEWS: Mention the change.
* lib/argmatch.c: Don't include getprogname.h.
* lib/c-stack.c: Likewise.
* lib/error.c: Likewise.
* lib/git-merge-changelog.c: Likewise.

2 years agogendocs.sh comment spelling fix
Paul Eggert [Sat, 21 Jan 2023 06:30:29 +0000 (00:30 -0600)]
gendocs.sh comment spelling fix

2 years agosnippet/_Noreturn: work around Clang _Noreturn bug
Paul Eggert [Fri, 20 Jan 2023 03:39:03 +0000 (19:39 -0800)]
snippet/_Noreturn: work around Clang _Noreturn bug

This is a bigger-hammer workaround for the clang _Noreturn issue
fix for dfa.c on 2023-01-01.  Unfortunately, it causes 270
-Wreturn-type and -Wsometimes-uninitialized warnings when building
bleeding-edge GNU Emacs from Git on Fedora 37 with plain
‘./configure && make’.  So the workaround is enabled only if you
compile with -D_GL_WORK_AROUND_LLVM_BUG_59792.
* lib/_Noreturn.h (_Noreturn):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
#define _Noreturn to be empty if it is Clang 15 or earlier,
and if _GL_WORK_AROUND_LLVM_BUG_59792 is defined.

2 years agoFix warnings for functions introduced in Android API level 34.
Bruno Haible [Thu, 19 Jan 2023 20:55:45 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 34.

* modules/execute-tests (configure.ac): Test for close_range using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

2 years agoFix warnings for functions introduced in Android API level 30.
Bruno Haible [Thu, 19 Jan 2023 20:55:42 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 30.

* m4/threadlib.m4 (gl_STDTHREADLIB_BODY): Test for thrd_create using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

2 years agoFix warnings for functions introduced in Android API level 29.
Bruno Haible [Thu, 19 Jan 2023 20:55:39 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 29.

* m4/getloadavg.m4 (gl_GETLOADAVG): Test for getloadavg using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.

2 years agoFix warnings for functions introduced in Android API level 28.
Bruno Haible [Thu, 19 Jan 2023 20:55:37 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 28.

* m4/glob.m4 (gl_GLOB): Test for glob using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.

2 years agoFix warnings for functions introduced in Android API level 26.
Bruno Haible [Thu, 19 Jan 2023 20:55:35 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 26.

* m4/mountlist.m4 (gl_MOUNTLIST): Test for hasmntopt using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Test for nl_langinfo using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/strtod.m4 (gl_PREREQ_STRTOD): Test for nl_langinfo using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_A): Likewise.
* m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Test for catgets using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimens.m4 (gl_UTIMENS): Test for lutimes using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Test for nl_langinfo_l using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/duplocale-tests (configure.ac): Likewise.
* m4/getdomainname.m4 (gl_FUNC_GETDOMAINNAME): Update comment.

2 years agoFix warnings for functions introduced in Android API level 24.
Bruno Haible [Thu, 19 Jan 2023 20:55:32 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 24.

* m4/strchrnul.m4 (gl_FUNC_STRCHRNUL): Test for strchrnul using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

2 years agoFix warnings for functions introduced in Android API level 23.
Bruno Haible [Thu, 19 Jan 2023 20:55:29 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 23.

* m4/fbufmode.m4 (gl_FUNC_FBUFMODE): Test for __flbf, __fbufsize using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/filenamecat.m4 (gl_FILE_NAME_CONCAT_LGPL): Test for mempcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Test for __fpurge using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/freadable.m4 (gl_FUNC_FREADABLE): Test for __freadable using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/fwritable.m4 (gl_FUNC_FWRITABLE): Test for __fwritable using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/getpass.m4 (gl_FUNC_GETPASS_GNU): Test for __fsetlocking using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mempcpy.m4 (gl_FUNC_MEMPCPY): Test for mempcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mkfifoat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mkostemp.m4 (gl_FUNC_MKOSTEMP): Test for mkostemp using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mkostemps.m4 (gl_FUNC_MKOSTEMPS): Test for mkostemps using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/pty.m4 (gl_FUNC_LOGIN_TTY): Test for login_tty using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/sethostname.m4 (gl_FUNC_SETHOSTNAME): Test for sethostname using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Test for strerror_r using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/wmempcpy.m4 (gl_FUNC_WMEMPCPY): Test for wmempcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

2 years agoFix warnings for functions introduced in Android API level 21.
Bruno Haible [Thu, 19 Jan 2023 20:55:27 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 21.

* m4/_Exit.m4 (gl_FUNC__EXIT): Test for _Exit using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/c-strtod.m4 (gl_C_STRTOLD): Test for strtold_l using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Test for c32rtomb like
gl_CHECK_FUNCS_ANDROID does.
* m4/dprintf.m4 (gl_FUNC_DPRINTF): Test for dprintf using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Likewise.
* m4/dup3.m4 (gl_FUNC_DUP3): Test for dup3 using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Test for duplocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/execvpe.m4 (gl_FUNC_EXECVPE): Test for execvpe using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Test for fts_open using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Test for getprogname using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): Test for uselocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/iswblank.m4 (gl_FUNC_ISWBLANK): Test for iswblank using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Test for
tcdrain using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/linkat.m4 (gl_FUNC_LINKAT): Test for linkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/localename.m4 (gl_LOCALENAME): Test for newlocale, duplocale,
freelocale using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mbrtoc32.m4 (gl_CHECK_FUNC_MBRTOC32): Test for mbrtoc32 like
gl_CHECK_FUNCS_ANDROID does.
* m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Test for mbsnrtowcs using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mbtowc.m4 (gl_FUNC_MBTOWC): Test for mbtowc using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mountlist.m4 (gl_MOUNTLIST): Test for setmntent, endmntent using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/posix_openpt.m4 (gl_FUNC_POSIX_OPENPT): Test for posix_openpt using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/pty.m4 (gl_FUNC_OPENPTY): Test for posix_openpt using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/random.m4 (gl_FUNC_RANDOM): Test for initstate, setstate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/stpcpy.m4 (gl_FUNC_STPCPY): Test for stpcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/stpncpy.m4 (gl_FUNC_STPNCPY): Test for stpncpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Test for symlinkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/truncate.m4 (gl_FUNC_TRUNCATE): Test for truncate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Test for twalk using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/vdprintf.m4 (gl_FUNC_VDPRINTF): Test for vdprintf using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/wcsnrtombs.m4 (gl_FUNC_WCSNRTOMBS): Test for wcsnrtombs using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Test for readlinkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT): Likewise.
* modules/careadlinkat (configure.ac): Likewise.
* modules/ftoastr (configure.ac): Test for strtof using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/duplocale-tests (configure.ac): Test for duplocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/hard-locale-tests (configure.ac): Likewise.
* modules/locale-tests (configure.ac): Test for newlocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/localename-tests (configure.ac): Likewise.
* modules/tsearch-tests (configure.ac): Test for initstate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/unistr/u8-stpcpy (configure.ac): Test for stpcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

* m4/tcgetattr.m4: New file, extracted from m4/getpass.m4.
* m4/getpass.m4 (gl_PREREQ_GETPASS): Remove code that tests for
tcgetattr. Invoke gl_HAVE_TCGETATTR instead.
* modules/getpass (Files): Add tcgetattr.m4.
* modules/getpass-gnu (Files): Add tcgetattr.m4.
* modules/term-style-control (Files): Add tcgetattr.m4.
(configure.ac): Remove code that tests for tcgetattr. Invoke
gl_HAVE_TCGETATTR instead.

2 years agoFix warnings for functions introduced in Android API level 19.
Bruno Haible [Thu, 19 Jan 2023 20:55:25 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 19.

* m4/futimens.m4 (gl_FUNC_FUTIMENS): Test for futimens using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimens.m4 (gl_UTIMENS): Likewise.
* m4/imaxabs.m4 (gl_FUNC_IMAXABS): Test for imaxabs using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Test for imaxdiv using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

2 years agoFix warnings for functions introduced in Android API level 18.
Bruno Haible [Thu, 19 Jan 2023 20:55:23 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 18.

* m4/getdelim.m4 (gl_FUNC_GETDELIM): Test for getdelim using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/getline.m4 (gl_FUNC_GETLINE): Test for getline using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.
* m4/log2.m4 (gl_FUNC_LOG2): Test for log2 using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/log2f.m4 (gl_FUNC_LOG2F): Test for log2f using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/log2l.m4 (gl_FUNC_LOG2L): Test for log2l using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

2 years agoFix warnings for functions introduced in Android API level 16 or 17.
Bruno Haible [Thu, 19 Jan 2023 20:55:20 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 16 or 17.

* m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN): Test for posix_memalign
using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/alignalloc.m4 (gl_ALIGNALLOC): Likewise.
* m4/pagealign_alloc.m4 (gl_PREREQ_PAGEALIGN_ALLOC): Likewise.
* modules/aligned-malloc (configure.ac): Likewise.

2 years agoFix warnings for functions introduced in Android API level 16.
Bruno Haible [Thu, 19 Jan 2023 20:55:17 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 16.

* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Test for faccessat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE,
gl_CANONICALIZE_LGPL_SEPARATE): Likewise.
* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Test for tsearch using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/setenv.m4 (gl_PREREQ_SETENV): Likewise.

2 years agoFix warnings for functions introduced in Android API level 12.
Bruno Haible [Thu, 19 Jan 2023 20:55:15 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 12.

Reported by Po Lu <luangruo@yahoo.com>.

* m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Test for ftruncate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/glob.m4 (gl_PREREQ_GLOB): Test for getpwnam_r using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/nproc.m4 (gl_PREREQ_NPROC): Test for sched_getaffinity using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/pread.m4 (gl_FUNC_PREAD): Test for pread using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/pwrite.m4 (gl_FUNC_PWRITE): Test for pwrite using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/thread.m4 (gl_THREAD): Test for pthread_atfork using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Test for timegm using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Test for utimensat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimens.m4 (gl_UTIMENS): Likewise.

2 years agoFix warnings for functions introduced in Android API level 9.
Bruno Haible [Thu, 19 Jan 2023 20:55:13 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 9.

* m4/pipe2.m4 (gl_FUNC_PIPE2): Test for pipe2 using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Update comments.

2 years agoFix warnings for functions introduced in Android API level 8.
Bruno Haible [Thu, 19 Jan 2023 20:55:10 +0000 (21:55 +0100)]
Fix warnings for functions introduced in Android API level 8.

* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test for ttyname_r using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

2 years agofts: Document this module.
Bruno Haible [Thu, 19 Jan 2023 14:18:31 +0000 (15:18 +0100)]
fts: Document this module.

* doc/glibc-headers/fts.texi: Mention the 'fts' module.
* doc/glibc-functions/fts_children.texi: Likewise.
* doc/glibc-functions/fts_close.texi: Likewise.
* doc/glibc-functions/fts_open.texi: Likewise.
* doc/glibc-functions/fts_read.texi: Likewise.
* doc/glibc-functions/fts_set.texi: Likewise.

2 years agogetcwd: Speed up on Linux. Add support for Android.
Bruno Haible [Wed, 18 Jan 2023 12:16:42 +0000 (13:16 +0100)]
getcwd: Speed up on Linux. Add support for Android.

* lib/getcwd.c (__getcwd_generic): On Linux, use a specific readlink
call to speed up the operation.

2 years agoqcopy-acl: port to Fedora 9
Paul Eggert [Tue, 17 Jan 2023 23:21:26 +0000 (15:21 -0800)]
qcopy-acl: port to Fedora 9

It has libattr-2.4.41, which is too old for our code.
Problem reported by Po Lu <https://bugs.gnu.org/60843>.
* m4/xattr.m4 (gl_FUNC_XATTR): Check that we can use
ATTR_ACTION_PERMISSIONS, too.  Refactor so that there’s a single
test program that we compile and link, rather than doing the tests
in dribs and drabs.

2 years agoexecute tests: Avoid test failure with GNU make 4.4.
Bruno Haible [Tue, 17 Jan 2023 21:13:36 +0000 (22:13 +0100)]
execute tests: Avoid test failure with GNU make 4.4.

Reported by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00157.html>.

* tests/test-execute-main.c (main): Reset the SIGPIPE handler to
default on all platforms.

2 years agofflush: Tweak last commit.
Bruno Haible [Tue, 17 Jan 2023 19:17:27 +0000 (20:17 +0100)]
fflush: Tweak last commit.

* lib/stdio-impl.h (fp_): Make the last change work also with newer
Android NDKs and _FILE_OFFSET_BITS=64.

2 years agoqset-acl, acl: Improve comments.
Ondrej Valousek [Tue, 17 Jan 2023 17:31:18 +0000 (18:31 +0100)]
qset-acl, acl: Improve comments.

* lib/qset-acl.c (qset_acl): Improve comments.
* lib/set-acl.c (set_acl): Likewise.

2 years agofflush: Fix a buffer overrun on 32-bit Android.
Bruno Haible [Tue, 17 Jan 2023 18:16:29 +0000 (19:16 +0100)]
fflush: Fix a buffer overrun on 32-bit Android.

* lib/stdio-impl.h (fp_): On Android, change the type of _offset to
'long'.
* lib/fflush.c (update_fpos_cache): On Android, update a 'long', not an
'fpos_t'.

2 years agoexecute tests: Avoid test failure on Android.
Bruno Haible [Tue, 17 Jan 2023 14:15:57 +0000 (15:15 +0100)]
execute tests: Avoid test failure on Android.

* tests/test-execute-main.c (main): Reset the SIGPIPE handler to
default.

2 years agohard-locale: Port to Android ≥ 5.0.
Bruno Haible [Tue, 17 Jan 2023 13:09:41 +0000 (14:09 +0100)]
hard-locale: Port to Android ≥ 5.0.

* lib/hard-locale.c: Include <stdlib.h>.
(hard_locale): On Android, consider also MB_CUR_MAX, even if the
locale's name is "C".
* tests/test-hard-locale.c (test_one, main): Assume that on Android,
even the "C" locale is hard.

2 years agostddef tests: Fix compilation error (regression 2023-01-15).
Bruno Haible [Mon, 16 Jan 2023 16:58:30 +0000 (17:58 +0100)]
stddef tests: Fix compilation error (regression 2023-01-15).

* tests/test-stddef.c: Don't include <stdalign.h>.

2 years agoautoupdate
Karl Berry [Mon, 16 Jan 2023 16:54:54 +0000 (08:54 -0800)]
autoupdate

2 years agombrtowc, mbrtoc32 tests: Avoid test failure on Android ≥ 5.0.
Bruno Haible [Mon, 16 Jan 2023 13:34:56 +0000 (14:34 +0100)]
mbrtowc, mbrtoc32 tests: Avoid test failure on Android ≥ 5.0.

* tests/test-mbrtowc.c (main): On Android 5.0 or newer, when testing
the "C" locale, verify that the encoding is UTF-8.
* tests/test-mbrtoc32.c (main): Likewise.
* doc/posix-functions/setlocale.texi: Mention the Android problems.

2 years agombrtowc, mbrtoc32 tests: Refactor.
Bruno Haible [Mon, 16 Jan 2023 13:30:06 +0000 (14:30 +0100)]
mbrtowc, mbrtoc32 tests: Refactor.

* tests/test-mbrtowc.c (main): Straighten convoluted code.
* tests/test-mbrtoc32.c (main): Likewise.

2 years agosigpipe tests: Modernize use of 'head'.
Paul Eggert [Mon, 16 Jan 2023 12:40:48 +0000 (13:40 +0100)]
sigpipe tests: Modernize use of 'head'.

POSIX no longer requires support for ‘head -1’.

* tests/test-sigpipe.sh: Use ‘head -n1’ rather than ‘head -1’.
* tests/test-sigpipe.c (main): Likewise.
* lib/git-merge-changelog.c (main): Update comment accordingly.

2 years agoUse ‘head -n1’ rather than ‘head -1’
Paul Eggert [Mon, 16 Jan 2023 09:42:28 +0000 (01:42 -0800)]
Use ‘head -n1’ rather than ‘head -1’

POSIX no longer requires support for ‘head -1’.

2 years agosys_socket: fix typo
Paul Eggert [Sun, 15 Jan 2023 19:53:40 +0000 (11:53 -0800)]
sys_socket: fix typo

Fix typo in previous change.

2 years agoalignasof: new module
Paul Eggert [Sun, 15 Jan 2023 19:48:43 +0000 (11:48 -0800)]
alignasof: new module

This splits off support for the C23 keywords alignas and alignof,
from the now-deprecated stdalign module.  The latter now merely
provides C11 support.
* MODULES.html.sh, NEWS, doc/gnulib.texi:
* doc/posix-headers/stdalign.texi: Document the change.
* lib/stdalign.in.h: Remove most of the definitions (which are now
supplied by the alignasof module), leaving only
__alignas_is_defined and __alignof_is_defined.
* modules/alignasof, modules/alignasof-tests: New files.
* m4/stdalign.m4 (gl_ALIGNASOF): New macro, with
most of the contents of the old gl_STDALIGN_H.
Do not define __alignas_is_defined or __alignof_is_defined.
(gl_STDALIGN_H): Rely on gl_ALIGNASOF for most of the work.
* modules/alignalloc, modules/alignof, modules/argp:
* modules/crypto/md4-buffer, modules/crypto/md5-buffer:
* modules/crypto/sha1-buffer, modules/crypto/sha256-buffer:
* modules/crypto/sha512-buffer, modules/crypto/sm3-buffer:
* modules/fts, modules/rawmemchr, modules/relocatable-prog-wrapper:
* modules/stddef-tests, modules/sys_socket:
Depend on alignasof, not stdalign.
* modules/stdalign: Deprecate.  Depend on alignasof.
* modules/stdalign-tests: Move most contents to the new module
alignasof-tests, and depend on that.

2 years agofpending: Fix compilation error with NDK ≥ r14b and Android API < 23.
Bruno Haible [Sun, 15 Jan 2023 10:10:09 +0000 (11:10 +0100)]
fpending: Fix compilation error with NDK ≥ r14b and Android API < 23.

Report and patch by Po Lu <luangruo@yahoo.com>.

* lib/fpending.c (__fpending) [__ANDROID__]: Use the fp_ macro.

2 years agoalignof: port to strict C23
Paul Eggert [Sun, 15 Jan 2023 01:48:18 +0000 (17:48 -0800)]
alignof: port to strict C23

Problem reported by Khem Raj in:
https://lists.gnu.org/r/bug-gnulib/2023-01/msg00111.html
* lib/alignof.h (alignof_slot) [!__cplusplus]: Use C23-style alignof.
* modules/alignof (Depends-on): Add stdalign.

2 years agotest-framework-sh: work around AIX 7.2 diff bugs
Paul Eggert [Sun, 15 Jan 2023 00:47:41 +0000 (16:47 -0800)]
test-framework-sh: work around AIX 7.2 diff bugs

* tests/init.sh (compare_dev_null_): Run diff in the C locale.
AIX 7.2 diff messes up in UTF-8 locales; for example,
‘printf '\360\220\200\200\n' | diff - /dev/null’ incorrectly
outputs nothing and exits with status 0 when LC_ALL=en_US.UTF-8.

2 years agoerror, verror tests: Fix link error when the package uses libintl.
Bruno Haible [Sat, 14 Jan 2023 19:30:15 +0000 (20:30 +0100)]
error, verror tests: Fix link error when the package uses libintl.

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

2 years ago* m4/xattr.m4: Fix copyright date.
Paul Eggert [Sat, 14 Jan 2023 01:41:58 +0000 (17:41 -0800)]
* m4/xattr.m4: Fix copyright date.

2 years agolocalename: Fix -Wtautological-pointer-compare warning in a better way.
Bruno Haible [Fri, 13 Jan 2023 22:50:21 +0000 (23:50 +0100)]
localename: Fix -Wtautological-pointer-compare warning in a better way.

* lib/localename.c (duplocale, freelocale): Revert last patch.
(_GL_ARG_NONNULL): Define to empty.

2 years agoverify: work around xlclang 16.1 compiler bug
Paul Eggert [Fri, 13 Jan 2023 22:32:11 +0000 (14:32 -0800)]
verify: work around xlclang 16.1 compiler bug

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
* lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE):
Define to 0 if compiler advertises itself as clang before version 5.
xlclang 16.1 advertises itself as 4.0.1 and this patch works
around what appears to be a compiler bug when compiling dfa.c in
bleeding-edge grep.

2 years agoFix ChangeLog typo.
Paul Eggert [Fri, 13 Jan 2023 22:32:11 +0000 (14:32 -0800)]
Fix ChangeLog typo.

2 years agoassert-h: suppress xlclang 16.1 false alarms
Paul Eggert [Fri, 13 Jan 2023 20:13:26 +0000 (12:13 -0800)]
assert-h: suppress xlclang 16.1 false alarms

* m4/assert_h.m4 (gl_ASSERT_H): Pacify older clangs too,
with regard to single-argument static_assert.
Problem found with xlclang 16.1 on AIX 7.2.

2 years agoassert-h: fix configure comment-out
Paul Eggert [Fri, 13 Jan 2023 19:57:35 +0000 (11:57 -0800)]
assert-h: fix configure comment-out

* m4/assert_h.m4 (gl_ASSERT_H): Also break apart "#undef
static_assert" with /**/.  Problem discovered with xlclang 16.1,
though it does not directly affect xlclang 16.1.

2 years agoDon’t use alloc_size with xlclang 16.1
Paul Eggert [Fri, 13 Jan 2023 19:40:24 +0000 (11:40 -0800)]
Don’t use alloc_size with xlclang 16.1

* m4/gnulib-common.m4 (_GL_HAS_ATTRIBUTE): Require Clang 5 instead
of 3.5 for this, to pacify xlclang 16.1.0 on AIX 7.2, which
advertises itself as clang 4.1.0, and which otherwise issues
warnings like “./xalloc.h:141:3: warning: 1540-2990 The attribute
"__attribute__((alloc_size(2, 3)))" is not supported.  The
attribute is ignored.” when building bleeding-edge GNU grep.

2 years agolocalename: -Wtautological-pointer-compare
Paul Eggert [Fri, 13 Jan 2023 18:50:12 +0000 (10:50 -0800)]
localename: -Wtautological-pointer-compare

Problem found by xlclang 16.1 on AIX 7.2.
* lib/localename.c (duplocale, freelocale):
Omit unnecessary comparison of non-null args to NULL.

2 years agologin_tty tests: Be more verbose when the test fails.
Bruno Haible [Fri, 13 Jan 2023 14:15:17 +0000 (15:15 +0100)]
login_tty tests: Be more verbose when the test fails.

* tests/test-login_tty.c (main): When the test fails, write a message
into a file.

2 years agoqcopy-acl: Make last patch more robust.
Bruno Haible [Fri, 13 Jan 2023 08:37:40 +0000 (09:37 +0100)]
qcopy-acl: Make last patch more robust.

* m4/acl.m4 (gl_FUNC_ACL): Define through AC_DEFUN_ONCE.
* modules/qcopy-acl (configure.ac): Require gl_FUNC_ACL.

2 years agoqcopy-acl: Adjust link dependencies.
Bruno Haible [Fri, 13 Jan 2023 08:30:29 +0000 (09:30 +0100)]
qcopy-acl: Adjust link dependencies.

* modules/qcopy-acl (Depends-on): Add condition.
(configure.ac): Set QCOPY_ACL_LIB.
(Link): Add $(QCOPY_ACL_LIB). Remove $(LIB_ACL).
* modules/qacl (Link): Add $(LIB_ACL) and $(QCOPY_ACL_LIB).
* modules/acl (Link): Add $(LIB_ACL) and $(QCOPY_ACL_LIB).
* modules/copy-file (Link): Add $(QCOPY_ACL_LIB).
* modules/supersede (Link): Add $(QCOPY_ACL_LIB).
* modules/acl-tests (Makefile.am): Link test-copy-acl with
$(QCOPY_ACL_LIB).
* modules/copy-file-tests (Makefile.am): Link test-copy-file with
$(QCOPY_ACL_LIB).
* modules/supersede-tests (Makefile.am): Link test-supersede with
$(QCOPY_ACL_LIB).

2 years agoqcopy-acl: Avoid autoconf warning.
Bruno Haible [Fri, 13 Jan 2023 07:51:10 +0000 (08:51 +0100)]
qcopy-acl: Avoid autoconf warning.

* m4/xattr.m4 (gl_FUNC_XATTR): Provide a description in AC_DEFINE.
Also, protect against unsafe use of a configure option value.

2 years agoqcopy-acl: Optimize copying of ACLs by directly copying the attributes.
Ondrej Valousek [Wed, 4 Jan 2023 14:34:26 +0000 (15:34 +0100)]
qcopy-acl: Optimize copying of ACLs by directly copying the attributes.

* lib/qcopy-acl.c (is_attr_permissions): New functions.
(qcopy_acl): If USE_XATTR, copy the ACL related attributes directly.
* m4/xattr.m4: New file.
* modules/qcopy-acl (Files): Add it.
(configure.ac): Invoke gl_FUNC_XATTR.

2 years agoerror: Work around an Android problem.
Bruno Haible [Thu, 12 Jan 2023 15:51:15 +0000 (16:51 +0100)]
error: Work around an Android problem.

* lib/error.in.h: Renamed from lib/error.h.
(_GL_ATTRIBUTE_SPEC_PRINTF_ERROR): New macro.
(error): Consider HAVE_ERROR and REPLACE_ERROR.
(error_at_line): Consider HAVE_ERROR_AT_LINE and REPLACE_ERROR_AT_LINE.
* m4/error_h.m4: New file, partially based on m4/error.m4.
* m4/error.m4 (gl_ERROR): Remove the test for error_at_line.
* modules/error-h: New file.
* modules/error (Files): Remove lib/error.h.
(Depends-on): Add error-h. Update conditions.
(configure.ac): Require gl_ERROR_H. Update condition.
* doc/glibc-headers/error.texi: Mention the 'error-h' module.
* doc/glibc-functions/error.texi: Mention the Android problem.
* config/srclist.txt: Add comment regarding error.h.

2 years agoerror, verror tests: Add clarification.
Bruno Haible [Thu, 12 Jan 2023 15:39:21 +0000 (16:39 +0100)]
error, verror tests: Add clarification.

* tests/test-error.c (main): Clarify why we don't test error_at_line
with a NULL filename.
* tests/test-verror.c (main): Clarify why we don't test verror_at_line
with a NULL filename.

2 years agoverror: Add tests.
Bruno Haible [Thu, 12 Jan 2023 11:34:43 +0000 (12:34 +0100)]
verror: Add tests.

* tests/test-verror.sh: New file, based on tests/test-error.sh.
* tests/test-verror.c: New file, based on tests/test-error.c.
* modules/verror-tests: New file.

2 years agoerror: Add tests.
Bruno Haible [Thu, 12 Jan 2023 10:48:27 +0000 (11:48 +0100)]
error: Add tests.

* tests/test-error.sh: New file.
* tests/test-error.c: New file.
* modules/error-tests: New file.

2 years agoxstrtol-error: Improve comments.
Bruno Haible [Wed, 11 Jan 2023 22:24:42 +0000 (23:24 +0100)]
xstrtol-error: Improve comments.

* lib/xstrtol-error.h (xstrtol_fatal): Add parameter names to
declaration.

2 years agospawn-pipe tests: Fix test failure on Android.
Bruno Haible [Wed, 11 Jan 2023 20:38:40 +0000 (21:38 +0100)]
spawn-pipe tests: Fix test failure on Android.

* tests/test-spawn-pipe-child.c (main): Skip the is_open (STDERR_FILENO)
check on Android.

2 years agoperror: Fix "perror clobbers strerror's buffer" problem on Android.
Bruno Haible [Wed, 11 Jan 2023 19:39:55 +0000 (20:39 +0100)]
perror: Fix "perror clobbers strerror's buffer" problem on Android.

* m4/perror.m4 (gl_FUNC_PERROR): Set REPLACE_PERROR to 1 on Android.
* doc/posix-functions/perror.texi: Mention the Android problem.

2 years agoposix_spawn_file_actions_addfchdir tests: Fix test failure on Android.
Bruno Haible [Wed, 11 Jan 2023 18:51:43 +0000 (19:51 +0100)]
posix_spawn_file_actions_addfchdir tests: Fix test failure on Android.

* tests/test-posix_spawn-fchdir.c: Include xvasprintf.h.
(test): On Android, use "/proc" instead of "/".
(main): Determine the relative location of the 'pwd' program
accordingly.
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Add
xvasprintf.

2 years agorename, renameat, renameatu: Fix test failures on Android/Termux.
Bruno Haible [Wed, 11 Jan 2023 17:25:18 +0000 (18:25 +0100)]
rename, renameat, renameatu: Fix test failures on Android/Termux.

* tests/test-rename.h (test_rename): On Android, treat an EACCES failure
like EPERM.

2 years agolink, linkat tests: Fix test failures on Android/Termux.
Bruno Haible [Wed, 11 Jan 2023 17:15:59 +0000 (18:15 +0100)]
link, linkat tests: Fix test failures on Android/Termux.

* tests/test-link.h (test_link): On Android, treat an EACCES failure
like EPERM.
* tests/test-linkat.c (main): When test_link is marked skipped, skip the
rest of the test as well.

2 years agolink tests: Correct indentation.
Bruno Haible [Wed, 11 Jan 2023 13:54:55 +0000 (14:54 +0100)]
link tests: Correct indentation.

* tests/test-link.h (test_link): Correct indentation.

2 years agoFix link errors on Android 4.3: Limit last change to builds with GCC.
Bruno Haible [Wed, 11 Jan 2023 17:06:09 +0000 (18:06 +0100)]
Fix link errors on Android 4.3: Limit last change to builds with GCC.

2 years agoFix link errors on Android 4.3.
Bruno Haible [Wed, 11 Jan 2023 09:50:41 +0000 (10:50 +0100)]
Fix link errors on Android 4.3.

* lib/asyncsafe-spin.c: Don't use the GCC >= 4.1 builtins on Android.
* lib/pthread-spin.c: Likewise.
* lib/simple-atomic.c: Likewise.

2 years agoupdate-copyright: also work with two or more updatable lines in a file
Jim Meyering [Tue, 3 Jan 2023 06:52:08 +0000 (22:52 -0800)]
update-copyright: also work with two or more updatable lines in a file

* build-aux/update-copyright: Replace every occurrence of the copyright
line, not just the first one.
* tests/test-update-copyright.sh: Add a test case for this.

2 years agoimmutable: Fix initialization failure on Android.
Bruno Haible [Tue, 10 Jan 2023 16:44:04 +0000 (17:44 +0100)]
immutable: Fix initialization failure on Android.

* lib/immutable.c: Include "pathmax.h".
(do_init_mmap_file): Use $TMPDIR rather than /tmp, if it is safe.
* modules/immutable (Depends-on): Add pathmax.

2 years agoFix some test failures on Android ≥ 11.
Bruno Haible [Tue, 10 Jan 2023 15:23:18 +0000 (16:23 +0100)]
Fix some test failures on Android ≥ 11.

* tests/test-fclose.c (main): On Android, avoid triggering the
file-descriptor sanitizer (fdsan).
* tests/test-fdopen.c (main): Likewise.
* tests/test-fflush.c (main): Likewise.
* tests/test-fgetc.c (main): Likewise.
* tests/test-fputc.c (main): Likewise.
* tests/test-fread.c (main): Likewise.
* tests/test-fseeko4.c (main): Likewise.
* tests/test-ftello4.c (main): Likewise.
* tests/test-fwrite.c (main): Likewise.

2 years agoutimens: Fix warning on Android.
Bruno Haible [Tue, 10 Jan 2023 11:38:49 +0000 (12:38 +0100)]
utimens: Fix warning on Android.

* m4/utimens.m4 (gl_UTIMENS): Test for futimesat and futimes using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

2 years agosecure_getenv: Fix warning on Android.
Bruno Haible [Tue, 10 Jan 2023 11:52:10 +0000 (12:52 +0100)]
secure_getenv: Fix warning on Android.

* m4/secure_getenv.m4 (gl_FUNC_SECURE_GETENV): Test for issetugid using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* lib/secure_getenv.c: Fix comment regarding issetugid.

2 years agorenameat, renameatu: Fix warning on Android.
Bruno Haible [Tue, 10 Jan 2023 11:31:56 +0000 (12:31 +0100)]
renameat, renameatu: Fix warning on Android.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Test for renameat2 using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

2 years agomemset_explicit tests: Fix signature check.
Bruno Haible [Tue, 10 Jan 2023 11:19:42 +0000 (12:19 +0100)]
memset_explicit tests: Fix signature check.

* tests/test-memset_explicit.c: Fix return type in signature check.

2 years agomath: Fix compilation errors in C++ mode on Android.
Bruno Haible [Tue, 10 Jan 2023 08:58:40 +0000 (09:58 +0100)]
math: Fix compilation errors in C++ mode on Android.

* lib/math.in.h: Declare nothing if this file gets included from
/usr/include/c++/v1/math.h too early.

2 years agosys_ioctl: Fix compilation error in C++ mode on Android.
Bruno Haible [Tue, 10 Jan 2023 08:10:48 +0000 (09:10 +0100)]
sys_ioctl: Fix compilation error in C++ mode on Android.

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

2 years agothreads-h: Improve portability.
Bruno Haible [Mon, 9 Jan 2023 20:31:52 +0000 (21:31 +0100)]
threads-h: Improve portability.

* lib/threads.in.h: Use INCLUDE_NEXT_AS_FIRST_DIRECTIVE when possible.
* modules/threads-h (Makefile.am): Substitute
INCLUDE_NEXT_AS_FIRST_DIRECTIVE and NEXT_AS_FIRST_DIRECTIVE_THREADS_H.

2 years agothreads-h: Fix compilation errors in C++ mode on Android.
Bruno Haible [Mon, 9 Jan 2023 18:12:49 +0000 (19:12 +0100)]
threads-h: Fix compilation errors in C++ mode on Android.

* lib/threads.in.h (_GL_ALREADY_INCLUDING_THREADS_H): New macro.