]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
6 hours agoautoupdate master
Karl Berry [Wed, 22 Jul 2026 14:48:12 +0000 (07:48 -0700)] 
autoupdate

22 hours agogetopt-gnu: Clarify NetBSD status.
Bruno Haible [Tue, 21 Jul 2026 22:44:32 +0000 (00:44 +0200)] 
getopt-gnu: Clarify NetBSD status.

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Add comments regarding NetBSD.

35 hours agombiter-aux: Avoid gcc -Wcomment warning.
Bruno Haible [Tue, 21 Jul 2026 10:02:14 +0000 (12:02 +0200)] 
mbiter-aux: Avoid gcc -Wcomment warning.

Reported by G. Branden Robinson in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-07/msg00127.html>.

* lib/mbiter-aux.c (mbiter_is_utf8): Tweak comment.

3 days agophysmem: On NetBSD, consider the available swap space.
Bruno Haible [Sun, 19 Jul 2026 15:18:31 +0000 (17:18 +0200)] 
physmem: On NetBSD, consider the available swap space.

* lib/physmem.c (physmem_claimable): Also consider the number of
available swap pages.

3 days agodiffseq: Restore gcc 17 -fanalyzer customization (regr. yesterday).
Bruno Haible [Sat, 18 Jul 2026 23:22:57 +0000 (01:22 +0200)] 
diffseq: Restore gcc 17 -fanalyzer customization (regr. yesterday).

* lib/diffseq.h: Don't assume that -Wanalyzer-use-of-uninitialized
is fixed in gcc 17.

4 days agodiffseq: gcc bug 80922 should be fixed now
Paul Eggert [Sat, 18 Jul 2026 03:59:32 +0000 (20:59 -0700)] 
diffseq: gcc bug 80922 should be fixed now

* lib/diffseq.h: Stop ignoring -Wmaybe-uninitialized and
-Wanalyzer-use-of-uninitialized-value in GCC 17 and later,
as the bug I reported to GCC seems to have been fixed.

5 days agogetopt: fix comment typo in previous patch
Paul Eggert [Fri, 17 Jul 2026 21:16:07 +0000 (14:16 -0700)] 
getopt: fix comment typo in previous patch

5 days agogetopt: port to NetBSD git head gcc -Wuseless cast
Paul Eggert [Fri, 17 Jul 2026 20:47:19 +0000 (13:47 -0700)] 
getopt: port to NetBSD git head gcc -Wuseless cast

Problem reported by Thomas Klausner in:
https://lists.gnu.org/r/emacs-devel/2026-07/msg00169.html
* lib/getopt-pfx-ext.h (__getopt_argv_const_is_empty): New macro,
defined to 1 when we define __getopt_argv_const to empty.
* lib/getopt1.c (ARGV_CAST): New macro.
(getopt_long, getopt_long_only): Use it.

5 days agogendocs: output human-readable file sizes
Paul Eggert [Fri, 17 Jul 2026 17:50:24 +0000 (10:50 -0700)] 
gendocs: output human-readable file sizes

* build-aux/gendocs.sh (calcsize): Output human-readable file
size, rather than always size in KiB mislabled as "K bytes".
But fall back on a plain byte count if GNU du is not in use.
(time-stamp-time-zone): Now "UTC0" so scriptversion does not decrease.
* doc/gendocs_template, doc/gendocs_template_min:
Don’t assume sizes are in KiB (the old values were mislabeled anyway).
Be more consistent about file type labels.

5 days agogendocs: correct the calculation of file sizes.
James Youngman [Fri, 17 Jul 2026 11:55:29 +0000 (12:55 +0100)] 
gendocs: correct the calculation of file sizes.

* build-aux/gendocs.sh (calcsize): do not assume "ls -sk" tells us the
size of the file in KiB.  Calculate it from the file length instead.

6 days agophysmem: fix typo causing configure failure
Pádraig Brady [Thu, 16 Jul 2026 10:47:48 +0000 (11:47 +0100)] 
physmem: fix typo causing configure failure

* m4/physmem.m4: Add missing line continuation.

6 days agophysmem: allow physmem_claimable to return more than 4 GiB on NetBSD.
Collin Funk [Thu, 16 Jul 2026 03:13:02 +0000 (20:13 -0700)] 
physmem: allow physmem_claimable to return more than 4 GiB on NetBSD.

Problem reported by Bruno Haible in:
<https://lists.gnu.org/r/bug-gnulib/2026-07/msg00046.html>.

* m4/physmem.m4 (gl_PHYSMEM): Check for the presence of
uvm/uvm_extern.h.
* lib/physmem.c [HAVE_UVM_UVM_EXTERN_H]: Include uvm/uvm_extern.h.
(physmem_claimable) [HAVE_SYSCTL && VM_UVMEXP2]: Calculate the free
memory using a NetBSD-specific sysctl.

6 days agophysmem: Use countof.
Collin Funk [Thu, 16 Jul 2026 02:57:39 +0000 (19:57 -0700)] 
physmem: Use countof.

* modules/physmem (Depends-on): Add stdcountof-h.
* lib/physmem.c: Include stdcountof.h.
(ARRAY_SIZE): Remove macro.
(physmem_total, physmem_claimable): Use countof instead of ARRAY_SIZE.

6 days agophysmem: allow physmem_claimable to return more than 8 GiB on FreeBSD.
Collin Funk [Wed, 15 Jul 2026 03:31:54 +0000 (20:31 -0700)] 
physmem: allow physmem_claimable to return more than 8 GiB on FreeBSD.

Problem reported by Bruno Haible in:
<https://lists.gnu.org/r/bug-gnulib/2026-07/msg00046.html>.

* m4/physmem.m4 (gl_PHYSMEM): Check for the sysctlbyname function.
* lib/physmem.c (physmem_claimable) [HAVE_SYSCTLBYNAME && __FreeBSD__]:
Calculate of free memory from some FreeBSD-specific sysctl strings.

7 days agoFix test failures on FreeBSD 15.1.
Bruno Haible [Wed, 15 Jul 2026 14:56:28 +0000 (16:56 +0200)] 
Fix test failures on FreeBSD 15.1.

