]> Savannah Git Hosting - gnulib.git/log
gnulib.git
20 months agoAdd info about recommended warning options.
Bruno Haible [Tue, 5 Sep 2023 10:36:03 +0000 (12:36 +0200)]
Add info about recommended warning options.

* HACKING: New section "Warning Options".

20 months agostring-buffer tests: Fix a compilation error (regression from today).
Bruno Haible [Tue, 5 Sep 2023 02:01:22 +0000 (04:01 +0200)]
string-buffer tests: Fix a compilation error (regression from today).

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

20 months agounistr/u{8,16,32}-strtok tests: Fix -Wanalyzer-allocation-size warnings.
Bruno Haible [Tue, 5 Sep 2023 01:06:30 +0000 (03:06 +0200)]
unistr/u{8,16,32}-strtok tests: Fix -Wanalyzer-allocation-size warnings.

* tests/unistr/test-u-strtok.h (test_u_strtok): Correct values of
input_len and delim_len.

20 months agosigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning.
Bruno Haible [Mon, 4 Sep 2023 22:58:37 +0000 (00:58 +0200)]
sigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning.

* tests/test-sigpipe.c (handler): Invoke _exit, not exit.
* tests/test-raise.c (handler): Update comments after 2020-11-25 change.

20 months agoargp: Distinguish NULL and '\0' from 0.
Bruno Haible [Mon, 4 Sep 2023 22:44:01 +0000 (00:44 +0200)]
argp: Distinguish NULL and '\0' from 0.

* lib/argp-pin.c: Include <stddef.h>.
(program_invocation_short_name, program_invocation_name): Use NULL
instead of 0.
* lib/argp-parse.c (convert_options, __argp_parse, __argp_input):
Likewise.
* lib/argp-fmtstream.c (__argp_make_fmtstream): Likewise.
* lib/argp-help.c (make_hol, hol_entry_first_long, hol_find_entry,
hol_append, hol_entry_help, argp_doc, _help): Likewise.
(hol_usage): Use '\0' instead of 0.

20 months agoargp: Fix gcc -Wanalyzer-use-of-uninitialized-value warning.
Bruno Haible [Mon, 4 Sep 2023 22:22:30 +0000 (00:22 +0200)]
argp: Fix gcc -Wanalyzer-use-of-uninitialized-value warning.

* lib/argp-help.c (hol_find_entry): Access hol->entries only after
having verified that hol->num_entries > 0.

20 months agounictype/category-byname tests: Fix gcc -Wunused-value warning.
Bruno Haible [Mon, 4 Sep 2023 22:04:29 +0000 (00:04 +0200)]
unictype/category-byname tests: Fix gcc -Wunused-value warning.

* tests/unictype/test-categ_byname.c (main): Add some tests for category
Nl.

20 months agounigbrk/uc-grapheme-breaks tests: Fix gcc -Wunused-function warning.
Bruno Haible [Mon, 4 Sep 2023 21:38:34 +0000 (23:38 +0200)]
unigbrk/uc-grapheme-breaks tests: Fix gcc -Wunused-function warning.

* tests/unigbrk/test-uc-grapheme-breaks.c
(graphemebreakproperty_to_string): Mark as possibly unused.

20 months agobitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings.
Bruno Haible [Mon, 4 Sep 2023 21:32:22 +0000 (23:32 +0200)]
bitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings.

* tests/test-bitset.c (check_zero): Mark 'i' as possibly unused.
* tests/test-nonblocking-reader.h (full_read): Mark 'spent_time' as
possibly unused.

20 months agoUse statement-expressions without warnings, even in strict ISO C mode.
Bruno Haible [Mon, 4 Sep 2023 19:54:09 +0000 (21:54 +0200)]
Use statement-expressions without warnings, even in strict ISO C mode.

Suggested by Eric Blake <eblake@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-09/msg00025.html>.

* lib/error.in.h (__gl_error_call): Use the variant with obvious control
flow also with clang. Use '__extension__' to avoid -Wpedantic warnings.
* lib/math.in.h (gl_signbitf, gl_signbitd, gl_signbitl): Define as
macros even when __STRICT_ANSI__ is defined. But use '__extension__' to
avoid -Wpedantic warnings.
* lib/setenv.c (KNOWN_VALUE): Use '__extension__' to avoid -Wpedantic
warnings.
* lib/xalloc-oversized.h (xalloc_oversized): Use optimized variant even
when __STRICT_ANSI__ is defined. But use '__extension__' to avoid
-Wpedantic warnings.

20 months agoFix some g++ warnings "has a different exception specifier".
Bruno Haible [Mon, 4 Sep 2023 17:22:21 +0000 (19:22 +0200)]
Fix some g++ warnings "has a different exception specifier".

* m4/gnulib-common.m4 (gl_COMMON_BODY): Make _GL_ATTRIBUTE_NOTHROW
effective in C++ mode.
* lib/attribute.h (ATTRIBUTE_NOTHROW): Add a comment.
* lib/malloc.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback definition.
(memalign): Invoke _GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.
* lib/stdio.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback definition.
(fdopen): Invoke _GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback definition.
(aligned_alloc, calloc, canonicalize_file_name, malloc, realloc): Invoke
_GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.
* lib/string.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback definition.
(strdup, strndup): Invoke _GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.
* lib/sys_stat.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback
definition.
(getumask): Invoke _GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.
* lib/wchar.in.h (_GL_ATTRIBUTE_NOTHROW): Provide fallback definition.
(wcsdup): Invoke _GL_FUNCDECL_SYS with _GL_ATTRIBUTE_NOTHROW.

20 months agounistr/u{8,16,32}-strchr tests: Fix some gcc -Wshadow warnings.
Bruno Haible [Mon, 4 Sep 2023 15:43:50 +0000 (17:43 +0200)]
unistr/u{8,16,32}-strchr tests: Fix some gcc -Wshadow warnings.

