]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 days agodoc: Clarify age of <sys/types.h>.
G. Branden Robinson [Thu, 1 May 2025 23:06:18 +0000 (01:06 +0200)]
doc: Clarify age of <sys/types.h>.

* doc/gnulib-readme.texi (C language versions): Mention when
<sys/types.h> first appeared.

Copyright-paperwork-exempt: Yes

3 days agovc-mtime: Add API for more efficient use of git.
Bruno Haible [Thu, 1 May 2025 15:26:27 +0000 (17:26 +0200)]
vc-mtime: Add API for more efficient use of git.

Reported by Serhii Tereshchenko, Arthur, Adam YS, Foucauld Degeorges
at <https://savannah.gnu.org/bugs/?66865>.

* lib/vc-mtime.h (max_vc_mtime): New declaration.
* lib/vc-mtime.c: Include <errno.h>, <stdio.h>, <string.h>, filename.h,
xalloc.h, xgetcwd.h, xvasprintf.h, gl_map.h, gl_xmap.h, gl_hash_map.h,
hashkey-string.h, unlocked-io.h.
(is_git_present): New function, extracted from vc_mtime.
(vc_mtime): Invoke it.
(MAX_COMMAND_LENGTH, MAX_CMD_LEN): New macros.
(abs_git_checkout): New function, based on execute_and_read_line in
lib/javacomp.c.
(ancestor_level, relativize): New functions.
(struct accumulator): New type.
(accumulate): New function.
(max_vc_mtime): New function.
(test_ancestor_level, test_relativize, main) [TEST]: New functions.
* modules/vc-mtime (Depends-on): Add filename, xalloc, xgetcwd,
canonicalize-lgpl, xvasprintf, str_startswith, map, xmap, hash-map,
hashkey-string, getdelim.

3 days agojavacomp: Fix resource leak.
Bruno Haible [Thu, 1 May 2025 15:28:06 +0000 (17:28 +0200)]
javacomp: Fix resource leak.

* lib/javacomp.c (execute_and_read_line): Upon failure, close the stream
and wait for the child process to terminate.

4 days agoNew module hashcode-string1.
Bruno Haible [Wed, 30 Apr 2025 10:47:37 +0000 (12:47 +0200)]
New module hashcode-string1.

* lib/hashcode-string1.h: New file.
* lib/hashcode-string1.c: New file, based on lib/hash.c.
* modules/hashcode-string1: New file.
* lib/hash.h: Include hashcode-string1.h.
(hash_string): Remove declaration.
* lib/hash.c (hash_string): Remove function.
* modules/hash (Depends-on): Add hashcode-string1.
* lib/exclude.c: Include hashcode-string1.h.
* modules/exclude (Depends-on): Add hashcode-string1.

4 days agoRename module hashcode-string to hashcode-string2.
Bruno Haible [Wed, 30 Apr 2025 10:28:42 +0000 (12:28 +0200)]
Rename module hashcode-string to hashcode-string2.

* lib/hashcode-string2.h: Renamed from lib/hashcode-string.h.
* lib/hashcode-string2.c: Renamed from lib/hashcode-string.c.
* modules/hashcode-string2: Renamed from modules/hashcode-string.
* MODULES.html.sh: Update.
* top/maint.mk: Update.
* lib/hash-pjw.h: Update.
* modules/hash-pjw: Update.
* lib/hashcode-named-file.c: Update.
* modules/hashcode-named-file (Depends-on): Update.
* tests/test-hash.c: Update.
* modules/hash-tests (Depends-on): Update.

4 days agoclean-temp: Fix link error (regression yesterday).
Bruno Haible [Wed, 30 Apr 2025 11:11:01 +0000 (13:11 +0200)]
clean-temp: Fix link error (regression yesterday).

* lib/clean-temp.c: Include hashkey-string.h.
(create_temp_dir): Use hashkey_string_* functions instead of
clean_temp_string_*.
* lib/clean-temp-private.h (clean_temp_string_equals,
clean_temp_string_hash): Remove declarations.
* modules/clean-temp (Depends-on): Add hashkey-string.

4 days agohashcode-named-file: Fix mistake (regression yesterday).
Bruno Haible [Wed, 30 Apr 2025 10:24:49 +0000 (12:24 +0200)]
hashcode-named-file: Fix mistake (regression yesterday).

* lib/hash-triple.h: Include the correct header.

4 days agoobstack: Make it easier to sync back with glibc.
Bruno Haible [Wed, 30 Apr 2025 09:57:34 +0000 (11:57 +0200)]
obstack: Make it easier to sync back with glibc.

* lib/obstack.in.h: Use __GL_GNULIB_HEADER to delimit sections that are
for Gnulib usage.
Test __GL_SMALL_PTRDIFF_T__ instead of @SMALL_PTRDIFF_T@.
Test __GL_REPLACE_OBSTACK__ instead of @REPLACE_OBSTACK@.
* modules/obstack (Makefile.am): Substitute __GL_GNULIB_HEADER.
Substitute __GL_SMALL_PTRDIFF_T__ instead of @SMALL_PTRDIFF_T@.
Substitute __GL_REPLACE_OBSTACK__ instead of @REPLACE_OBSTACK@.

4 days agohash: Rename an internal function.
Bruno Haible [Wed, 30 Apr 2025 01:31:00 +0000 (03:31 +0200)]
hash: Rename an internal function.

* lib/hash.c (find_entry): Rename from hash_find_entry.

4 days agoNew module mem-hash-map.
Bruno Haible [Wed, 30 Apr 2025 01:19:10 +0000 (03:19 +0200)]
New module mem-hash-map.

* lib/mem-hash-map.h: New file, from GNU gettext.
* lib/mem-hash-map.c: New file, from GNU gettext.
* modules/mem-hash-map: New file, from GNU gettext.