* tests/test-c32isalnum.c (main): On FreeBSD, disable tests that fail
without mmodule uchar-h-c23.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

8 days agovasnwprintf-extra-tests: Refactor.
Bruno Haible [Tue, 14 Jul 2026 17:34:35 +0000 (19:34 +0200)] 
vasnwprintf-extra-tests: Refactor.

* tests/test-vasnwprintf-big2.c: Renamed from
tests/test-vasnwprintf-big.c.
* modules/vasnwprintf-extra-tests: Update.

8 days agovaszprintf-extra-tests: Refactor.
Bruno Haible [Tue, 14 Jul 2026 17:32:31 +0000 (19:32 +0200)] 
vaszprintf-extra-tests: Refactor.

* tests/test-vaszprintf-big1.c: Renamed from
tests/test-vaszprintf-big.c.
* modules/vaszprintf-extra-tests: Update.

8 days agovasprintf-extra-tests: Refactor.
Bruno Haible [Tue, 14 Jul 2026 17:30:55 +0000 (19:30 +0200)] 
vasprintf-extra-tests: Refactor.

* tests/test-vasprintf-big1.c: Renamed from tests/test-vasprintf-big.c.
* modules/vasprintf-extra-tests: Update.

8 days agovasnprintf-extra-tests: Refactor.
Bruno Haible [Tue, 14 Jul 2026 17:28:10 +0000 (19:28 +0200)] 
vasnprintf-extra-tests: Refactor.

* tests/test-vasnprintf-big1.c: New file, based on
tests/test-vasnprintf-big.c.
* tests/test-vasnprintf-big2.c: New file, based on
tests/test-vasnprintf-big.c.
* tests/test-vasnprintf-big.c: Remove file.
* modules/vasnprintf-extra-tests: Update to build two separate programs.

8 days agoobstack-zprintf-extra-tests: Refactor.
Bruno Haible [Tue, 14 Jul 2026 17:21:23 +0000 (19:21 +0200)] 
obstack-zprintf-extra-tests: Refactor.

* tests/test-obstack-zprintf-big2.c: Renamed from
tests/test-obstack-zprintf-big.c.
* modules/obstack-zprintf-extra-tests: Update.

8 days agovasnprintf-extra-tests: Fix test bug.
Bruno Haible [Tue, 14 Jul 2026 17:04:20 +0000 (19:04 +0200)] 
vasnprintf-extra-tests: Fix test bug.

* tests/test-vasnprintf-big.c (main): Properly NUL-terminate the second
string.

8 days agovasnprintf, vasnwprintf: Revisit THOUSEP_MAXLEN.
Bruno Haible [Tue, 14 Jul 2026 10:17:24 +0000 (12:17 +0200)] 
vasnprintf, vasnwprintf: Revisit THOUSEP_MAXLEN.

* lib/vasnprintf.c (THOUSEP_MAXLEN): Add comment.
(VASNPRINTF): Don't use THOUSEP_MAXLEN here.

8 days agovasnwprintf: Fix test failure on NetBSD.
Bruno Haible [Mon, 13 Jul 2026 23:11:27 +0000 (01:11 +0200)] 
vasnwprintf: Fix test failure on NetBSD.

* lib/vasnprintf.c (THOUSEP_MAXLEN): Correct value.

9 days agovaszprintf-extra-tests: New module.
Bruno Haible [Mon, 13 Jul 2026 21:06:33 +0000 (23:06 +0200)] 
vaszprintf-extra-tests: New module.

* tests/test-vaszprintf-big.c: New file, extracted from
tests/test-vaszprintf-posix.c.
* tests/test-vaszprintf-posix.c (test_function): Revert last change.
* modules/vaszprintf-extra-tests: New file.
* modules/vaszprintf-tests: New file.

9 days agovasprintf-extra-tests: New module.
Bruno Haible [Mon, 13 Jul 2026 20:50:31 +0000 (22:50 +0200)] 
vasprintf-extra-tests: New module.

* tests/test-vasprintf-big.c: New file, extracted from
tests/test-vasprintf-posix.c.
* tests/test-vasprintf-posix.c (test_function): Revert last change.
* modules/vasprintf-extra-tests: New file.
* modules/vasprintf-tests (Depends-on): Add vasprintf-extra-tests.

9 days agovasnprintf-extra-tests: Move new expensive test to here.
Bruno Haible [Mon, 13 Jul 2026 20:27:16 +0000 (22:27 +0200)] 
vasnprintf-extra-tests: Move new expensive test to here.

* tests/test-vasnprintf-big.c (main): Move INT_MAX test case to here.
* tests/test-vasnprintf-posix.c (test_function): Revert last change.

9 days agovasnprintf: Fix compilation error on FreeBSD, OpenBSD (regr. today).
Bruno Haible [Mon, 13 Jul 2026 18:12:54 +0000 (20:12 +0200)] 
vasnprintf: Fix compilation error on FreeBSD, OpenBSD (regr. today).

* lib/vasnprintf.c (THOUSEP_MAXLEN): Define always.

9 days agovasnprintf: Fix several test failures on NetBSD (regr. 2026-07-06).
Bruno Haible [Mon, 13 Jul 2026 16:08:21 +0000 (18:08 +0200)] 
vasnprintf: Fix several test failures on NetBSD (regr. 2026-07-06).

* lib/vasnprintf.c (USE_SNPRINTF): Don't enable on NetBSD.
* doc/posix-functions/snprintf.texi: Update regarding NetBSD.
* doc/posix-functions/vsnprintf.texi: Likewise.

9 days agovasnprintf: Fix test failure on Solaris 11 OmniOS (regr. 2026-07-06).
Bruno Haible [Mon, 13 Jul 2026 16:04:47 +0000 (18:04 +0200)] 
vasnprintf: Fix test failure on Solaris 11 OmniOS (regr. 2026-07-06).

* lib/vasnprintf.c (THOUSEP_MAXLEN): New macro.
(MAX_ROOM_NEEDED, VASNPRINTF): Use it for the estimate for FLAG_GROUP.