* tests/unistr/test-strchr.h (test_strchr): Reduce of scope of local
variable 'i'.

20 months agounistr/u{8,16,32}-chr tests: Fix some gcc -Wshadow warnings.
Bruno Haible [Mon, 4 Sep 2023 15:35:29 +0000 (17:35 +0200)]
unistr/u{8,16,32}-chr tests: Fix some gcc -Wshadow warnings.

* tests/unistr/test-chr.h (main): Reduce of scope of local variables
'i' and 'page_boundary'.

20 months agopipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings.
Bruno Haible [Mon, 4 Sep 2023 15:24:35 +0000 (17:24 +0200)]
pipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings.

* tests/test-pipe-filter-gi1.c (main): Rename local variable 'argv' to
'tr_argv'.
* tests/test-pipe-filter-ii1.c (main): Likewise.

20 months agoargv-iter tests: Avoid gcc -Wanalyzer-out-of-bounds warning.
Bruno Haible [Mon, 4 Sep 2023 15:07:33 +0000 (17:07 +0200)]
argv-iter tests: Avoid gcc -Wanalyzer-out-of-bounds warning.

* tests/test-argv-iter.c (main): Simplify logic.

20 months agocrypto/{gc-rijndael,rijndael} tests: Fix some gcc -Wshadow warnings.
Bruno Haible [Mon, 4 Sep 2023 14:48:41 +0000 (16:48 +0200)]
crypto/{gc-rijndael,rijndael} tests: Fix some gcc -Wshadow warnings.

* tests/test-gc-rijndael.c (main): Rename local variable 'i' to 'round'.
* tests/test-rijndael.c (main): Likewise.

20 months agothreads-h tests: Fix gcc -Wold-style-declaration warning.
Bruno Haible [Mon, 4 Sep 2023 14:39:07 +0000 (16:39 +0200)]
threads-h tests: Fix gcc -Wold-style-declaration warning.

* tests/test-thread_local.c (value0, value1, value2, value3): Put the
'thread_local' storage class specifier before the type.

20 months agoieee754-h tests: Fix some gcc -Wmissing-field-initializers warnings.
Bruno Haible [Mon, 4 Sep 2023 14:23:39 +0000 (16:23 +0200)]
ieee754-h tests: Fix some gcc -Wmissing-field-initializers warnings.

* tests/test-ieee754-h.c (float_tests): Use float literals.
(double_tests): Use double literals. Initialize frac_lo.

20 months agostring-buffer tests: Fix a gcc -Wformat warning.
Bruno Haible [Mon, 4 Sep 2023 14:02:36 +0000 (16:02 +0200)]
string-buffer tests: Fix a gcc -Wformat warning.

* tests/test-string-buffer.c: Don't assume that wint_t has the same size
as 'int'.