4 days agonext-prime: Add tests.
Bruno Haible [Wed, 30 Apr 2025 00:50:58 +0000 (02:50 +0200)]
next-prime: Add tests.

* tests/test-next-prime.c: New file.
* modules/next-prime-tests: New file.

4 days agoNew module next-prime.
Bruno Haible [Tue, 29 Apr 2025 23:52:17 +0000 (01:52 +0200)]
New module next-prime.

* lib/next-prime.h: New file, based on lib/hash.c.
* lib/next-prime.c: New file, based on lib/hash.c.
* modules/next-prime: New file.
* lib/hash.c: Include next-prime.h.
(is_prime, next_prime): Remove functions.
* modules/hash (Depends-on): Add next-prime.

5 days agoNew module hashkey-string.
Bruno Haible [Tue, 29 Apr 2025 23:20:17 +0000 (01:20 +0200)]
New module hashkey-string.

* lib/hashkey-string.h: New file.
* lib/hashkey-string.c: New file, based on lib/clean-temp-simple.c.
* modules/hashkey-string: New file.
* lib/clean-temp-simple.c: Include hashkey-string.h. Don't include
<limits.h>.
(clean_temp_string_equals, clean_temp_string_hash): Remove functions.
(SIZE_BITS): Remove macro.
(register_temporary_file): Use hashkey_string_equals and
hashkey_string_hash.
* modules/clean-temp-simple (Depends-on): Add hashkey-string.

5 days agoRename include file hash-triple.h to hashcode-file.h.
Bruno Haible [Tue, 29 Apr 2025 22:46:21 +0000 (00:46 +0200)]
Rename include file hash-triple.h to hashcode-file.h.

* lib/hashcode-file.h: Renamed from lib/hash-triple.h.
* lib/hash-triple.h: New file.
* lib/hashcode-named-file.c: Update.
* lib/hashcode-file-inode.c: Update.
* lib/canonicalize.c: Update.
* lib/file-set.c: Update.
* modules/hashcode-named-file (Files, Include): Update.
* modules/hashcode-file-inode (Include): Update.
* modules/hash-triple (Include): Update.

5 days agoRename module hash-triple to hashcode-file-inode.
Bruno Haible [Tue, 29 Apr 2025 22:37:08 +0000 (00:37 +0200)]
Rename module hash-triple to hashcode-file-inode.

* lib/hashcode-file-inode.c: Renamed from lib/hash-triple.c.
* modules/hashcode-file-inode: Renamed from modules/hash-triple.
* modules/hash-triple: New file.
* lib/hash-triple.h: Update.
* MODULES.html.sh: Update.

5 days agoRename module hash-triple-simple to hashcode-named-file.
Bruno Haible [Tue, 29 Apr 2025 22:24:55 +0000 (00:24 +0200)]
Rename module hash-triple-simple to hashcode-named-file.

* lib/hashcode-named-file.c: Renamed from lib/hash-triple-simple.c.
* modules/hashcode-named-file: Renamed from modules/hash-triple-simple.
* lib/hash-triple.h: Update.
* modules/canonicalize (Depends-on): Update.
* modules/file-set (Depends-on): Update.
* modules/hash-triple (Depends-on): Update.
* NEWS: Mention the change.

5 days agoRename module hash-pjw to hashcode-string.
Bruno Haible [Tue, 29 Apr 2025 22:15:40 +0000 (00:15 +0200)]
Rename module hash-pjw to hashcode-string.

* lib/hashcode-string.h: Renamed from lib/hash-pjw.h.
* lib/hashcode-string.c: Renamed from lib/hash-pjw.c.
* lib/hash-pjw.h: New file.
* modules/hashcode-string: Renamed from modules/hash-pjw.
* modules/hash-pjw: New file.
* MODULES.html.sh: Update.
* top/maint.mk: Update.
* lib/hash-triple-simple.c: Update.
* modules/hash-triple-simple (Depends-on): Update.
* tests/test-hash.c: Update.
* modules/hash-tests (Depends-on): Update.

5 days agoRename module hash-pjw-bare to hashcode-mem.
Bruno Haible [Tue, 29 Apr 2025 22:03:14 +0000 (00:03 +0200)]
Rename module hash-pjw-bare to hashcode-mem.

* lib/hashcode-mem.h: Renamed from lib/hash-pjw-bare.h.
* lib/hashcode-mem.c: Renamed from lib/hash-pjw-bare.c.
* lib/hash-pjw-bare.h: New file.
* modules/hashcode-mem: Renamed from modules/hash-pjw-bare.
* modules/hash-pjw-bare: New file.
* MODULES.html.sh: Update.

5 days agohash: Remove deprecated function 'hash_delete'.
Bruno Haible [Tue, 29 Apr 2025 20:31:48 +0000 (22:31 +0200)]
hash: Remove deprecated function 'hash_delete'.

* lib/hash.h (hash_delete): Remove declaration.
* lib/hash.c (hash_delete): Remove function.

5 days agohash: Add more comments.
Bruno Haible [Tue, 29 Apr 2025 20:29:20 +0000 (22:29 +0200)]
hash: Add more comments.

* lib/hash.h (Hash_hasher, Hash_comparator, Hash_data_freer): Add
comments.

6 days agosigsegv: Fix compilation error on Mac OS X 10.4/powerpc.
Bruno Haible [Mon, 28 Apr 2025 15:47:37 +0000 (17:47 +0200)]
sigsegv: Fix compilation error on Mac OS X 10.4/powerpc.

Patch by Evan Miller <emmiller@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-08/msg00153.html>.

* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER) [macOS/powerpc: On Mac OS X
<= 10.4, assume struct field names without underscores.

6 days agothreadlib: Avoid multi-dimensional pattern matching.
Bruno Haible [Mon, 28 Apr 2025 10:55:11 +0000 (12:55 +0200)]
threadlib: Avoid multi-dimensional pattern matching.

* m4/threadlib.m4: Change multi-dimensional AS_CASE back to several
one-dimensional tests.

6 days agothreadlib: Correct indentation.
Bruno Haible [Mon, 28 Apr 2025 10:41:27 +0000 (12:41 +0200)]
threadlib: Correct indentation.

* m4/threadlib.m4: Put cases on a fresh line. Correct indentation.

6 days agothreadlib: follow Autoconf AC_REQUIRE rules better
Paul Eggert [Mon, 28 Apr 2025 06:49:13 +0000 (23:49 -0700)]
threadlib: follow Autoconf AC_REQUIRE rules better

* m4/threadlib.m4: When conditionally invoking a macro that uses
or might use AC_REQUIRE, put it inside AS_CASE or AS_IF instead
of using shell constructs directly.

6 days agothreadlib: make m4 work better with Emacs
Paul Eggert [Mon, 28 Apr 2025 06:49:12 +0000 (23:49 -0700)]
threadlib: make m4 work better with Emacs

* m4/threadlib.m4: Refactor by prefering AS_CASE to case, " to ',
$(...) to `, [[...]] to changequote, and #-to-newline to #-with-].
That way, Emacs commands recognize the sexps here.
Omit some unnecessary quotes.

6 days agomanywarnings: omit -Wdisabled-optimization
Paul Eggert [Mon, 28 Apr 2025 06:49:12 +0000 (23:49 -0700)]
manywarnings: omit -Wdisabled-optimization

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Remove -Wdisabled-optimization, as this is a warning about the
compiler not the program.  I discovered the need for this when
compiling bleeding-edge Emacs with gcc-15 (Ubuntu
15-20250404-0ubuntu1) 15.0.1 20250404 (experimental) [master
r15-9193-g08e803aa9be] on x86-64.  Also, omit a
no-longer-necessary LC_ALL=C in a comment.

6 days agogendocs: do not depend on awk
Paul Eggert [Mon, 28 Apr 2025 06:49:11 +0000 (23:49 -0700)]
gendocs: do not depend on awk

* build-aux/gendocs.sh (calcsize): Use shell directly, rather than
depending on awk.  Allow spaces in outdir.  Simplify.

7 days agoMake use of gcc's __nonnull_if_nonzero__ attribute.
Bruno Haible [Sun, 27 Apr 2025 21:36:52 +0000 (23:36 +0200)]
Make use of gcc's __nonnull_if_nonzero__ attribute.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_ATTR_nonnull_if_nonzero and _GL_ATTRIBUTE_NONNULL_IF_NONZERO.
* lib/attribute.h (ATTRIBUTE_NONNULL_IF_NONZERO): new macro.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(bsearch, qsort, qsort_r): Use it.
* lib/string.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(memcpy, memccpy, memmove, strncpy, strndup, strncat, memcmp, strncmp,
memchr, memrchr, memset, memset_explicit): Use it.
* lib/wchar.in.h (_GL_ATTRIBUTE_NONNULL_IF_NONZERO): New macro.
(wmemcpy, wmemmove, wcsncpy, wcsncat, wmemcmp, wcsncmp, wmemchr,
wmemset): Use it.
* lib/string-desc.h (sd_new_addr): Use it.

8 days agocrc: Fix -Wmissing-variable-declarations warning.
Bruno Haible [Sat, 26 Apr 2025 15:33:06 +0000 (17:33 +0200)]
crc: Fix -Wmissing-variable-declarations warning.

* lib/crc-generate-table.c (crc_table): Make static.

8 days agostdopen: Silence -Wanalyzer-fd-leak warnings.
Bruno Haible [Sat, 26 Apr 2025 12:12:47 +0000 (14:12 +0200)]
stdopen: Silence -Wanalyzer-fd-leak warnings.

* lib/stdopen.c: Add a '#pragma GCC diagnostic ignored'.

8 days agossfmalloc: Fix -Wmissing-variable-declarations warnings.
Bruno Haible [Sat, 26 Apr 2025 09:34:22 +0000 (11:34 +0200)]
ssfmalloc: Fix -Wmissing-variable-declarations warnings.

* lib/ssfmalloc.h (small_block_pages, medium_block_pages): Make static.

8 days agobitset: Fix -Wmissing-variable-declarations warnings.
Bruno Haible [Sat, 26 Apr 2025 09:34:01 +0000 (11:34 +0200)]
bitset: Fix -Wmissing-variable-declarations warnings.

* lib/bitset/table.c (tbitset_vtable): Make static.
* lib/bitset/array.c (abitset_small_vtable, abitset_vtable): Likewise.
* lib/bitset/vector.c (vbitset_vtable): Likewise.
* lib/bitset/list.c (lbitset_vtable): Likewise.
* lib/bitset/stats.c (bitset_stats_info_data, bitset_stats_info,
bitset_stats_vtable): Likewise.

8 days agoargp: Fix -Wmissing-variable-declarations warnings.
Bruno Haible [Sat, 26 Apr 2025 09:33:23 +0000 (11:33 +0200)]
argp: Fix -Wmissing-variable-declarations warnings.

* lib/argp-ba.c: Include <config.h> and argp.h.
* lib/argp-pv.c: Likewise.

8 days agovasnprintf: Fix -Wshadow=local warnings.
Bruno Haible [Sat, 26 Apr 2025 08:49:38 +0000 (10:49 +0200)]
vasnprintf: Fix -Wshadow=local warnings.

* lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'.

8 days agoSilence gcc 15 -Wunterminated-string-initialization warnings.
Bruno Haible [Sat, 26 Apr 2025 08:41:43 +0000 (10:41 +0200)]
Silence gcc 15 -Wunterminated-string-initialization warnings.

* tests/test-gc-arctwo.c (main): Mark arrays as _GL_ATTRIBUTE_NONSTRING.
* tests/test-sf-istream.c (test_open_stream): Likewise.
* tests/test-sfl-istream.c (test_open_stream): Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (test_function): Likewise.
* tests/unilbrk/test-u8-width-linebreaks.c (test_function): Likewise.
* tests/unilbrk/test-ulc-possible-linebreaks.c (test_function):
Likewise.
* tests/unilbrk/test-ulc-width-linebreaks.c (test_function): Likewise.
* tests/uniwbrk/test-u8-wordbreaks.c (main): Likewise.
* tests/uniwbrk/test-ulc-wordbreaks.c (main): Likewise.

8 days agopselect: Disable signature check on AIX.
Collin Funk [Sat, 26 Apr 2025 01:02:51 +0000 (18:02 -0700)]
pselect: Disable signature check on AIX.

* tests/test-pselect.c [_AIX]: Skip pselect signature check.

8 days agodoc: update some GCC version comments
Paul Eggert [Sat, 26 Apr 2025 00:03:48 +0000 (17:03 -0700)]
doc: update some GCC version comments

GCC 15.1 is released, and we can update some commentary now.

8 days agostddef-h: port better to future GCC 13.4, 14.3
Paul Eggert [Fri, 25 Apr 2025 23:57:48 +0000 (16:57 -0700)]
stddef-h: port better to future GCC 13.4, 14.3

* m4/stddef_h.m4 (gl_STDDEF_H): The idempotency bug should
be fixed in GCC 13.4 and 14.3, if and when they’re published.

9 days agounistdio/u*-vasnprintf: Fix handling of grouping rule.
Bruno Haible [Fri, 25 Apr 2025 21:26:25 +0000 (23:26 +0200)]
unistdio/u*-vasnprintf: Fix handling of grouping rule.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00180.html>.

* lib/unistdio/u8-vasnprintf.c (DCHAR_STRLEN): New macro.
* lib/unistdio/u8-u8-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/unistdio/u16-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/unistdio/u16-u16-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/unistdio/u32-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/unistdio/u32-u32-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/unistdio/ulc-vasnprintf.c (DCHAR_STRLEN): Likewise.
* lib/vasnprintf.c (DCHAR_STRLEN): Define fallback.
(thousands_separator_DCHAR): New function.
(VASNPRINTF): Use it when DCHAR_T is uintN_t. Use DCHAR_CPY instead of
memcpy.

10 days agomodula2comp-script: New module.
Bruno Haible [Thu, 24 Apr 2025 22:56:09 +0000 (00:56 +0200)]
modula2comp-script: New module.

* m4/modula2comp.m4: New file.
* modules/modula2comp-script: New file.

10 days agofbufmode: Don't require peeking into the FILE structure on recent Haiku.
Bruno Haible [Thu, 24 Apr 2025 18:18:59 +0000 (20:18 +0200)]
fbufmode: Don't require peeking into the FILE structure on recent Haiku.

Suggested by Augustin Cavalier <waddlesplash@gmail.com>
in <https://dev.haiku-os.org/ticket/19479#comment:15>.

* lib/fbufmode.c (fbufmode): On Haiku >= hrev58760, use the same
implementation as on musl libc.

10 days agogetlocalename_l-unsafe: Disable unwanted compiler optimization.
Bruno Haible [Thu, 24 Apr 2025 18:02:12 +0000 (20:02 +0200)]
getlocalename_l-unsafe: Disable unwanted compiler optimization.

* lib/getlocalename_l-unsafe.c (_GL_ARG_NONNULL): Define to empty.

10 days agotsearch tests: Disable tfind signature check on Cygwin.
Collin Funk [Thu, 24 Apr 2025 03:29:25 +0000 (20:29 -0700)]
tsearch tests: Disable tfind signature check on Cygwin.

* tests/test-tsearch.c [__CYGWIN__]: Skip the tfind signature check.
* doc/posix-functions/tfind.texi: Mention the Cygwin signature.

11 days agorandom_r tests: Disable signature check on Haiku.
Collin Funk [Wed, 23 Apr 2025 01:46:08 +0000 (18:46 -0700)]
random_r tests: Disable signature check on Haiku.

* tests/test-random_r.c [__HAIKU__]: Skip initstate_r and setstate_r
signature check.
* doc/glibc-functions/initstate_r.texi: Remove year.
* doc/glibc-functions/setstate_r.texi: Likewise.

12 days agostrsignal tests: Disable signature check on Haiku.
Collin Funk [Tue, 22 Apr 2025 03:35:08 +0000 (20:35 -0700)]
strsignal tests: Disable signature check on Haiku.

* tests/test-strsignal.c [__HAIKU__]: Skip signature check.
* doc/posix-functions/strsignal.texi: Document that strsignal returns
'const char *' instead of 'char *' on Haiku.

12 days agogetloadavg: Fix typo in previous commit.
Collin Funk [Tue, 22 Apr 2025 03:08:30 +0000 (20:08 -0700)]
getloadavg: Fix typo in previous commit.

* lib/getloadavg.c (getloadavg): Remove '__' prefix from 'defined'.

13 days agogetloadavg: port to Android 3.1-
Paul Eggert [Mon, 21 Apr 2025 17:58:58 +0000 (10:58 -0700)]
getloadavg: port to Android 3.1-

Problem reported by Po Lu in:
https://lists.gnu.org/r/bug-gnulib/2025-04/msg00172.html
* lib/getloadavg.c (getloadavg): Do not try to use sysinfo on
Android 3.1 Honeycomb (API 12, 2011) and earlier.

2 weeks agoUpdate users.txt.
Bruno Haible [Sun, 20 Apr 2025 00:45:04 +0000 (02:45 +0200)]
Update users.txt.

* users.txt: Add gperf.

2 weeks agoautoupdate
Karl Berry [Sat, 19 Apr 2025 14:49:06 +0000 (07:49 -0700)]
autoupdate

2 weeks agoPacify gcc -Wtrailing-whitespace warnings across all of config.h.
Bruno Haible [Fri, 18 Apr 2025 17:47:03 +0000 (19:47 +0200)]
Pacify gcc -Wtrailing-whitespace warnings across all of config.h.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Use AH_TOP and AH_BOTTOM to
disable -Wtrailing-whitespace warnings across all of config.h.
* m4/iconv.m4: Revert last change.

2 weeks agoautoupdate
Karl Berry [Fri, 18 Apr 2025 15:19:27 +0000 (08:19 -0700)]
autoupdate

2 weeks agounitypes-h: Avoid risky coding pattern.
Bruno Haible [Fri, 18 Apr 2025 13:41:59 +0000 (15:41 +0200)]
unitypes-h: Avoid risky coding pattern.

* m4/unitypes_h.m4: New file, based on modules/unitypes-h.
* modules/unitypes-h (Files): Add it.
(configure.ac): Invoke gl_UNITYPES_H. Remove AH_VERBATIM invocation.

2 weeks agogetlogin_r tests: Remove xalloc dependency.
Bruno Haible [Fri, 18 Apr 2025 13:05:10 +0000 (15:05 +0200)]
getlogin_r tests: Remove xalloc dependency.

* tests/test-getlogin.c (main): Don't assume the putenv argument is
unmodified.
* tests/test-getlogin_r.c: Do not include xalloc.h.
(main): Use a static rather than heap storage.
* modules/getlogin_r-tests (Depends-on): Remove xalloc.
(test_getlogin_LDADD): Remove @LIBINTL@.

2 weeks agoUpdate some POSIX.1-2004 citations
Paul Eggert [Fri, 18 Apr 2025 03:26:23 +0000 (20:26 -0700)]
Update some POSIX.1-2004 citations

2 weeks agomemset_explicit-tests: pacify -Wuse-after-free
Paul Eggert [Thu, 17 Apr 2025 07:28:34 +0000 (00:28 -0700)]
memset_explicit-tests: pacify -Wuse-after-free

* tests/test-memset_explicit.c: Ignore -Wuse-after-free,
since the test deliberately uses after free.

2 weeks agoPacify -Wunterminated-string-initialization
Paul Eggert [Thu, 17 Apr 2025 07:27:30 +0000 (00:27 -0700)]
Pacify -Wunterminated-string-initialization

* tests/test-fwrite.c (main): Mark nonstrings with
_GL_ATTRIBUTE_NONSTRING.
* tests/test-mbsinit.c (main): "\303" → {'\303'} in initializer.

2 weeks agogetlogin-tests: remove xalloc dependency
Paul Eggert [Thu, 17 Apr 2025 07:24:27 +0000 (00:24 -0700)]
getlogin-tests: remove xalloc dependency

* modules/getlogin-tests (Depends-on): Remove xalloc.
(test_getlogin_LDADD): Remove @LIBINTL@.
* tests/test-getlogin.c: Do not include xalloc.h.
(main): Use a static rather than heap storage.

2 weeks agoPacify GCC 15’s new -Wtrailing-whitespace option
Paul Eggert [Thu, 17 Apr 2025 07:22:43 +0000 (00:22 -0700)]
Pacify GCC 15’s new -Wtrailing-whitespace option

* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
* m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV):
Avoid whitespace at line end in C code.
* modules/unitypes-h (unitypes_restrict):
Likewise, bearing in mind that configure.ac lines will be indented
so such lines containing only '])' should be avoided when they
generate C code.

2 weeks agomanywarnings: update C warnings for GCC 15
Paul Eggert [Thu, 17 Apr 2025 07:13:49 +0000 (00:13 -0700)]
manywarnings: update C warnings for GCC 15

Adjust for C programs compiled by GCC 15.
This is merely changes to commentary; no changes to
the flags passed to GCC.
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 15.
Sort for LC_ALL=C, so that the update procedure is reproducible.
* m4/manywarnings.m4: Specify LC_ALL=C in comment.

2 weeks agogetopt-posix: Avoid trouble due to 'struct rpl_option'.
Bruno Haible [Wed, 16 Apr 2025 22:09:05 +0000 (00:09 +0200)]
getopt-posix: Avoid trouble due to 'struct rpl_option'.

* lib/getopt.in.h: Arrange for the system's <getopt.h> to define
'struct sys_option' instead of 'struct option'.
* lib/getopt-pfx-ext.h (option): Don't rename to rpl_option.

2 weeks agoEnsure that the configuration cleans up conftest.dSYM directories.
Grisha Levit [Wed, 16 Apr 2025 03:34:11 +0000 (23:34 -0400)]
Ensure that the configuration cleans up conftest.dSYM directories.

* m4/gnulib-common.m4 (gl_CC_ALLOW_WARNINGS, gl_CXX_ALLOW_WARNINGS):
Remove conftest* files and directories recursively.
* m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX, gl_C_ASM): Likewise.
* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Likewise.
* m4/warnings.m4 (gl_CC_INHIBIT_WARNINGS, gl_CXX_INHIBIT_WARNINGS):
Likewise.

Copyright-paperwork-exempt: Yes

2 weeks agodfa: pacify gcc -Wstringop-overflow
Paul Eggert [Tue, 15 Apr 2025 20:50:32 +0000 (13:50 -0700)]
dfa: pacify gcc -Wstringop-overflow

Problem reported by Christian Hesse in:
https://bugs.gnu.org/77828
* lib/dfa.c (dfaanalyze): Pacify gcc -flto -Wstringop-overflow.

2 weeks agognulib-tool.py: Fix exception during --update with changed macro-prefix.
Bruno Haible [Tue, 15 Apr 2025 20:21:04 +0000 (22:21 +0200)]
gnulib-tool.py: Fix exception during --update with changed macro-prefix.

* pygnulib/GLImport.py (GLImport.__init__): Support the case that the
expected ${macro_prefix}_FILE_LIST definition was not found.

2 weeks agotrim tests: Avoid test failures on macOS 15.4.
Bruno Haible [Tue, 15 Apr 2025 15:12:15 +0000 (17:12 +0200)]
trim tests: Avoid test failures on macOS 15.4.

* tests/test-trim.c (main): On macOS, disable test cases that fail on
macOS 15.4.

2 weeks agotrim tests: Avoid test failures on macOS 15.4.
Bruno Haible [Tue, 15 Apr 2025 14:14:07 +0000 (16:14 +0200)]
trim tests: Avoid test failures on macOS 15.4.

* tests/test-trim.c (main): On macOS, disable test cases that randomly
succeed or fail on macOS 15.4.

2 weeks agovasnprintf: Optimize new code.
Bruno Haible [Tue, 15 Apr 2025 04:47:47 +0000 (06:47 +0200)]
vasnprintf: Optimize new code.

* lib/vasnprintf.c (VASNPRINTF): Optimize common subexpressions.

2 weeks agoregex: remove _REGEX_NELTS
Paul Eggert [Mon, 14 Apr 2025 22:42:40 +0000 (15:42 -0700)]
regex: remove _REGEX_NELTS

This is a cleanup after the recent fix for undefined behavior.
* lib/regex.h (_REGEX_NELTS): Remove, as it is no longer useful.
All uses removed.  Remove no-longer-needed uses of #pragma GCC.

2 weeks agoregex: don’t check RE_SYNTAX_EMACS
Paul Eggert [Mon, 14 Apr 2025 21:43:02 +0000 (14:43 -0700)]
regex: don’t check RE_SYNTAX_EMACS

* m4/regex.m4 (gl_REGEX): Do not check RE_SYNTAX_EMACS’s value.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-04/msg00098.html

2 weeks agoc32is*, c32to* tests: Avoid test failures on macOS 15.4.
Bruno Haible [Mon, 14 Apr 2025 20:53:12 +0000 (22:53 +0200)]
c32is*, c32to* tests: Avoid test failures on macOS 15.4.

* tests/test-c32isalnum.c (main): On macOS, disable test cases that fail
on macOS 15.4.
* tests/test-c32isalpha.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-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

2 weeks agoc-stack tests: Remove left-over core dump file.
Bruno Haible [Mon, 14 Apr 2025 20:49:55 +0000 (22:49 +0200)]
c-stack tests: Remove left-over core dump file.

Suggested by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00101.html>.

* tests/test-c-stack2.sh: Remove 'core' and 'test-c-stack.core' when
done.

2 weeks agoregex: Fix undefined behaviour.
Bruno Haible [Mon, 14 Apr 2025 14:00:13 +0000 (16:00 +0200)]
regex: Fix undefined behaviour.

* lib/regex.h (_REGEX_NELTS): Define to empty; don't use ISO C99
variable-length arrays.

2 weeks agoselect tests: Work around a Cygwin bug.
Bruno Haible [Mon, 14 Apr 2025 13:15:12 +0000 (15:15 +0200)]
select tests: Work around a Cygwin bug.

* tests/test-select-in.sh: Skip the /dev/null test on Cygwin 3.6.x.

2 weeks agoisnanl, isfinite, snan: Improve cross-compilation guess.
Bruno Haible [Mon, 14 Apr 2025 10:14:38 +0000 (12:14 +0200)]
isnanl, isfinite, snan: Improve cross-compilation guess.

* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Don't assume that
arm is always little-endian.

2 weeks agoisnanl, isfinite, snan: Improve cross-compilation guess.
Bruno Haible [Mon, 14 Apr 2025 09:37:25 +0000 (11:37 +0200)]
isnanl, isfinite, snan: Improve cross-compilation guess.

* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): When
cross-compiling, invoke gl_LONG_DOUBLE_VS_DOUBLE and
gl_DOUBLE_EXPONENT_LOCATION, and guess the result depending on the CPU.
* modules/getpayloadl (Depends-on): Add exponentd.m4, math_h.m4.
* modules/isfinite (Depends-on): Likewise.
* modules/isnanl (Depends-on): Likewise.
* modules/setpayloadl (Depends-on): Likewise.
* modules/setpayloadsigl (Depends-on): Likewise.
* modules/isnanl-nolibm (Depends-on): Add exponentd.m4.

2 weeks agoregex: make RE_* usable in #if
Paul Eggert [Mon, 14 Apr 2025 03:47:54 +0000 (20:47 -0700)]
regex: make RE_* usable in #if

* lib/regex.h (RE_BACKSLASH_ESCAPE_IN_LISTS):
Define to 1ul so that the RE_* macros can be used in #if.

2 weeks agoregex: don’t assume RE_SYNTAX_* work in #if
Paul Eggert [Mon, 14 Apr 2025 01:53:17 +0000 (18:53 -0700)]
regex: don’t assume RE_SYNTAX_* work in #if

* m4/regex.m4 (gl_REGEX): Fix thinko that would have
prevented future glibc versions from passing the test.

2 weeks agoregex: pacify gcc -Wcalloc-transposed-args
Paul Eggert [Mon, 14 Apr 2025 01:36:29 +0000 (18:36 -0700)]
regex: pacify gcc -Wcalloc-transposed-args

* lib/regcomp.c (init_dfa, parse_bracket_exp)
(build_charclass_op):
* lib/regex_internal.c (create_ci_newstate, create_cd_newstate):
* lib/regexec.c (get_subexp, build_trtable):
When calling calloc, put size argument last.

2 weeks agoregex: match current Emacs behavior
Paul Eggert [Mon, 14 Apr 2025 01:01:08 +0000 (18:01 -0700)]
regex: match current Emacs behavior

* config/srclist.txt: Comment out regex.h, since we now
disagree with glibc.
* lib/regex.h (RE_SYNTAX_EMACS):
Match Emacs 21+ behavior, not Emacs 20-.
* m4/regex.m4 (gl_REGEX): Check for this Emacs fix.

3 weeks agogetlogin_r tests: Avoid writing to a literal string.
Bruno Haible [Sun, 13 Apr 2025 21:18:10 +0000 (23:18 +0200)]
getlogin_r tests: Avoid writing to a literal string.

* tests/test-getlogin_r.c: Include xalloc.h.
(main): Pass a writable string to putenv().
* modules/getlogin_r-tests (Depends-on): Add xalloc.
(Makefile.am): Link the program with libintl when needed.

3 weeks agogetlogin tests: Avoid writing to a literal string.
Bruno Haible [Sun, 13 Apr 2025 21:17:06 +0000 (23:17 +0200)]
getlogin tests: Avoid writing to a literal string.

* tests/test-getlogin.c: Include xalloc.h.
(main): Pass a writable string to putenv().
* modules/getlogin-tests (Depends-on): Add xalloc.
(Makefile.am): Link the program with libintl when needed.

3 weeks agovasnprintf: Optimize last commit.
Bruno Haible [Sun, 13 Apr 2025 18:23:57 +0000 (20:23 +0200)]
vasnprintf: Optimize last commit.

* lib/vasnprintf.c (VASNPRINTF): Optimize a few loops.

3 weeks agovasnprintf: Consider the grouping rule.
Bruno Haible [Sun, 13 Apr 2025 15:58:40 +0000 (17:58 +0200)]
vasnprintf: Consider the grouping rule.

Reported by Pádraig Brady.

* lib/vasnprintf.c (grouping_rule, num_thousands_separators): New
functions.
(MAX_ROOM_NEEDED): Adjust worst-case guess for FLAG_GROUP.
(VASNPRINTF): Likewise. Invoke grouping_rule, num_thousands_separators.
Use the grouping rule to determine where to insert the thousands
separators.
* modules/vasnprintf (Depends-on): Add localeconv.
* modules/vasnwprintf (Depends-on): Likewise.
* modules/c-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.

3 weeks agovasnprintf tests: Fix compilation error on MSVC (regression yesterday).
Bruno Haible [Sun, 13 Apr 2025 15:48:56 +0000 (17:48 +0200)]
vasnprintf tests: Fix compilation error on MSVC (regression yesterday).

* tests/test-vasnprintf-posix2.c (main): Disable the new test on
platforms where the 'long double' value range is insufficient.
* tests/test-vasnwprintf-posix2.c (main): Likewise.

3 weeks ago*printf: Document a Haiku bug.
Bruno Haible [Sun, 13 Apr 2025 09:17:26 +0000 (11:17 +0200)]
*printf: Document a Haiku bug.

* doc/posix-functions/fwprintf.texi: Mention the missing ' flag support.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.

3 weeks agoaligned-malloc tests: Simplify a macro definition and improve comment.
Collin Funk [Sat, 12 Apr 2025 22:03:41 +0000 (15:03 -0700)]
aligned-malloc tests: Simplify a macro definition and improve comment.

Suggested by Bruno Haible.

* tests/test-aligned-malloc.c (ALIGNMENT): Undefine without checking.
Mention that the #undef is for AIX which defines it beforehand in
<sys/socket.h>.

3 weeks agoimmutable: Simplify a macro definition and improve comment.
Collin Funk [Sat, 12 Apr 2025 22:02:33 +0000 (15:02 -0700)]
immutable: Simplify a macro definition and improve comment.

Suggested by Bruno Haible.

* lib/immutable.c (ALIGNMENT): Undefine without checking. Mention that
the #undef is for AIX which defines it beforehand in <sys/socket.h>.

3 weeks agovasnprintf tests: Add a test case that showcases a Solaris bug.
Bruno Haible [Sat, 12 Apr 2025 21:48:28 +0000 (23:48 +0200)]
vasnprintf tests: Add a test case that showcases a Solaris bug.

* tests/test-vasnprintf-posix2.c (main): Add one more %'g test.
* tests/test-vasnwprintf-posix2.c (main): Likewise.

3 weeks agostdlib: Avoid syntax errors in libstdc++ header files on AIX.
Collin Funk [Sat, 12 Apr 2025 20:24:31 +0000 (13:24 -0700)]
stdlib: Avoid syntax errors in libstdc++ header files on AIX.

* lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
strtoull gets defined as a macro.

3 weeks agoaligned-malloc tests: Avoid redefining macros on AIX.
Collin Funk [Sat, 12 Apr 2025 19:36:10 +0000 (12:36 -0700)]
aligned-malloc tests: Avoid redefining macros on AIX.

* tests/test-aligned-malloc.c (ALIGNMENT): Undefine any definition from
system headers.

3 weeks agoimmutable: Avoid redefining macros on AIX.
Collin Funk [Sat, 12 Apr 2025 19:30:30 +0000 (12:30 -0700)]
immutable: Avoid redefining macros on AIX.

* lib/immutable.c (ALIGNMENT): Undefine any definition from system
headers.

3 weeks agois*_l, fnmatch tests: Avoid test failures on macOS 15.4.
Bruno Haible [Sat, 12 Apr 2025 10:45:40 +0000 (12:45 +0200)]
is*_l, fnmatch tests: Avoid test failures on macOS 15.4.

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

* tests/test-isgraph_l.c (main): On macOS, disable test cases that fail
on macOS 15.4.
* tests/test-isprint_l.c (main): Likewise.
* tests/test-ispunct_l.c (main): Likewise.
* tests/test-fnmatch.c (main): Likewise.

3 weeks agovasnprintf: Work around two grouping bugs on native Windows.
Bruno Haible [Sat, 12 Apr 2025 09:03:45 +0000 (11:03 +0200)]
vasnprintf: Work around two grouping bugs on native Windows.

* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_FLAG_GROUPING): On native
Windows, define NEED_PRINTF_FLAG_GROUPING.
* lib/vasnprintf.c (localeconv): Undefine.
(thousands_separator_char, thousands_separator_wchar): On native
Windows, use localeconv().
* tests/test-vasnprintf-posix2.c (main): On native Windows, expect
3 digits for the exponent.
* tests/test-vasnwprintf-posix2.c (main): Likewise.
* doc/posix-functions/fprintf.texi: Mention the mingw and MSVC bugs.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.

3 weeks agolocaleconv tests: Add multithread-safety test.
Bruno Haible [Sat, 12 Apr 2025 07:32:43 +0000 (09:32 +0200)]
localeconv tests: Add multithread-safety test.

* tests/test-localeconv-mt.c: New file, based on
tests/test-nl_langinfo-mt.c.
* modules/localeconv-tests (Files): Add it.
(Depends-on): Add setlocale, thread, nanosleep.
(Makefile.am): Arrange to compile and run test-localeconv-mt.

3 weeks agovasnprintf: Work around two grouping bugs on many platforms.
Bruno Haible [Fri, 11 Apr 2025 22:09:23 +0000 (00:09 +0200)]
vasnprintf: Work around two grouping bugs on many platforms.

* m4/printf.m4 (gl_PRINTF_FLAG_GROUPING_INT_PRECISION): New macro.
(gl_PRINTF_FLAG_GROUPING_MULTIBYTE): New macro.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Require
gl_PRINTF_FLAG_GROUPING_INT_PRECISION,
gl_PRINTF_FLAG_GROUPING_MULTIBYTE. Test
gl_cv_func_printf_flag_grouping_int_precision,
gl_cv_func_printf_flag_grouping_multibyte.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX):
Likewise.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_FLAG_GROUPING): Require
gl_PRINTF_FLAG_GROUPING_INT_PRECISION,
gl_PRINTF_FLAG_GROUPING_MULTIBYTE. Test
gl_cv_func_printf_flag_grouping_int_precision,
gl_cv_func_printf_flag_grouping_multibyte. Define the C macro
NEED_PRINTF_FLAG_GROUPING_INT.
* lib/vasnprintf.c (thousands_separator_char): New function.
(THOUSEP_CHAR_MAXLEN): New macro.
(thousands_separator_wchar): New function.
(THOUSEP_WCHAR_MAXLEN): New macro.
(MAX_ROOM_NEEDED): Improve the room estimate for FLAG_GROUP.
(VASNPRINTF): Add code for emitting thousands separators in the %f, %F,
%g, %G implementations and in the code relies the system's
sprintf/snprintf/swprintf function. Test NEED_PRINTF_FLAG_GROUPING and
NEED_PRINTF_FLAG_GROUPING_INT where needed.
* tests/test-vasnprintf-posix2.c (main): Add tests of the grouping flag.
* tests/test-vasnwprintf-posix2.c (main): Likewise.
* tests/test-vasnprintf-posix2.sh: Test in both French locales, not only
in one of them.
* tests/test-vasnwprintf-posix2.sh: Likewise.
* modules/vasnprintf-posix-tests (Depends-on): Add localeconv.
* modules/vasnwprintf-posix-tests (Depends-on): Likewise.
* doc/posix-functions/fprintf.texi: Mention the grouping bug with
precision on integers and the grouping bug with a multibyte thousands
separator.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.

3 weeks agovasnprintf: Follow glibc's behaviour on glibc systems.
Bruno Haible [Fri, 11 Apr 2025 14:59:24 +0000 (16:59 +0200)]
vasnprintf: Follow glibc's behaviour on glibc systems.

* lib/vasnprintf.c (DCHAR_MBSNLEN): Define fallback.
(VASNPRINTF): Use it on for width handling on glibc.
* modules/vasnprintf (Depends-on): Add mbsnlen.
* modules/c-vasnprintf (Depends-on): Likewise.

3 weeks agovasnprintf: Fix memory size bound for %g with grouping and precision.
Bruno Haible [Fri, 11 Apr 2025 14:45:03 +0000 (16:45 +0200)]
vasnprintf: Fix memory size bound for %g with grouping and precision.

* lib/vasnprintf.c (MAX_ROOM_NEEDED): For %g, consider also the size of
the thousands separators.

3 weeks agonewlocale: Support cross-compilation.
Bruno Haible [Fri, 11 Apr 2025 07:50:58 +0000 (09:50 +0200)]
newlocale: Support cross-compilation.

* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Use a no-op command as third
argument of AC_RUN_IFELSE.

3 weeks agostrcasecmp: Support cross-compilation.
Bruno Haible [Thu, 10 Apr 2025 14:42:14 +0000 (16:42 +0200)]
strcasecmp: Support cross-compilation.

Reported by Rudi Heitbaum <rudi@heitbaum.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00055.html>.

* m4/strcasecmp.m4 (gl_STRCASECMP_WORKS): Use a no-op command as third
argument of AC_RUN_IFELSE.

3 weeks agovasnprintf: Fix handling of # flag in %b, %B directives.
Bruno Haible [Thu, 10 Apr 2025 08:42:12 +0000 (10:42 +0200)]
vasnprintf: Fix handling of # flag in %b, %B directives.

* lib/vasnprintf.c (VASNPRINTF): In the prec_ourselves code, treat a 0b
prefix like a 0x prefix.

3 weeks agostring-h: Fix build error on Windows/macOS about strerror_l.
Simon Josefsson [Wed, 9 Apr 2025 06:45:40 +0000 (08:45 +0200)]
string-h: Fix build error on Windows/macOS about strerror_l.

https://lists.gnu.org/r/bug-gnulib/2025-04/msg00045.html

* lib/string.in.h: Wrap _GL_WARN_ON_USE in
HAVE_RAW_DECL_STRERROR_L.