9 days agovasnprintf: Fix compilation error on MSVC (regression 2026-07-06).
Bruno Haible [Mon, 13 Jul 2026 13:32:05 +0000 (15:32 +0200)] 
vasnprintf: Fix compilation error on MSVC (regression 2026-07-06).

* lib/vasnprintf.c (USE_SNPRINTF): Fix condition.
(VASNPRINTF): Avoid declaring multiple variables in one declaration.

10 days agoRemove unnecessary include after 2026-06-26 change.
Bruno Haible [Sun, 12 Jul 2026 20:18:44 +0000 (22:18 +0200)] 
Remove unnecessary include after 2026-06-26 change.

* lib/struniq.h: Update comment.
* lib/getlocalename_l-unsafe.c: Don't include <limits.h>.
* lib/getlocalename_l.c: Likewise.
* lib/hashcode-mem.c: Likewise.
* lib/hashcode-string2.c: Likewise.
* lib/hashkey-string.c: Likewise.
* lib/localename.c: Likewise.
* lib/mem-hash-map.c: Likewise.
* tests/test-array_map.c: Likewise.
* tests/test-avltreehash_list.c: Likewise.
* tests/test-hash_map.c: Likewise.
* tests/test-linkedhash_list.c: Likewise.
* tests/test-linkedhash_map.c: Likewise.
* tests/test-rbtreehash_list.c: Likewise.

10 days agomaintainer-makefile: Fix false syntax-check failure when using inttostr.
Collin Funk [Sun, 12 Jul 2026 17:32:11 +0000 (10:32 -0700)] 
maintainer-makefile: Fix false syntax-check failure when using inttostr.

* top/maint.mk (sc_prohibit_inttostr_without_use): Adjust the regular
expression to also match inttostr.

10 days agodoc: Fix typo.
Bruno Haible [Sun, 12 Jul 2026 16:42:34 +0000 (18:42 +0200)] 
doc: Fix typo.

* doc/posix-functions/readlinkat.texi: Fix typo in 2026-06-07 commit.

10 days agoautoupdate
Karl Berry [Sun, 12 Jul 2026 13:31:29 +0000 (06:31 -0700)] 
autoupdate

2 weeks agofree-posix: Fix bogus -Wmismatched-dealloc warnings (regr. 2026-05-30).
Bruno Haible [Wed, 8 Jul 2026 21:08:12 +0000 (23:08 +0200)] 
free-posix: Fix bogus -Wmismatched-dealloc warnings (regr. 2026-05-30).

* modules/free-posix (Depends-on): Add back wchar-h.

2 weeks agopthread_sigmask: Avoid compilation error on mingw with gcc >= 14.
Bruno Haible [Wed, 8 Jul 2026 11:42:23 +0000 (13:42 +0200)] 
pthread_sigmask: Avoid compilation error on mingw with gcc >= 14.

* lib/signal.in.h (pthread_sigmask): Revert 2018-01-04 change, now
unnecessary due to 2026-04-10 change.

2 weeks agomanywarnings: Fix for compilers that are named '$host-gcc', part 2.
Bruno Haible [Wed, 8 Jul 2026 11:22:51 +0000 (13:22 +0200)] 
manywarnings: Fix for compilers that are named '$host-gcc', part 2.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Apply the fix for
-Wuseless-cast and -Wzero-as-null-pointer-constant also for GCC >= 10.

2 weeks agovasnprintf: fix ("%*d", INT_MAX, n)
Paul Eggert [Tue, 7 Jul 2026 03:35:24 +0000 (20:35 -0700)] 
vasnprintf: fix ("%*d", INT_MAX, n)

I ran into this problem when doing stress testing with GNU m4.
The problem is that ("%*d", INT_MAX, n) fails because the code
refuses to create a buffer of size INT_MAX + 1u,
due to problems when dealing with older nonconforming snprintf.
The simplest fix was to use snprintf only if it handles
sizes like INT_MAX + 1u, and to fall back on sprintf otherwise.
Nowadays I think snprintf should work on most practical targets.
Assuming this patch works out, perhaps we could simplify
lib/vasnprintf.c to ease further maintenance,
as nowadays I hope we can assume both HAVE_SNPRINTF_RETVAL_C99 and
HAVE_SNPRINTF_TRUNCATION_C99 on platforms where USE_SNPRINTF.
* lib/vasnprintf.c: Include minmax.h.
(USE_SNPRINTF): Define to 1 only if glibc 2+, Android, musl,
the BSDs, macOS, or Microsoft UCRT.
(VASNPRINTF) [USE_SNPRINTF]:
Allow maxlen to be 1 greater than INT_MAX on 64-bit platforms.
Document the limit’s derivation by using named locals.
Do not attempt to work around bugs in pre-C99 implementations,
as USE_SNPRINTF is pickier now.
* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF):
Move gl_MUSL_LIBC call from here ...
(gl_PREREQ_VASNXPRINTF): ... to here.
* modules/c-vasnprintf, modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
* modules/vasnprintf, modules/vasnwprintf:
(Files): Add m4/musl.m4 if it isn’t there already.
(Depends-on): Add minmax.
* tests/test-vasnprintf-posix.c:
* tests/test-vasprintf-posix.c:
* tests/test-vaszprintf-posix.c:
Include <limits.h> and <errno.h> if needed.
(test_function): Test for the bug, if RUN_EXPENSIVE_TESTS=yes
in the environment; this the coreutils tradition and I
didn’t see any Gnulib tradition so I just used it.

2 weeks agoautoupdate
Karl Berry [Sun, 5 Jul 2026 15:34:38 +0000 (08:34 -0700)] 
autoupdate

2 weeks agodoc: Mention gnulib-202607 git bundle.
Simon Josefsson [Sat, 4 Jul 2026 11:16:16 +0000 (13:16 +0200)] 
doc: Mention gnulib-202607 git bundle.

* doc/gnulib-git-bundle.texi: Update for 20270604 release.

2 weeks agodoc: Update regarding stable branches.
Simon Josefsson [Sat, 4 Jul 2026 10:09:02 +0000 (12:09 +0200)] 
doc: Update regarding stable branches.