20 months agocrypto/* tests: Fix some gcc -Wdiscarded-qualifiers warnings.
Bruno Haible [Mon, 4 Sep 2023 13:46:39 +0000 (15:46 +0200)]
crypto/* tests: Fix some gcc -Wdiscarded-qualifiers warnings.

* tests/test-gc-hmac-md5.c (main): Change type of variables with a
string literal initializer to 'const char *'.
* tests/test-gc-hmac-sha1.c (main): Likewise.
* tests/test-gc-hmac-sha256.c (main): Likewise.
* tests/test-gc-hmac-sha512.c (main): Likewise.
* tests/test-gc-md2.c (main): Likewise.
* tests/test-gc-md5.c (main): Likewise.
* tests/test-gc-sha1.c (main): Likewise.
* tests/test-gc-sha256.c (main): Likewise.
* tests/test-gc-sha512.c (main): Likewise.
* tests/test-hmac-md5.c (main): Likewise.
* tests/test-hmac-sha1.c (main): Likewise.
* tests/test-hmac-sha256.c (main): Likewise.
* tests/test-hmac-sha512.c (main): Likewise.

20 months agofile-has-acl: Avoid gcc warning.
Bruno Haible [Mon, 4 Sep 2023 13:20:59 +0000 (15:20 +0200)]
file-has-acl: Avoid gcc warning.

* lib/acl-internal.h (MIN): Remove definition.

20 months agosame-inode, stat-size: support pointers too
Paul Eggert [Mon, 4 Sep 2023 01:14:53 +0000 (18:14 -0700)]
same-inode, stat-size: support pointers too

Add functions and macros so that we can test pointers to struct
stat as well as plain struct stat.  This lets coreutils deal with
structs that are only partly initialized, without relying on
undefined behavior.
* NEWS: Mention this.
* doc/posix-headers/sys_stat.texi, doc/stat-size.texi:
Mention this and modernize.
* lib/at-func2.c (at_func2):
* lib/fts.c (same_fd):
* lib/rename.c (rpl_rename) [RENAME_HARD_LINK_BUG]:
* lib/same-inode.c: New file.
* lib/same.c (same_nameat):
* lib/term-style-control.c (activate_term_style_controller):
Prefer psame_inode (a, b) to SAME_INODE (*a, *b).
* lib/hash-triple-simple.c (triple_compare_ino_str):
* lib/hash-triple.c (triple_compare):
Prefer PSAME_INODE (a, b) to SAME_INODE (*a, *b).
psame_inode is not suitable since the args are not struct stat *.
* lib/same-inode.h: Check that config.h is included first.
(SAME_INODE_INLINE, PSAME_INODE): New macros.
(SAME_INODE): Reimplement in terms of PSAME_INODE.
(psame_inode): New function.
* lib/stat-size.h (STP_BLKSIZE, STP_NBLOCKS): New macros.
(ST_BLKSIZE, ST_NBLOCKS): Use them.
* lib/term-style-control.c (log_signal_handler_called):
Always define as a function, to pacify -Wunused*.
* modules/canonicalize-lgpl-tests (Files): Add m4/musl.m4.
(Depends-on): Call gl_MUSL_LIBC.
* modules/same-inode (Files): Add same-inode.c.
(Depends-on): Add extern-inline, stdbool.
(lib_SOURCES): New macro.
* tests/test-binary-io.c, tests/test-canonicalize-lgpl.c:
* tests/test-canonicalize.c, tests/test-cloexec.c:
* tests/test-dup-safer.c, tests/test-dup2.c, tests/test-error.c:
* tests/test-fcntl.c, tests/test-fdopendir.c, tests/test-fgetc.c:
* tests/test-fputc.c, tests/test-fread.c, tests/test-fstat.c:
* tests/test-fstatat.c, tests/test-ftruncate.c:
* tests/test-fwrite.c, tests/test-getcwd.c:
* tests/test-getdtablesize.c, tests/test-isblank.c:
* tests/test-linkat.c, tests/test-lock.c, tests/test-lstat.h:
* tests/test-malloc-gnu.c, tests/test-openat.c:
* tests/test-pthread-thread.c, tests/test-pthread_sigmask1.c:
* tests/test-pthread_sigmask2.c, tests/test-ptsname.c:
* tests/test-ptsname_r.c, tests/test-raise.c:
* tests/test-realloc-gnu.c, tests/test-rwlock1.c:
* tests/test-sigprocmask.c, tests/test-snprintf.c:
* tests/test-stat.h, tests/test-term-style-control-hello.c:
* tests/test-term-style-control-yes.c, tests/test-thread_create.c:
* tests/test-unlinkat.c, tests/test-vasnprintf.c:
* tests/test-xalloc-die.c:
Adjust to these changes, and fix some warnings elicited by
-Wall -Wextra that I ran into while testing.
* top/maint.mk (sc_prohibit_stat_st_blocks): Mention STP_NBLOCKS.

20 months agoWarn about Bug#65599 with CIFS chmod/chown
Paul Eggert [Sat, 2 Sep 2023 20:43:34 +0000 (13:43 -0700)]
Warn about Bug#65599 with CIFS chmod/chown

20 months agoalignalloc: Fix license header.
Bruno Haible [Sat, 2 Sep 2023 12:56:31 +0000 (14:56 +0200)]
alignalloc: Fix license header.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00170.html>.

* lib/alignalloc.h: Make license header consistent with module
description.
* lib/alignalloc.c: Likewise.

20 months agocrypto/{sha*,md5}-buffer: Add comment.
Bruno Haible [Fri, 1 Sep 2023 13:04:38 +0000 (15:04 +0200)]
crypto/{sha*,md5}-buffer: Add comment.

* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Add comment regarding license.

20 months agocrypto/{sha*,md5,sm3}-buffer: Fix --with-openssl (regr. 2023-08-26).
Bruno Haible [Fri, 1 Sep 2023 10:55:30 +0000 (12:55 +0200)]
crypto/{sha*,md5,sm3}-buffer: Fix --with-openssl (regr. 2023-08-26).

Reported by Agostino Sarubbo via Sam James <sam@gentoo.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-09/msg00000.html>.

* lib/sha1.h: Test the OpenSSL major version before attempting to
include <openssl/configuration.h>.
* lib/sha256.h: Likewise.
* lib/sha512.h: Likewise.
* lib/md5.h: Likewise.
* lib/sm3.h: Likewise.

20 months agoreadutmp: Fix memory leak introduced by last commit.
Bruno Haible [Thu, 31 Aug 2023 09:31:11 +0000 (11:31 +0200)]
readutmp: Fix memory leak introduced by last commit.

* lib/readutmp.c (read_utmp_from_systemd): If num_sessions == 0 and
sessions != NULL, do call free (sessions).

20 months agoreadutmp: fix core dump if --enable-systemd
Paul Eggert [Thu, 31 Aug 2023 01:26:52 +0000 (18:26 -0700)]
readutmp: fix core dump if --enable-systemd

Problem reported by Thorsten Kukuk <https://bugs.gnu.org/65617>.
* lib/readutmp.c (read_utmp_from_systemd):
Don’t assume session_ptr != NULL if num_sessions == 0.
In practice it can be null, and the man page OKs this behavior.

20 months agodoc: Mention the module 'wchar-single'.
Bruno Haible [Wed, 30 Aug 2023 19:10:20 +0000 (21:10 +0200)]
doc: Mention the module 'wchar-single'.

* doc/multithread.texi: Mention the module 'wchar-single'.

20 months agowchar-single: fix module broken since 2021
Paul Eggert [Wed, 30 Aug 2023 17:15:09 +0000 (10:15 -0700)]
wchar-single: fix module broken since 2021

Adjust to 2021-03-07 change “Rename GNULIB_WCHAR_SINGLE to
GNULIB_WCHAR_SINGLE_LOCALE”.  Apparently nobody noticed that
the module was broken.  Perhaps we should obsolete the module?
* modules/wchar-single (GNULIB_WCHAR_SINGLE_LOCALE): Define.

20 months agowctype: Rely on module iswpunct.
Bruno Haible [Wed, 30 Aug 2023 00:19:01 +0000 (02:19 +0200)]
wctype: Rely on module iswpunct.

* m4/wctype.m4 (gl_FUNC_WCTYPE): Also test whether the "punct" class
works.
* modules/wctype (Depends-on): Add iswpunct.
* tests/test-iswctype.c (main): Add more tests of the "punct" class.
* doc/posix-functions/wctype.texi: Mention the Android problem.

20 months agoc32ispunct: Rely on module iswpunct.
Bruno Haible [Wed, 30 Aug 2023 00:18:40 +0000 (02:18 +0200)]
c32ispunct: Rely on module iswpunct.

* modules/c32ispunct (Depends-on): Add iswpunct.
* tests/test-c32ispunct.c (main): Add a few more tests in the "C"
locale.

20 months agoiswpunct: Add tests.
Bruno Haible [Wed, 30 Aug 2023 00:18:26 +0000 (02:18 +0200)]
iswpunct: Add tests.

* tests/test-iswpunct.c: New file, based on tests/test-iswdigit.c and
tests/test-c32ispunct.c.
* tests/test-iswpunct.sh: New file, based on tests/test-iswdigit.sh.
* modules/iswpunct-tests: New file.

20 months agoiswpunct: New module.
Bruno Haible [Wed, 30 Aug 2023 00:18:06 +0000 (02:18 +0200)]
iswpunct: New module.

* lib/wctype.in.h (iswpunct): New declaration.
* lib/iswpunct.c: New file.
* m4/iswpunct.m4: New file.
* m4/wctype_h.m4 (gl_WCTYPE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ISWPUNCT.
(gl_WCTYPE_H_DEFAULTS): Initialize REPLACE_ISWPUNCT.
* modules/wctype-h (Makefile.am): Substitute GNULIB_ISWPUNCT,
REPLACE_ISWPUNCT.
* modules/iswpunct: New file.
* doc/posix-functions/iswpunct.texi: Mention the new module.

20 months agowctype-h tests: Add more tests.
Bruno Haible [Wed, 30 Aug 2023 00:18:00 +0000 (02:18 +0200)]
wctype-h tests: Add more tests.

* tests/test-wctype-h.c (main): Add a sanity check of iswpunct.

20 months agoiswdigit, iswxdigit: Fix documentation.
Bruno Haible [Tue, 29 Aug 2023 23:38:59 +0000 (01:38 +0200)]
iswdigit, iswxdigit: Fix documentation.

* doc/posix-functions/iswdigit.texi: Mention the module 'iswdigit'.
* doc/posix-functions/iswxdigit.texi: Mention the module 'iswxdigit'.

20 months agobootstrap: Try to prevent the user from setting GNULIB_URL to a wrong value.
Bruno Haible [Tue, 29 Aug 2023 21:34:34 +0000 (23:34 +0200)]
bootstrap: Try to prevent the user from setting GNULIB_URL to a wrong value.

* top/bootstrap-funclib.sh: Explain GNULIB_URL better.
* top/bootstrap: Likewise.
* build-aux/bootstrap: Likewise.

20 months agomaint: don’t say “clonable” either
Paul Eggert [Tue, 29 Aug 2023 20:06:41 +0000 (13:06 -0700)]
maint: don’t say “clonable” either

The spelling is controversial, and the word adds little of use here.

20 months agowctype: Fix documentation (mistake 2023-07-26).
Bruno Haible [Tue, 29 Aug 2023 17:49:15 +0000 (19:49 +0200)]
wctype: Fix documentation (mistake 2023-07-26).

* doc/posix-functions/wctype.texi: The "blank" argument problem on mingw
is now worked around by Gnulib.

20 months agorename: fix m4 comment
Paul Eggert [Tue, 29 Aug 2023 14:59:57 +0000 (07:59 -0700)]
rename: fix m4 comment

* m4/rename.m4: Fix comment to match code.

20 months agospelling fix: cloneable -> clonable
Paul Eggert [Mon, 28 Aug 2023 19:21:23 +0000 (12:21 -0700)]
spelling fix: cloneable -> clonable

* build-aux/bootstrap, top/bootstrap, top/bootstrap-funclib.sh:
Spell it “clonable”, the more common English way, instead of
“cloneable”, the Java way.  Found while doing spelling check
of Coreutils.

20 months agotrim: do not over-allocate result
Paul Eggert [Sun, 27 Aug 2023 06:19:12 +0000 (23:19 -0700)]
trim: do not over-allocate result

* lib/trim.c: Include mbuiterf.h, not mbiterf.h, since we no
longer compute strlen at first.
(trim2): Do not over-allocate result and then trim the parts we
don’t want.  Instead, skip unwanted input before allocating,
so that the result is just the right size.  Use mempcpy
instead of memmove.  Simplify.
* modules/trim (Depends-on): Remove mbiterf, memmove, strdup, xalloc.
Add mbuiterf, mempcpy, xalloc-die.

20 months agopropername: tune single-byte code
Paul Eggert [Sun, 27 Aug 2023 06:19:11 +0000 (23:19 -0700)]
propername: tune single-byte code

* lib/propername.c (mbsstr_trimmed_wordbounded): Cache MB_CUR_MAX.
Simplify word boundary detection in single-byte code.

20 months agoTune single-byte code involving tolower
Paul Eggert [Sun, 27 Aug 2023 06:19:10 +0000 (23:19 -0700)]
Tune single-byte code involving tolower

* lib/mbmemcasecmp.c (mbmemcasecmp):
* lib/mbscasecmp.c (mbscasecmp):
* lib/mbscasestr.c (mbscasestr):
* lib/mbsncasecmp.c (mbsncasecmp):
* lib/mbspcasecmp.c (mbspcasecmp):
Avoid some unnecessary calls to tolower.  For example, if the two
single-byte characters are equal before downcasing there is no
need to call tolower on either character.

20 months agoc32width tests: Avoid failure on FreeBSD 12.
Bruno Haible [Sat, 26 Aug 2023 23:53:57 +0000 (01:53 +0200)]
c32width tests: Avoid failure on FreeBSD 12.

* tests/test-c32width.c (main): Skip two tests on FreeBSD < 13.

20 months agocrypto/{sha*,md5,sm3}-buffer: Ignore too old OpenSSL versions.
Bruno Haible [Sat, 26 Aug 2023 20:45:17 +0000 (22:45 +0200)]
crypto/{sha*,md5,sm3}-buffer: Ignore too old OpenSSL versions.

* lib/sha1.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA1.
* lib/sha256.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA256.
* lib/sha512.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA512.
* lib/md5.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_MD5.
* lib/sm3.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SM3.

20 months agoselinux-h: Add a comment.
Bruno Haible [Sat, 26 Aug 2023 18:41:31 +0000 (20:41 +0200)]
selinux-h: Add a comment.

* lib/se-selinux.in.h: Clarify which #endif belongs to the
double-inclusion guard.

20 months agosys_utsname: Make double-inclusion guard more robust.
Bruno Haible [Sat, 26 Aug 2023 18:39:04 +0000 (20:39 +0200)]
sys_utsname: Make double-inclusion guard more robust.

* lib/sys_utsname.in.h: Test the guard symbol a second time.

20 months agosys_times: Make double-inclusion guard more robust.
Bruno Haible [Sat, 26 Aug 2023 18:38:51 +0000 (20:38 +0200)]
sys_times: Make double-inclusion guard more robust.

* lib/sys_times.in.h: Test the guard symbol a second time.

20 months agouchar: Make #include_next work right.
Bruno Haible [Sat, 26 Aug 2023 18:33:39 +0000 (20:33 +0200)]
uchar: Make #include_next work right.

* lib/uchar.in.h: Use a split double-inclusion guard.

20 months agoutimens: update FIXME date
Paul Eggert [Sat, 26 Aug 2023 16:10:25 +0000 (09:10 -0700)]
utimens: update FIXME date

* lib/utimens.c (fdutimens): Change FIXME date to agree with
similar FIXME in utimensat.c.

20 months agoexclude: refactor for more-modern style
Paul Eggert [Thu, 24 Aug 2023 15:50:00 +0000 (09:50 -0600)]
exclude: refactor for more-modern style

* lib/exclude.c: Sort include directives.
(fnmatch_pattern_has_wildcards, file_name_matches):
Prefer ‘true’ to ‘1’.
(string_hasher, string_compare, string_compare_ci):
Avoid unnecessary locals.
(string_free): Remove.  All callers changed to just use ‘free’.
(new_exclude_segment): Prefer xmalloc to xzalloc when it’s
clearer to initialize ourselves.
(new_exclude_segment, exclude_patopts, add_exclude_fp):
Prefer nullptr to NULL.
(free_exclude_segment, file_pattern_matches):
Avoid unnecessary nesting.
(free_exclude, fnmatch_no_wildcards, exclude_fnmatch)
(excluded_file_name, add_exclude, add_exclude_fp):
Assume C99 decl syntax.
(fnmatch_no_wildcards): Prefer idx_t to size_t.
(exclude_fnmatch, add_exclude_fp): Prefer ‘f (x)’ to ‘(*f) (x)’.
(add_exclude): Help compiler by refactoring search for
trailing slashes.  Avoid unnecessary cast to char *.
* modules/exclude (Depends-on): Add nullptr.

20 months agounlocked-io: fix getc_unlocked typo
Paul Eggert [Tue, 22 Aug 2023 05:08:46 +0000 (22:08 -0700)]
unlocked-io: fix getc_unlocked typo

* lib/unlocked-io.h (getc): Fix misspelling of ‘getc_unlocked’.

20 months agoalignasof, stdalign: Fix a compilation error in C++ mode on FreeBSD 12.
Bruno Haible [Mon, 21 Aug 2023 15:23:41 +0000 (17:23 +0200)]
alignasof, stdalign: Fix a compilation error in C++ mode on FreeBSD 12.

* m4/stdalign.m4 (gl_ALIGNASOF): In C++ mode, prefer __builtin_offsetof
over offsetof when possible, since __builtin_offsetof works also when
<stddef.h> has not been fully included yet.

20 months agowcsstr: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:59:34 +0000 (15:59 +0200)]
wcsstr: Relicense under LGPLv2+.

* modules/wcsstr (License): Change to LGPLv2+.

20 months agowcsstr-simple: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:58:16 +0000 (15:58 +0200)]
wcsstr-simple: Relicense under LGPLv2+.

* modules/wcsstr-simple (License): Change to LGPLv2+.
* lib/wcsstr.c: Update license notice.
* lib/wcsstr-impl.h: Update license notice. The code added here on
2023-03-27 was under LGPLv2+.

20 months agowmemcmp: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:50:35 +0000 (15:50 +0200)]
wmemcmp: Relicense under LGPLv2+.

* modules/wmemcmp (License): Change to LGPLv2+.
* lib/wmemcmp.c: Update license notice.
* lib/wmemcmp-impl.h: Likewise.

20 months agowcschr: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:46:02 +0000 (15:46 +0200)]
wcschr: Relicense under LGPLv2+.

* modules/wcschr (License): Change to LGPLv2+.
* lib/wcschr.c: Update license notice.
* lib/wcschr-impl.h: Likewise.

20 months agounistr/u32-strlen: Complete license change from 2023-07-23.
Bruno Haible [Mon, 21 Aug 2023 13:30:22 +0000 (15:30 +0200)]
unistr/u32-strlen: Complete license change from 2023-07-23.

* lib/unistr/u-strlen.h: Update license notice.

20 months agoisnanl: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:08:54 +0000 (15:08 +0200)]
isnanl: Relicense under LGPLv2+.

* modules/isnanl (License): Change to LGPLv2+.

20 months agoldexp: port to non-two’s complement
Paul Eggert [Mon, 21 Aug 2023 00:55:03 +0000 (17:55 -0700)]
ldexp: port to non-two’s complement

* lib/ldexp.c (FUNC): Don’t assume two’s-complement.

20 months agoreadutmp, boot-time: Fix the result on runit and s6 init systems.
Bruno Haible [Sun, 20 Aug 2023 20:34:39 +0000 (22:34 +0200)]
readutmp, boot-time: Fix the result on runit and s6 init systems.

* lib/boot-time-aux.h (get_linux_boot_time_fallback): Try also
/var/lib/urandom/random-seed. Try /var/run/utmp last.

20 months agoldexp: fix INT_MIN infloop
Paul Eggert [Sun, 20 Aug 2023 20:23:11 +0000 (13:23 -0700)]
ldexp: fix INT_MIN infloop

* lib/ldexp.c (FUNC): Instead of converting EXP to unsigned,
work on it directly.  This simplifies the code and avoids
an infinite loop when EXP == INT_MIN.
* modules/ldexp, modules/ldexpl: Depend on stdbool.
* tests/test-ldexp.h: Include <limits.h> for INT_MIN.
(test_function): Test for infloop.

20 months agomake -C doc INSTALL INSTALL.ISO INSTALL.UTF-8
Paul Eggert [Sun, 20 Aug 2023 19:41:58 +0000 (12:41 -0700)]
make -C doc INSTALL INSTALL.ISO INSTALL.UTF-8

20 months agoldexp: Fix compilation error in C++ mode.
Bruno Haible [Sun, 20 Aug 2023 13:01:25 +0000 (15:01 +0200)]
ldexp: Fix compilation error in C++ mode.

* lib/math.in.h (ldexp): Use _GL_CXXALIASWARN1, not _GL_CXXALIASWARN.

20 months agoldexp: Work around OpenBSD/mips64 bug.
Bruno Haible [Sun, 20 Aug 2023 00:43:01 +0000 (02:43 +0200)]
ldexp: Work around OpenBSD/mips64 bug.

* lib/math.in.h (ldexp): New declaration.
* lib/ldexp.c: New file, based on lib/ldexpl.c.
* lib/ldexpl.c: Moved the implementation to lib/ldexp.c. Just include
it.
* m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LDEXP.
(gl_MATH_H_DEFAULTS): Initialize REPLACE_LDEXP.
* m4/ldexp.m4 (gl_FUNC_LDEXP): Require gl_MATH_H_DEFAULTS and
gl_FUNC_ISNAND. Invoke gl_FUNC_LDEXP_WORKS. Set REPLACE_LDEXP. Consider
it when setting LDEXP_LIBM.
(gl_FUNC_LDEXP_WORKS): New macro.
* modules/math (Makefile.am): Substitute GNULIB_LDEXP, REPLACE_LDEXP.
* modules/ldexp (Files): Add lib/ldexp.c.
(Depends-on): Add math, isnand.
(configure.ac): Set GL_COND_OBJ_LDEXP. Invoke gl_MATH_MODULE_INDICATOR.
(Makefile.am): Conditionally compile ldexp.c.
* modules/ldexpl (Files): Add lib/ldexp.c.
* doc/posix-functions/ldexp.texi: Mention the OpenBSD bug.

20 months agoldexpl: Relicense under LGPLv2+.
Bruno Haible [Sun, 20 Aug 2023 01:10:00 +0000 (03:10 +0200)]
ldexpl: Relicense under LGPLv2+.

* modules/ldexpl (License): Change to LGPLv2+.
* lib/ldexpl.c: Update license notice.

20 months agoisnand: Relicense under LGPLv2+.
Bruno Haible [Sun, 20 Aug 2023 00:19:04 +0000 (02:19 +0200)]
isnand: Relicense under LGPLv2+.

* modules/isnand (License): Change to LGPLv2+.

20 months agoldexpl: Avoid possible -Wshadow warning.
Bruno Haible [Sat, 19 Aug 2023 23:44:26 +0000 (01:44 +0200)]
ldexpl: Avoid possible -Wshadow warning.

* lib/ldexpl.c (exp): Locally rename to 'exponent'.

20 months agoldexpl: Fix signed integer overflow.
Bruno Haible [Sat, 19 Aug 2023 23:41:56 +0000 (01:41 +0200)]
ldexpl: Fix signed integer overflow.

* lib/ldexpl.c (ldexpl): Use an 'unsigned int' variable to represent the
absolute value of exp without overflow.

20 months agologbl: Work around endless loop on OpenBSD 7.3/mips64.
Bruno Haible [Sat, 19 Aug 2023 22:45:05 +0000 (00:45 +0200)]
logbl: Work around endless loop on OpenBSD 7.3/mips64.

* m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Terminate the test program if it
takes longer than 5 seconds.
* doc/posix-functions/logbl.texi: Mention the OpenBSD bug.

20 months agoautoupdate
Karl Berry [Sat, 19 Aug 2023 15:24:52 +0000 (08:24 -0700)]
autoupdate

20 months agothrd: Work around thrd_join bug on AIX 7.3.1.
Bruno Haible [Fri, 18 Aug 2023 20:38:04 +0000 (22:38 +0200)]
thrd: Work around thrd_join bug on AIX 7.3.1.

* m4/threads_h.m4 (gl_THREADS_H): Test against AIX 7 thrd_join bug. Set
BROKEN_THRD_JOIN.
(gl_THREADS_H_DEFAULTS): Initialize BROKEN_THRD_JOIN.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Set REPLACE_THRD_* to 1 also if
BROKEN_THRD_JOIN is 1. Define BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* modules/threads-h (Makefile.am): Substitute BROKEN_THRD_JOIN.
* lib/threads.in.h (rpl_thrd_t, thrd_t): Define also if BROKEN_THRD_JOIN
is 1.
* lib/thrd.c: Test BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* doc/posix-functions/thrd_join.texi: Update.
* doc/posix-functions/thrd_exit.texi: Likewise.

20 months agothrd: Refactor.
Bruno Haible [Fri, 18 Aug 2023 19:14:40 +0000 (21:14 +0200)]
thrd: Refactor.

* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_JOIN_NULL, not
BROKEN_THRD_JOIN. Rename gl_cv_func_thrd_join_works to
gl_cv_func_thrd_join_null_works.
* lib/thrd.c: Test BROKEN_THRD_JOIN_NULL instead of BROKEN_THRD_JOIN.

20 months agothrd tests: Add unit test for thrd_exit.
Bruno Haible [Fri, 18 Aug 2023 17:39:03 +0000 (19:39 +0200)]
thrd tests: Add unit test for thrd_exit.

* tests/test-thrd_exit.c: New file, based on tests/test-thrd_create.c.
* modules/thrd-tests (Files): Add it.
(Makefile.am): Compile and run it.

20 months agothrd: On AIX 7.1 and 7.2, override also thrd_exit.
Bruno Haible [Fri, 18 Aug 2023 18:52:08 +0000 (20:52 +0200)]
thrd: On AIX 7.1 and 7.2, override also thrd_exit.

* lib/threads.in.h (thrd_exit): Consider REPLACE_THRD_EXIT.
* lib/thrd.c (rpl_thrd_exit): New function.
* m4/threads_h.m4 (gl_THREADS_H_DEFAULTS): Initialize REPLACE_THRD_EXIT.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Set also REPLACE_THRD_EXIT and adjust
LIBSTDTHREAD.
* modules/threads-h (Makefile.am): Substitute REPLACE_THRD_EXIT.
* doc/posix-functions/thrd_exit.texi: Mention the AIX thrd_join problem
also here.

20 months agoaligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.
Bruno Haible [Fri, 18 Aug 2023 16:54:28 +0000 (18:54 +0200)]
aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.

* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use 'volatile', to
disable optimization of ibm-clang -O2.
* doc/posix-functions/aligned_alloc.texi: Update version info.

20 months agosys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc.
Bruno Haible [Fri, 18 Aug 2023 15:25:26 +0000 (17:25 +0200)]
sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc.

* lib/sys_socket.in.h (accept, getpeername, getsockname, recvfrom):
Disable _GL_CXXALIASWARN invocation on non-glibc systems.

20 months agostddef: Don't unnecessarily override max_align_t on AIX 7.3 with gcc.
Bruno Haible [Fri, 18 Aug 2023 11:46:15 +0000 (13:46 +0200)]
stddef: Don't unnecessarily override max_align_t on AIX 7.3 with gcc.

* lib/stddef.in.h (max_align_t, GNULIB_defined_max_align_t): Don't
define or override if HAVE_MAX_ALIGN_T is 1.

20 months agouptime: Deprecate.
Bruno Haible [Fri, 18 Aug 2023 11:18:04 +0000 (13:18 +0200)]
uptime: Deprecate.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-coreutils/2023-08/msg00070.html>.

* modules/uptime (Status, Notice): New sections.

20 months agoRecognize the *-*-windows* config triplets introduced on 2023-06-26.
Bruno Haible [Thu, 17 Aug 2023 13:04:43 +0000 (15:04 +0200)]
Recognize the *-*-windows* config triplets introduced on 2023-06-26.

* m4/*.m4: Treat windows* as equivalent to mingw*.
* modules/*: Likewise.

20 months agomake -C doc INSTALL INSTALL.ISO INSTALL.UTF-8
Paul Eggert [Wed, 16 Aug 2023 22:33:27 +0000 (15:33 -0700)]
make -C doc INSTALL INSTALL.ISO INSTALL.UTF-8

20 months agombrtoc32-regular: Make it work as expected on glibc 2.12.
Bruno Haible [Wed, 16 Aug 2023 21:44:57 +0000 (23:44 +0200)]
mbrtoc32-regular: Make it work as expected on glibc 2.12.

* lib/mbrtoc32.c (mbrtoc32): If necessary, clear the mbstate_t after
mbrtowc() returned.

20 months agofnmatch: Override fnmatch from glibc versions < 2.22.
Bruno Haible [Wed, 16 Aug 2023 19:47:26 +0000 (21:47 +0200)]
fnmatch: Override fnmatch from glibc versions < 2.22.

* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Force REPLACE_FNMATCH=1 in
glibc versions < 2.22.

20 months agotests: Avoid some test failures on Slackware 13.37.
Bruno Haible [Wed, 16 Aug 2023 19:42:46 +0000 (21:42 +0200)]
tests: Avoid some test failures on Slackware 13.37.

Make last commit actually work.

20 months agotests: Avoid some test failures on Slackware 13.37.
Bruno Haible [Wed, 16 Aug 2023 15:45:26 +0000 (17:45 +0200)]
tests: Avoid some test failures on Slackware 13.37.

* tests/test-c32isalnum.c (main): Disable GB18030 tests on
glibc 2.13..2.15.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isblank.c (main): Likewise.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isdigit.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32isspace.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32isxdigit.c (main): Likewise.
* tests/test-c32rtomb.c (main): Likewise.
* tests/test-c32snrtombs.c (main): Likewise.
* tests/test-c32srtombs.c (main): Likewise.
* tests/test-c32stombs.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.
* tests/test-fnmatch.c (main): Likewise.
* tests/test-mbrtoc16.c (main): Likewise.
* tests/test-mbrtoc32.c (main): Likewise.
* tests/test-mbsnrtoc32s.c (main): Likewise.
* tests/test-mbsrtoc32s.c (main): Likewise.
* tests/test-mbstoc32s.c (main): Likewise.

20 months agoautoupdate
Karl Berry [Wed, 16 Aug 2023 14:14:19 +0000 (07:14 -0700)]
autoupdate

20 months agoreadutmp tests: Add test against today's bug.
Bruno Haible [Tue, 15 Aug 2023 21:32:27 +0000 (23:32 +0200)]
readutmp tests: Add test against today's bug.

* tests/test-readutmp.c (main): Verify that there is exactly one
BOOT_TIME entry.

20 months agoreadutmp: Fix for platforms without ut_type (regression 2023-08-08).
Bruno Haible [Tue, 15 Aug 2023 10:58:14 +0000 (12:58 +0200)]
readutmp: Fix for platforms without ut_type (regression 2023-08-08).

* lib/readutmp.h (UT_TYPE_BOOT_TIME, UT_TYPE_USER_PROCESS): Don't use
UT_TYPE_EQ macro.
(IS_USER_PROCESS): Don't use UT_USER, UT_TYPE_NOT_DEFINED macros.
* lib/readutmp.c (IS_USER_PROCESS): Don't override.

20 months agoreadutmp, boot-time: Don't use __UT_* symbols (regression 2023-08-11).
Bruno Haible [Mon, 14 Aug 2023 13:47:41 +0000 (15:47 +0200)]
readutmp, boot-time: Don't use __UT_* symbols (regression 2023-08-11).

* lib/readutmp.h (_GL_UT_USER_SIZE, _GL_UT_ID_SIZE, _GL_UT_LINE_SIZE,
_GL_UT_HOST_SIZE): New macros.
(struct utmpx32): Use them.

20 months agoreadutmp, boot-time: Fix build on 32-bit glibc (regression 2023-08-11).
Bruno Haible [Mon, 14 Aug 2023 10:14:38 +0000 (12:14 +0200)]
readutmp, boot-time: Fix build on 32-bit glibc (regression 2023-08-11).

Reported by Andreas Schwab <schwab@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00125.html>.

* lib/readutmp.h (struct utmpx32): Reference __UT_NAMESIZE, not
__UT_USERSIZE.

20 months agostdint: Fix configure test result with gcc 4.7 or 4.8.
Bruno Haible [Mon, 14 Aug 2023 00:51:01 +0000 (02:51 +0200)]
stdint: Fix configure test result with gcc 4.7 or 4.8.

* m4/stdint.m4 (gl_STDINT_H): Don't assume that _Generic works with
GCC versions < 4.9 with -std=gnu11.

20 months agoFix some test module descriptions.
Bruno Haible [Mon, 14 Aug 2023 00:02:31 +0000 (02:02 +0200)]
Fix some test module descriptions.

* modules/boot-time-tests (Files): Add tests/macros.h.
* modules/dprintf-gnu-tests (Files): Likewise.
* modules/fclose-tests (Files): Likewise.
* modules/getcwd-tests (Files): Likewise.
* modules/lock-tests (Files): Likewise.
* modules/nullptr-c++-tests (Files): Likewise.
* modules/posix_spawn-tests (Files): Likewise.
* modules/posix_spawnp-tests (Files): Likewise.
* modules/readutmp-tests (Files): Likewise.
* modules/sh-quote-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/uc-grapheme-breaks-tests (Files): Likewise.

20 months agonproc, physmem: Use sysctl() as a fallback on GNU/kFreeBSD.
Bruno Haible [Sun, 13 Aug 2023 23:04:36 +0000 (01:04 +0200)]
nproc, physmem: Use sysctl() as a fallback on GNU/kFreeBSD.

* lib/nproc.c: Do include <sys/sysctl.h> on GNU/kFreeBSD.
(num_processors_ignoring_omp): Call sysctl on GNU/kFreeBSD.
* lib/physmem.c: Do include <sys/sysctl.h> on GNU/kFreeBSD.
(physmem_total, physmem_available): Call sysctl on GNU/kFreeBSD.

20 months agophysmem: Add tests.
Bruno Haible [Sun, 13 Aug 2023 22:49:25 +0000 (00:49 +0200)]
physmem: Add tests.

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

20 months agoreadutmp, boot-time: Fix warning on glibc 2.30..2.31 on Linux.
Bruno Haible [Sun, 13 Aug 2023 22:13:13 +0000 (00:13 +0200)]
readutmp, boot-time: Fix warning on glibc 2.30..2.31 on Linux.

Reported by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00110.html>.

* lib/readutmp.c: Don't include <sys/sysctl.h> on glibc/Linux.
* lib/boot-time.c: Likewise.

20 months agofts: improve memory-allocation errno handling
Paul Eggert [Sun, 13 Aug 2023 16:46:47 +0000 (09:46 -0700)]
fts: improve memory-allocation errno handling

* lib/fts.c (fts_read, fts_build): When enter_dir or setup_dir
fails, report its errno value back to the user.
(internal_function): Preserve errno.
* modules/fts (Depends-on): Add calloc-posix, free-posix,
malloc-posix, and realloc-posix, for better errno handling
on allocation failures.

20 months agohash: set errno on failure
Paul Eggert [Sun, 13 Aug 2023 15:34:44 +0000 (08:34 -0700)]
hash: set errno on failure

* lib/hash.c: Include errno.h.
(compute_bucket_size, hash_initialize, hash_rehash)
(hash_insert_if_absent): Set errno reliably on failure.
(hash_free): Preserve errno, like plain 'free'.
* modules/hash (Depends-on): Depend on calloc-posix,
free-posix, malloc-posix, so that errno is set reliably.

20 months agoreadutmp, boot-time: Fix compilation error on old Android.
Bruno Haible [Sun, 13 Aug 2023 14:33:28 +0000 (16:33 +0200)]
readutmp, boot-time: Fix compilation error on old Android.

Reported by Po Lu in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00108.html>.

* lib/readutmp.h (BOOT_TIME): Add fallback.

20 months agoreadutmp, boot-time: Fix compilation error on Android API 8.
Bruno Haible [Sun, 13 Aug 2023 14:08:33 +0000 (16:08 +0200)]
readutmp, boot-time: Fix compilation error on Android API 8.

Reported by Po Lu in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00108.html>.

* m4/readutmp.m4 (gl_PREREQ_READUTMP_H): Test whether sysinfo is
declared.
* lib/boot-time-aux.h (get_linux_uptime): Invoke sysinfo only if it is
declared.
* doc/glibc-functions/sysinfo.texi: Mention the Android problem.