* doc/gnulib-readme.texi (Stable Branches): Mention new branch
stable-202607. Mention that stable-202507 is no longer updated.

2 weeks agobcp47: Relicense under LGPLv2+.
Bruno Haible [Fri, 3 Jul 2026 22:17:04 +0000 (00:17 +0200)] 
bcp47: Relicense under LGPLv2+.

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

3 weeks agoFix last ChangeLog entry.
Bruno Haible [Tue, 30 Jun 2026 17:02:58 +0000 (19:02 +0200)] 
Fix last ChangeLog entry.

3 weeks agogetaddrinfo tests: Skip when DNS resolution is unavailable
Zineb Zaadoud [Tue, 30 Jun 2026 16:10:59 +0000 (18:10 +0200)] 
getaddrinfo tests: Skip when DNS resolution is unavailable

* tests/test-getaddrinfo.c (simple): Skip tests for unavailable DNS.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
3 weeks agoautoupdate
Karl Berry [Sun, 28 Jun 2026 14:43:16 +0000 (07:43 -0700)] 
autoupdate

3 weeks agoautoupdate
Karl Berry [Sat, 27 Jun 2026 14:27:11 +0000 (07:27 -0700)] 
autoupdate

3 weeks agostrfmon_l: be consistent about unsigned vs size_t
Paul Eggert [Fri, 26 Jun 2026 18:34:12 +0000 (11:34 -0700)] 
strfmon_l: be consistent about unsigned vs size_t

* lib/strfmon_l.c (directives_t, fmon_parse):
Count is merely unsigned int, not size_t.

3 weeks agohashcode-mem: don’t infloop if UINT_MAX < size
Paul Eggert [Fri, 26 Jun 2026 18:28:58 +0000 (11:28 -0700)] 
hashcode-mem: don’t infloop if UINT_MAX < size

* lib/hashcode-mem.c (hash_pjw_bare): Use size_t for loop index.

3 weeks agogen-uni-tables: prefer size_t for size loops
Paul Eggert [Fri, 26 Jun 2026 18:27:32 +0000 (11:27 -0700)] 
gen-uni-tables: prefer size_t for size loops

* lib/gen-uni-tables.c (output_predicate, output_category)
(output_combclass, output_bidi_category, output_decimal_digit)
(output_digit, output_numeric, output_mirror)
(output_indic_conjunct_break, output_joining_type)
(output_joining_group, output_scripts, output_ident_category)
(output_lbpea, output_wbp, output_gbp_table)
(output_decomposition, output_simple_mapping):
Use size_t for loop indexes when the upper bound is size_t.

3 weeks agocrypto/gc-pbkdf2: redo unsigned indexes
Paul Eggert [Fri, 26 Jun 2026 18:23:40 +0000 (11:23 -0700)] 
crypto/gc-pbkdf2: redo unsigned indexes

* lib/gc-pbkdf2.c (gc_pbkdf2_prf):
Don’t infloop if upper bound of loop is UINT_MAX.

3 weeks agobitset: possibly widen unsigned indexes
Paul Eggert [Fri, 26 Jun 2026 18:20:50 +0000 (11:20 -0700)] 
bitset: possibly widen unsigned indexes

* lib/bitset/vector.c (vbitset_empty_p, vbitset_not)
(vbitset_disjoint_p, vbitset_and, vbitset_and_or)
(vbitset_and_or_cmp, vbitset_andn_or, vbitset_andn_or_cmp)
(vbitset_or_and, vbitset_or_and_cmp):
In a for-loop, use an index type related to the upper bound’s type
rather than trusting ‘unsigned’ to be wide enough.

3 weeks agobitrotate: prefer C2y to bitrotate or by-hand
Paul Eggert [Fri, 26 Jun 2026 17:29:05 +0000 (10:29 -0700)] 
bitrotate: prefer C2y to bitrotate or by-hand

Deprecate the bitrotate module; it is superseded by C2y’s
stdc_rotate_left and stdc_rotate_right.  In several places, prefer
the C2y functions to doing things by hand.
* lib/arctwo.c (arctwo_encrypt, arctwo_decyrpt):
* lib/hash.c (raw_hasher):
* lib/hashcode-mem.c (hash_pjw_bare):
* lib/hashcode-string1.c (hash_string):
* lib/hashcode-string2.c (hash_pjw):
* lib/hashkey-string.c (hashkey_string_hash):
* lib/mem-hash-map.c (compute_hashval):
* lib/struniq.h (hash):
* tests/test-array_map.c (string_hash):
* tests/test-avltreehash_list.c (string_hash):
* tests/test-hash_map.c (string_hash):
* tests/test-linkedhash_list.c (string_hash):
* tests/test-linkedhash_map.c (string_hash):
* tests/test-rbtreehash_list.c (string_hash):
Use stdbit.h functions, instead of bitrotate.h functions or doing
things by hand.  Include stdbit.h to get them.  Don’t include
bitrotate.h, if it was being included.
* lib/getlocalename_l-unsafe.c, lib/getlocalename_l.c:
* lib/localename.c:
Include stdbit.h, since struniq.h now needs this.
* lib/hashcode-mem.c, lib/hashcode-string2.c, lib/hashkey-string.c:
* lib/struniq.h, tests/test-array_map.c, tests/test-avltreehash_list.c:
* tests/test-hash_map.c, tests/test-linkedhash_list.c:
* tests/test-linkedhash_map.c, tests/test-rbtreehash_list.c:
(SIZE_BITS): Remove; no longer needed.
* modules/array-map-tests, modules/avltreehash-list-tests:
* modules/crypto/arctwo, modules/getlocalename_l-simple:
* modules/getlocalename_l-unsafe, modules/hash:
* modules/hash-map-tests, modules/hashcode-mem:
* modules/hashcode-string1, modules/hashcode-string2:
* modules/hashkey-string, modules/linkedhash-list-tests:
* modules/linkedhash-map-tests, modules/localename:
* modules/mem-hash-map, modules/rbtree-list-tests:
Depend on stdc_rotate_left.
Don’t depend on bitrotate, if we were depending on it.
* modules/bitrotate: Deprecate.
* modules/crypto/arctwo: Depend on stdc_rotate_right.

3 weeks agomkdtemp: Provide declaration in <stdlib.h>.
Bruno Haible [Fri, 26 Jun 2026 16:02:41 +0000 (18:02 +0200)] 
mkdtemp: Provide declaration in <stdlib.h>.

* lib/stdlib.in.h: Include <unistd.h> when needed for mkdtemp.
* doc/posix-functions/mkdtemp.texi: Document macOS bug.

3 weeks agofnmatch: Fix syntax error in C++ mode on CentOS 7.
Bruno Haible [Fri, 26 Jun 2026 14:42:01 +0000 (16:42 +0200)] 
fnmatch: Fix syntax error in C++ mode on CentOS 7.

* lib/fnmatch.in.h (fnmatch): Provide declaration of overridden fnmatch
function, needed for _GL_CXXALIASWARN.

3 weeks agodoc: Add reference to NetBSD bug.
Bruno Haible [Thu, 25 Jun 2026 19:54:41 +0000 (21:54 +0200)] 
doc: Add reference to NetBSD bug.

* doc/posix-functions/mbrtowc.texi: Add reference.
* doc/posix-functions/mbrlen.texi: Likewise.

3 weeks agofstatat: port null file support to Alpine 3.24
Paul Eggert [Thu, 25 Jun 2026 15:27:36 +0000 (08:27 -0700)] 
fstatat: port null file support to Alpine 3.24

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00093.html
* m4/fstatat.m4 (gl_FUNC_FSTATAT): When checking for
support for a null pointer file, check nonnegative directory
file descriptors as well as AT_FDCWD.

3 weeks agomanywarnings: Fix for compilers that are named '$host-gcc'.
Bruno Haible [Thu, 25 Jun 2026 13:45:24 +0000 (15:45 +0200)] 
manywarnings: Fix for compilers that are named '$host-gcc'.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Use only the first line
of `$CC --version`. Allow $CC to be of the form '$host-gcc'.

4 weeks agosetlocale: Update a comment.
Bruno Haible [Wed, 24 Jun 2026 17:21:15 +0000 (19:21 +0200)] 
setlocale: Update a comment.

* lib/setlocale.c: Mention that gl_locale_name_from_win32_LANGID is now
defined in localename-unsafe.c instead of localename.c.

4 weeks agocrypto/af_alg: Deprecate.
Collin Funk [Tue, 23 Jun 2026 01:03:40 +0000 (18:03 -0700)] 
crypto/af_alg: Deprecate.

* modules/crypto/af_alg (Status, Notice): New sections.
(configure.ac): Add a module indicator.
* lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
indicator is defined.
* lib/sha1-stream.c (sha1_stream): Likewise.
* lib/sha256-stream.c (shaxxx_stream): Likewise.
* lib/sha3-stream.c (sha3_xxx_stream): Likewise.
* lib/sha512-stream.c (shaxxx_stream): Likewise.
* modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
* modules/crypto/sha1 (Depends-on): Likewise.
* modules/crypto/sha256 (Depends-on): Likewise.
* modules/crypto/sha3 (Depends-on): Likewise.
* modules/crypto/sha512 (Depends-on): Likewise.
* NEWS: Mention the deprecation.

4 weeks agogethrxtime: don’t use nanouptime, microuptime
Paul Eggert [Sat, 20 Jun 2026 17:45:10 +0000 (10:45 -0700)] 
gethrxtime: don’t use nanouptime, microuptime

* lib/gethrxtime.c (gethrxtime): On platforms with
CLOCK_MONOTONIC, try it first.  If it fails, just fall back on
CLOCK_REALTIME as that’s what current_timespec would do anyway.
On platforms lacking CLOCK_MONOTONIC, just use current_timespec.
* m4/gethrxtime.m4 (gl_GETHRXTIME): Don’t check for microuptime or
nanouptime.  They aren’t exposed to user space by BSD kernels now,
and it’s not clear that they ever were.

4 weeks agofstatat: don’t mess with CFLAGS
Paul Eggert [Fri, 19 Jun 2026 17:07:47 +0000 (10:07 -0700)] 
fstatat: don’t mess with CFLAGS

* m4/fstatat.m4 (gl_FUNC_FSTATAT): Remove stray code left
over from an aborted attempt to mess with CFLAGS.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00084.html

4 weeks agoopenat2-tests: port to NFS
Paul Eggert [Fri, 19 Jun 2026 16:27:30 +0000 (09:27 -0700)] 
openat2-tests: port to NFS

* tests/test-openat2.c (do_test_basic): Close fd before
removing its file.  This fixes a file descriptor leak,
and ports the test to NFS, where removing an unclosed
file leaves behind a .nfs* file that prevents the
parent directory from being removed.

4 weeks agoopenat2: fix typo for circa-2012 Linux
Paul Eggert [Fri, 19 Jun 2026 16:17:04 +0000 (09:17 -0700)] 
openat2: fix typo for circa-2012 Linux

* lib/openat2.c (dirstat) [FSTAT_O_PATH_BUG]: Fix typo (a missing
arg) in workaround for this bug in Linux kernel 2.6.39 (2011)
through 3.5.7 (2012).  Evidently nobody compiles on these old
platforms, but we might as well fix the code if we’re going to
have it at all.

4 weeks agofstatat: support NULL if AT_EMPTY_PATH
Paul Eggert [Thu, 18 Jun 2026 20:33:58 +0000 (13:33 -0700)] 
fstatat: support NULL if AT_EMPTY_PATH

On platforms that define AT_EMPTY_PATH, allow a null pointer to be
passed as a file name.  This is GNU behavior as of glibc 2.41 +
Linux kernel 6.11, and can be supported on older kernels, older
glibcs, and on recent FreeBSD and z/OS.
* lib/fstatat.c (rpl_fstatat): Support AT_EMPTY_PATH,
if it exists, on null pointers.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): Replace fstatat if
AT_EMPTY_PATH is defined but does not work on null pointers.
Also, define HAVE_WORKING_FSTATAT_ZERO_FLAG, if it is discovered,
regardless of whether replacing fstatat.  This refactoring makes
config.h a bit less confusing.
* tests/test-fstatat.c (main): Test AT_EMPTY_PATH if defined.

4 weeks ago* lib/stat-time.h: Fix comment.
Paul Eggert [Thu, 18 Jun 2026 17:38:36 +0000 (10:38 -0700)] 
* lib/stat-time.h: Fix comment.

4 weeks agofchmodat: fix AT_FDCWD + AT_EMPTY_PATH
Paul Eggert [Thu, 18 Jun 2026 16:29:15 +0000 (09:29 -0700)] 
fchmodat: fix AT_FDCWD + AT_EMPTY_PATH

* lib/fchmodat.c (fchmodat): When following symlinks and with
AT_FDCWD and an empty filename, don’t use fchmod as it will fail.
Instead, fall back on the usual orig_fchmodat call, as this does
the right thing if AT_EMPTY_PATH support is present there.
Using chmod (".", ...) wouldn’t be quite right here, as it would
go awry if the working directory is not searchable.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00068.html

4 weeks agostdbit-h: Work around syntax error in FreeBSD 15.1 <stdbit.h>.
Bruno Haible [Thu, 18 Jun 2026 09:42:21 +0000 (11:42 +0200)] 
stdbit-h: Work around syntax error in FreeBSD 15.1 <stdbit.h>.

* lib/stdbit.in.h (_Bool): Define on FreeBSD in C++ mode.
* doc/posix-headers/stdbit.texi: Mention the FreeBSD bug.

5 weeks agoopenat2: mention module in manual
Paul Eggert [Wed, 17 Jun 2026 13:40:41 +0000 (06:40 -0700)] 
openat2: mention module in manual

5 weeks agoopenat2: fix bug with trailing "/./"
Paul Eggert [Wed, 17 Jun 2026 07:19:35 +0000 (00:19 -0700)] 
openat2: fix bug with trailing "/./"

Problem reported by Kinan Al-Falakh in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00070.html
* lib/openat2.c (do_openat2): When opening a dotlike component at
file name end, also set the G and H indexes appropriately for ".".
This matters if the file name ends in something like "/./" so the
last component "." is not at file name end.
* tests/test-openat2.c (do_test_resolve): Test for the bug.

5 weeks agoopenat2: set HAVE_OPENAT2=0 if openat2 is missing
Paul Eggert [Wed, 17 Jun 2026 06:59:47 +0000 (23:59 -0700)] 
openat2: set HAVE_OPENAT2=0 if openat2 is missing

* m4/openat2.m4 (gl_FUNC_OPENAT2): The recent ‘fcntl-h: glibc now
has openat2’ patch changed HAVE_OPENAT2’s default to 1.  Adjust to
this here by setting it to 0 when openat2 is not found, rather than
setting it to 1 when it is found.

5 weeks agofaccessat: simplify latest change
Paul Eggert [Tue, 16 Jun 2026 19:08:19 +0000 (12:08 -0700)] 
faccessat: simplify latest change

Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00065.html
* lib/faccessat.c (LSTAT_FOLLOWS_SLASHED_SYMLINK): Remove.
(rpl_faccessat): Assume it’s false.

5 weeks agodoc: document AT_EMPTY_PATH glitches
Paul Eggert [Tue, 16 Jun 2026 16:46:38 +0000 (09:46 -0700)] 
doc: document AT_EMPTY_PATH glitches

5 weeks agofchownat: don’t mishandle AT_EMPTY_PATH
Paul Eggert [Tue, 16 Jun 2026 16:46:20 +0000 (09:46 -0700)] 
fchownat: don’t mishandle AT_EMPTY_PATH

This has the same motivation as the recent fchmodat change.
* lib/fchownat.c (AT_EMPTY_PATH): Default to 0.
(FCHOWNAT_EMPTY_FILENAME_BUG): Remove; no longer needed.
(rpl_fchownat): Do not mishandle AT_EMPTY_PATH if specified
and if the underlying library+kernel supports it.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT):
Don’t define FCHOWNAT_EMPTY_FILENAME_BUG, as it is no longer needed.

5 weeks agofchmodat: don’t mishandle AT_EMPTY_PATH
Paul Eggert [Tue, 16 Jun 2026 16:46:03 +0000 (09:46 -0700)] 
fchmodat: don’t mishandle AT_EMPTY_PATH

This does not add support for AT_EMPTY_PATH on platforms lacking it.
It merely fixes bugs in handling AT_EMPTY_PATH on platforms
that already have AT_EMPTY_PATH.  This is complicated by
the fact that glibc may define AT_EMPTY_PATH even though the
underlying kernel lacks support for it, and by the fact that
in recent kernels, AT_EMPTY_PATH allows the file name to be
a null pointer.
* lib/fchmodat.c (AT_EMPTY_PATH): Default to 0.
(rpl_fchmodat): Do not mishandle AT_EMPTY_PATH if specified
and if the underlying library+kernel supports it.

5 weeks agofstatat etc.: fix wrong machine code for calls
Paul Eggert [Tue, 16 Jun 2026 16:45:39 +0000 (09:45 -0700)] 
fstatat etc.: fix wrong machine code for calls

Without this fix, compilers can generate incorrect machine code
for functions that call to fstatat-like functions, as the
compilers incorrectly assume that the calls’ arguments cannot be
null pointers.  This assumption became false with the release of
Linux kernel 6.11 (2024).
* lib/sys_stat.in.h (fchmodat, fstatat, utimensat):
* lib/unistd.in.h (faccessat, fchownat): Do not mark file args
with _GL_ARG_NONNULL, as the args are allowed to be null pointers
in Linux kernel 6.11+, possibly with glibc 2.41+ involved.

5 weeks agoeuidaccess-tests: link with test_euidaccess_LDADD
Paul Eggert [Tue, 16 Jun 2026 16:45:18 +0000 (09:45 -0700)] 
euidaccess-tests: link with test_euidaccess_LDADD

* modules/euidaccess-tests (test_euidaccess_LDADD):
New macro.  Needed for Solaris 10.

5 weeks agofaccessat: support "" and NULL file
Paul Eggert [Tue, 16 Jun 2026 16:44:54 +0000 (09:44 -0700)] 
faccessat: support "" and NULL file

* lib/faccessat.c (LSTAT_FOLLOWS_SLASHED_SYMLINK): Default to 0.
(rpl_faccessat): Don’t mishandle empty string, or null pointer for
that matter.  Also, do not call fstatat if
LSTAT_FOLLOWS_SLASHED_SYMLINK, as there is no need in that case.

5 weeks agofcntl-h: glibc now has openat2
Paul Eggert [Tue, 16 Jun 2026 16:44:25 +0000 (09:44 -0700)] 
fcntl-h: glibc now has openat2

* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): HAVE_OPENAT2 is now 1,
as glibc 2.43 (2026) supports it.

5 weeks agoopenat2: fix prereq typo
Paul Eggert [Tue, 16 Jun 2026 16:43:58 +0000 (09:43 -0700)] 
openat2: fix prereq typo

* modules/openat2 (configure.ac): Fix typo in spelling of prereq
for gl_PREREQ_OPENAT2.

5 weeks agosomehow lost x bit
Karl Berry [Tue, 16 Jun 2026 15:23:16 +0000 (08:23 -0700)] 
somehow lost x bit

5 weeks agoxstrtol tests: Fix link error on FreeBSD and macOS (regr. 2026-06-13).
Collin Funk [Tue, 16 Jun 2026 02:36:06 +0000 (19:36 -0700)] 
xstrtol tests: Fix link error on FreeBSD and macOS (regr. 2026-06-13).

* modules/xstrtol-tests (Makefile.am): Link the test programs to
$(LIBUNISTRING), $(MBRTOWC_LIB), and $(LIBC32CONV).
* modules/xstrtoimax-tests (Makefile.am): Likewise.
* modules/xstrtoumax-tests (Makefile.am): Likewise.
* modules/xstrtoll-tests (Makefile.am): Likewise. Use @LIBINTL@ instead
of $(LIBINTL).

5 weeks agolocaleconv: Fix compilation error on mingw (regression 2026-06-08).
Bruno Haible [Mon, 15 Jun 2026 22:22:16 +0000 (00:22 +0200)] 
localeconv: Fix compilation error on mingw (regression 2026-06-08).

* lib/locale.in.h (GNULIB_defined_localeconv): Define to 1, not empty.

5 weeks agoautoupdate
Karl Berry [Mon, 15 Jun 2026 13:31:40 +0000 (06:31 -0700)] 
autoupdate

5 weeks agoFix a typo in the previous ChangeLog entry.
Collin Funk [Sun, 14 Jun 2026 02:20:15 +0000 (19:20 -0700)] 
Fix a typo in the previous ChangeLog entry.

5 weeks agoxstrtol-error: Use quote() before print command line arguments.
Collin Funk [Fri, 12 Jun 2026 00:23:50 +0000 (17:23 -0700)] 
xstrtol-error: Use quote() before print command line arguments.

* lib/xstrtol-error.c: Include quote.h.
(xstrtol_error): Adjust the format strings and call quote() before
printing the argument.

6 weeks agostrerror: Detect invalid writes to the returned string in some cases.
Bruno Haible [Mon, 8 Jun 2026 09:46:56 +0000 (11:46 +0200)] 
strerror: Detect invalid writes to the returned string in some cases.

* lib/string.in.h (strerror): Change the return type to 'const char *'.
(GNULIB_defined_strerror): New macro.
* lib/strerror.c (strerror): Change the return type to 'const char *'.
* lib/strerror_l.c (errno_string_callback): Change a variable from
'char *' to 'const char *'.
* lib/strerror_r.c (strerror_r): Likewise.
* doc/posix-functions/strerror.texi: Document that Gnulib uses the
return type 'const char *'.
* NEWS: Mention the change.
* m4/perror.m4 (gl_FUNC_PERROR): Change a variable from 'char *' to
'const char *'.
* m4/strerror.m4 (gl_FUNC_STRERROR_0): Likewise.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Likewise.
* tests/test-strerror.c (strerror): Update expected signature.
(main): Change a variable from 'char *' to 'const char *'.
* tests/test-string-h-c++.cc (GNULIB_NAMESPACE::strerror): Update
expected signature.

6 weeks agolocaleconv: Detect invalid writes to the returned struct in some cases.
Bruno Haible [Mon, 8 Jun 2026 10:57:03 +0000 (12:57 +0200)] 
localeconv: Detect invalid writes to the returned struct in some cases.

* lib/locale.in.h (localeconv): Change the return type to
'const struct lconv *'.
(GNULIB_defined_localeconv): New macro.
* lib/localeconv.c (localeconv): Change the return type to
'const struct lconv *'. Change a variable from 'struct lconv *' to
'const struct lconv *'.
* doc/posix-functions/localeconv.texi: Document that Gnulib uses the
return type 'const struct lconv *'.
* NEWS: Mention the change.
* m4/localeconv.m4 (gl_FUNC_LOCALECONV): Change a variable from
'struct lconv *' to 'const struct lconv *'.
* tests/test-localeconv.c (localeconv): Update expected signature.
(main): Change a variable from 'struct lconv *' to
'const struct lconv *'.
* tests/test-locale-h-c++.cc (GNULIB_NAMESPACE::localeconv): Update
expected signature.

6 weeks agosetlocale: Avoid a portability pitfall through the last patch.
Bruno Haible [Mon, 8 Jun 2026 14:01:36 +0000 (16:01 +0200)] 
setlocale: Avoid a portability pitfall through the last patch.

* lib/locale.in.h (setlocale): Cast the return value to 'const char *'
on the other platforms.
* NEWS: Update.

6 weeks agoreadlinkat: document GNU/Linux "" divergence
Paul Eggert [Sun, 7 Jun 2026 19:11:49 +0000 (12:11 -0700)] 
readlinkat: document GNU/Linux "" divergence

6 weeks agosetlocale: Detect invalid writes to the returned string in some cases.
Bruno Haible [Sun, 7 Jun 2026 12:57:38 +0000 (14:57 +0200)] 
setlocale: Detect invalid writes to the returned string in some cases.

* lib/locale.in.h (setlocale): Change the return type to 'const char *'.
* lib/setlocale.c (setlocale_mtsafe, setlocale_unixlike): Change the
return type to 'const char *'. Remove a cast.
(setlocale_single): Change the return type to 'const char *'.
(setlocale_improved): Change the return type to 'const char *'. Change
three variables from 'char *' to 'const char *'. Add local variable
old_locale.
* lib/localcharset.c (locale_charset): Change two variables from
'char *' to 'const char *'.
* doc/posix-functions/setlocale.texi: Document that Gnulib uses the
return type 'const char *'.
* NEWS: Mention the change.
* m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Change a variable from 'char *'
to 'const char *'.
* m4/mbrtoc32.m4 (gl_MBRTOC32_C_LOCALE, gl_MBRTOC32_UTF8_LOCALE):
Likewise.
* m4/mbrtoc16.m4 (gl_MBRTOC16_C_LOCALE): Likewise.
* tests/test-setlocale-w32utf8.c (main): Likewise.
* tests/test-setlocale1.c (setlocale): Update expected signature.
* tests/test-locale-h-c++.cc (GNULIB_NAMESPACE::setlocale): Likewise.

6 weeks agotests: Avoid conflict between mingw standard C++ library and Gnulib.
Bruno Haible [Sun, 7 Jun 2026 12:50:49 +0000 (14:50 +0200)] 
tests: Avoid conflict between mingw standard C++ library and Gnulib.

* doc/multithread.texi (Gnulib multithreading): Document an
incompatibility.
* tests/test-assert-h-c++.cc: Skip the standard C++ library on mingw,
when configured with --enable-threads=windows.
* tests/test-assert-h-c++2.cc: Likewise.
* tests/test-endian-c++.cc: Likewise.
* tests/test-nullptr-c++.cc: Likewise.
* tests/test-stdalign-h-c++.cc: Likewise.
* tests/test-stdbit-h-c++.cc: Likewise.
* tests/test-wchar-h-c++3.cc: Likewise.

6 weeks agointprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).
Bruno Haible [Sun, 7 Jun 2026 10:27:28 +0000 (12:27 +0200)] 
intprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).

* lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Set to 0 on MSVC in
C++ mode.
* lib/stdbit.in.h (_GL_STDBIT_TYPEOF_CAST): Don't use __typeof__ on MSVC
in C++ mode.

6 weeks agombrtowc: Fix handling of s==NULL on all possible platforms.
Bruno Haible [Sat, 6 Jun 2026 19:04:18 +0000 (21:04 +0200)] 
mbrtowc: Fix handling of s==NULL on all possible platforms.

* lib/mbrtowc.c (rpl_mbrtowc): Enable the s==NULL test also on platforms
that define only MBRTOWC_NUL_RETVAL_BUG or
MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ.

6 weeks agombrtoc32: fix ChangeLog typo
Paul Eggert [Sat, 6 Jun 2026 17:41:07 +0000 (10:41 -0700)] 
mbrtoc32: fix ChangeLog typo

Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00018.html

6 weeks agoquotearg: fix ChangeLog typo
Paul Eggert [Fri, 5 Jun 2026 18:33:15 +0000 (11:33 -0700)] 
quotearg: fix ChangeLog typo

Problem reported by Pavel Cahyna in
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00015.html

7 weeks agombrtowc: Work around a NetBSD bug in UTF-8 locales, part 2.
Bruno Haible [Tue, 2 Jun 2026 20:17:38 +0000 (22:17 +0200)] 
mbrtowc: Work around a NetBSD bug in UTF-8 locales, part 2.

* m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): Also set REPLACE_MBSRTOWCS
to 1 if gl_MBRTOWC_INVALID_UTF8 reports "no".
* m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Also set REPLACE_MBSNRTOWCS
to 1 if gl_MBRTOWC_INVALID_UTF8 reports "no".

7 weeks agoc32width etc.: Fix compilation error on GNU systems (regr. 2026-04-24).
Bruno Haible [Tue, 2 Jun 2026 19:16:31 +0000 (21:16 +0200)] 
c32width etc.: Fix compilation error on GNU systems (regr. 2026-04-24).

* lib/uchar.in.h: Do include <wchar.h> when any of the modules c32width,
c32snrtombs, c32srtombs, c32swidth, mbsnrtoc32s, mbsrtoc32s is in use.

7 weeks agoautoupdate
Karl Berry [Tue, 2 Jun 2026 14:43:36 +0000 (07:43 -0700)] 
autoupdate

7 weeks agombrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).
Bruno Haible [Tue, 2 Jun 2026 12:14:09 +0000 (14:14 +0200)] 
mbrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).

* lib/mbrtowc.c (rpl_mbrtowc): Fix botched condition for the n==0 case.

7 weeks agombrtowc, mbrlen: Work around a NetBSD bug in UTF-8 locales.
Bruno Haible [Tue, 2 Jun 2026 11:13:20 +0000 (13:13 +0200)] 
mbrtowc, mbrlen: Work around a NetBSD bug in UTF-8 locales.

* m4/mbrtowc.m4 (gl_MBRTOWC_INVALID_UTF8): New macro.
(gl_FUNC_MBRTOWC): Invoke it. Define MBRTOWC_INVALID_UTF8_BUG if mbrtowc
does not recognize some invalid UTF-8 byte sequences.
* lib/mbrtowc.c (is_locale_utf8, is_locale_utf8_cached): Define also if
MBRTOWC_INVALID_UTF8_BUG.
(rpl_mbrtowc): Handle UTF-8 locales specially also on NetBSD.
* tests/test-mbrtowc.c (main): Add more test cases for the UTF-8
encoding.
* tests/test-mbrlen.c (main): Likewise.
* doc/posix-functions/mbrtowc.texi: Mention the NetBSD bug.
* doc/posix-functions/mbrlen.texi: Likewise.