1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2026-10-24 00:48:56 +03:00

3318 Commits

Author SHA1 Message Date
Bruno Haible
58021cbbb0 all: Update URLs to msdn.microsoft.com or docs.microsoft.com.
* lib/stat-w32.c et al.: Update URLs after docs.microsoft.com was moved
to learn.microsoft.com.
2026-10-07 17:05:11 +02:00
Bruno Haible
d89ea630c1 getdomainname: Document situation on Solaris 11.4.
* doc/glibc-functions/getdomainname.texi: Update regarding Solaris 11.4.
2026-10-06 14:52:13 +02:00
Paul Eggert
2ef9434ffc tzset: document revs of angle bracket support 2026-10-01 11:54:48 -07:00
Bruno Haible
c30f8e7910 time_r: Work around localtime_r problem on native Windows.
* m4/time_r.m4 (gl_TIME_R): On native Windows, set REPLACE_LOCALTIME_R
to 1 always.
* modules/time_r (Depends-on): Add localtime.
* doc/posix-functions/localtime_r.texi: Mention localtime_r problem on
native Windows.
* doc/posix-functions/gmtime_r.texi: Update.
2026-10-01 17:24:38 +02:00
Paul Eggert
b8ce8f38ae Document NetBSD 11.0 bug <https://bugs.gnu.org/81923> 2026-09-26 10:03:43 -07:00
Bruno Haible
9341648bc1 aligned_alloc: Document "clang -fsanitize=scudo" bug.
Reported by <gnulib@mifar.in> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-09/msg00097.html>.

* doc/posix-functions/aligned_alloc.texi: Mention the Scudo issue.
2026-09-23 23:37:26 +02:00
Bruno Haible
83475b457a wctob: Fix parameter type on mingw.
* m4/wctob.m4 (gl_FUNC_WCTOB): If the gnulib headers override wint_t,
set REPLACE_WCTOB.
* modules/wctob (Files): Add wint_t.m4.
* doc/posix-functions/wctob.texi: Mention the problem on newer mingw.
2026-09-20 19:41:15 +02:00
Bruno Haible
774da35a3f mbrtoc32: Fix test-c32isprint failure on NetBSD 11.
* lib/mbrtoc32.c (mbrtoc32)
[HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4]:
In the C locale, map 0x80..0xFF differently.
* lib/btoc32.c (btoc32)
[HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4]:
Likewise.
* lib/c32is-impl.h (FUNC): Update comments.
* lib/c32to-impl.h (FUNC): Likewise.
* lib/c32width.c (c32width): Likewise.
* doc/posix-functions/mbrtoc32.texi: Mention the NetBSD problem.
2026-09-16 01:55:35 +02:00
Paul Eggert
3df54a5c85 mbrtoc32: also protect high-bit bytes when EILSEQ
I ran into some problems with GNU sed on NetBSD and
endeavored to fix some of them by altering the mbrtoc32 replacement,
so that in the C locale it always converts bytes with the top
bit set to 0xDFxx, instead of doing it only sometimes.
This patch also updates commentary to match current POSIX standards
and some newer OS releases.
* lib/mbrtoc32.c (mbrtoc32): Also convert (e.g.) 0xED to 0xDFED
when !GNULIB_defined_mbstate_t && HAVE_WORKING_MBRTOC32 &&
HAVE_WORKING_C32RTOMB && !MBRTOC32_MULTIBYTE_LOCALE_BUG &&
MBRTOC32_IN_C_LOCALE_MAYBE_EILSEQ.
* tests/test-mbrtoc16.c (main):
* tests/test-mbrtoc32.c (main):
Simplify, now that we always do that conversion.
2026-09-13 23:30:56 -07:00
Paul Eggert
6ae781d780 doc: bring pipe2 and dup3 doc up-to-date
macOS 27 will introduce pipe2 and looks like Apple thought
about also introducing dup3 but didn't pull the trigger.
Also, mention some other platforms.
2026-09-13 00:02:58 -07:00
Paul Eggert
9b87a88f38 doc: document FreeBSD etc issues with EUC
Problem inferred from a bug report by Bruno Haible in:
https://lists.gnu.org/r/sed-devel/2026-09/msg00002.html
2026-09-11 14:52:35 -07:00
Ineiev
492bdaf8ea Update copyright notice, per bug-standards@gnu.org
* doc/maintain.texi:
* doc/standards.texi: Update copyright years.
Copyright-paperwork-exempt: Yes
2026-09-09 07:21:17 +00:00
Bruno Haible
831a3ba4b7 Document possible *printf crash on mingw.
* doc/posix-functions/*printf.texi: Document the mingw multithreading
bug.
2026-09-03 01:23:29 +02:00
Bruno Haible
27353a8efc mbrtoc32: Make c32isprint compatible with isprint in the C locale.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-08/msg00222.html>.

* m4/mbrtoc32.m4 (gl_MBRTOC32_C_LOCALE_LIKE_ISO_8859): New macro.
(gl_FUNC_MBRTOC32): Define MBRTOC32_IN_C_LOCALE_MAYBE_LIKE_ISO_8859 and
set REPLACE_MBRTOC32 on platforms such as OpenBSD.
* lib/mbrtoc32.c (mbrtoc32) [MBRTOC32_IN_C_LOCALE_MAYBE_LIKE_ISO_8859]:
In the C locale, map 0x80..0xFF differently.
* lib/btoc32.c (btoc32) [MBRTOC32_IN_C_LOCALE_MAYBE_LIKE_ISO_8859]:
Likewise.
* doc/posix-functions/mbrtoc32.texi: Mention the OpenBSD problem.
2026-08-28 01:42:38 +02:00
Paul Eggert
a9fa600521 gettext-h: always define textdomain
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-08/msg00288.html
* lib/gettext.h (textdomain, bindtextdomain, bind_textdomain_codeset)
[!ENABLE_NLS && __GNUC__ && !__clang__ && !__cplusplus]:
Define to no-ops in this case too.
Move the definition of _LIBGETTEXT_FUNCAST up one level of
ifdeffery so that it is defined for this case.
* tests/test-gettext-h.c (main) [!ENABLE_NLS]: Call textdomain,
reverting the previous change to this file.
2026-08-25 13:27:28 -07:00
Bruno Haible
b5cafd4a9e doc: Mention a wcsncat bug.
Reported by Lasse Collin in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-08/msg00213.html>.

* doc/posix-functions/wcsncat.texi: Mention a wcsncat bug.
2026-08-16 17:43:04 +02:00
Bruno Haible
78a859110f Add unit tests and doc for the %Lf large precision issue on Solaris.
* tests/test-vasnprintf-posix.c (test_function): Add a testcase for
"%.5119Lf".
* tests/test-vasprintf-posix.c (test_function): Likewise.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* doc/posix-functions/*printf.texi: Document the Solaris 11.4 bug.
2026-08-14 19:57:39 +02:00
Paul Eggert
ca3174cada doc: N3322 cautions
* doc/gnulib-readme.texi (Other portability assumptions):
Add cautions about other parts of N3322.
2026-07-31 18:25:11 -07:00
Paul Eggert
c9cab3b865 link, symlink: more errno portability issues
* doc/posix-functions/link.texi:
* doc/posix-functions/linkat.texi:
* doc/posix-functions/symlink.texi:
* doc/posix-functions/symlinkat.texi:
Document TZDB’s recent odyssey with hard and symlinks.  See:
https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O5Q2I3GLZIF6GEFZ3MDWRZKG4ENPJVFQ/
2026-07-31 10:55:58 -07:00
Paul Eggert
d289f02829 localename: add GNULIB_LOCALENAME_SINGLE_THREAD
If GNULIB_LOCALENAME_SINGLE_THREAD is defined,
omit locks in localename and getlocalename-related functions.
Useful for GNU grep; see <https://bugs.gnu.org/81515>.
* lib/getlocalename_l-unsafe.c, lib/getlocalename_l.c:
* lib/localename.c (USE_ISOC_AND_POSIX_THREADS, USE_ISOC_THREADS)
(USE_POSIX_THREADS, USE_WINDOWS_THREADS)
[GNULIB_LOCALENAME_SINGLE_THREAD]: Undef.
2026-07-29 15:19:58 -07:00
Paul Eggert
6f013454d4 malloc: port to current -m32 AddressSanitizer
Also, port better to non-glibc, and in documentation update the
list of platforms needing a fix.  This includes 32-bit platforms
using AddressSanitizer, unfortunately.
* m4/malloc.m4 (gl_CHECK_MALLOC_PTRDIFF): Invoke gl_MUSL_LIBC.
musl is safe, as is FreeBSD 11+, NetBSD 8+, OpenBSD 5.6+, AIX,
Microsoft Windows.  However, the AddressSanitizer is unsafe.
2026-07-27 15:09:35 -07:00
Bruno Haible
5f95a1f70e doc: Update for glibc 2.44.
* doc/posix-headers/*.texi: Update.
* doc/posix-functions/*.texi: Likewise.
2026-07-26 22:51:29 +02:00
Bruno Haible
9f5d6f6d27 doc: Update for glibc 2.43.
* doc/glibc-functions/mseal.texi: New file.
* doc/gnulib.texi (Glibc sys/mman.h): Include it.
* doc/posix-headers/*.texi: Update.
* doc/posix-functions/*.texi: Likewise.
2026-07-26 22:51:29 +02:00
Paul Eggert
cf2d119406 snprintf, vsnprintf: update doc
* doc/gnulib-intro.texi (Supported Platforms):
Also mention z/OS, Fil-C.  Not sure where they should be listed
but I gave it a guess.
* doc/posix-functions/snprintf.texi (snprintf):
* doc/posix-functions/vsnprintf.texi (vsnprintf):
Also mention Fil-C bug.
2026-07-26 13:49:58 -07:00
Paul Eggert
74ea50427f 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.
2026-07-17 10:50:44 -07:00
Bruno Haible
45b3ae7c4b 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.
2026-07-13 18:08:21 +02:00
Bruno Haible
138062683a doc: Fix typo.
* doc/posix-functions/readlinkat.texi: Fix typo in 2026-06-07 commit.
2026-07-12 18:43:19 +02:00
Paul Eggert
08c8a9228f 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.
2026-07-06 20:41:43 -07:00
Simon Josefsson
103c922f47 doc: Mention gnulib-202607 git bundle.
* doc/gnulib-git-bundle.texi: Update for 20270604 release.
2026-07-04 13:16:16 +02:00
Simon Josefsson
3c8246fd78 doc: Update regarding stable branches.
* doc/gnulib-readme.texi (Stable Branches): Mention new branch
stable-202607. Mention that stable-202507 is no longer updated.
2026-07-04 12:09:02 +02:00
Bruno Haible
1aa57024f7 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.
2026-06-26 18:02:41 +02:00
Bruno Haible
56040ffd2c doc: Add reference to NetBSD bug.
* doc/posix-functions/mbrtowc.texi: Add reference.
* doc/posix-functions/mbrlen.texi: Likewise.
2026-06-25 21:54:41 +02:00
Paul Eggert
dac89368df 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.
2026-06-18 13:42:43 -07:00
Bruno Haible
811183d827 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.
2026-06-18 11:42:21 +02:00
Paul Eggert
1f81c56bab openat2: mention module in manual 2026-06-17 06:41:43 -07:00
Paul Eggert
ed562a8bb1 doc: document AT_EMPTY_PATH glitches 2026-06-16 09:53:22 -07:00
Paul Eggert
586bd7e8d5 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.
2026-06-16 09:53:21 -07:00
Bruno Haible
88592a2880 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.
2026-06-08 16:10:42 +02:00
Bruno Haible
87b9d1e086 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.
2026-06-08 16:06:41 +02:00
Paul Eggert
8e3dedf74c readlinkat: document GNU/Linux "" divergence 2026-06-07 12:12:36 -07:00
Bruno Haible
8724b4400a 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.
2026-06-07 14:57:38 +02:00
Bruno Haible
a116d63eba 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.
2026-06-07 14:50:49 +02:00
Bruno Haible
6efaf33c52 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.
2026-06-02 13:13:20 +02:00
Paul Eggert
8a3d803160 manywarnings: deprecate -Whsa etc. too
-Whsa, -Wunreachable-code and -Wunsafe-loop-optimizations
are now ignored, so stop worrying about them too.
2026-05-28 17:51:33 -07:00
Paul Eggert
708c47b033 manywarnings: -Wstrict-overflow is deprecated
Issue reported by Drea Pinski in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101913#c6
* HACKING: Stop recommending -Wstrict-overflow.
* build-aux/g++-warning.spec:
* build-aux/gcc-warning.spec: Say -Wstrict-overflow is deprecated.
* doc/manywarnings.texi (manywarnings): Stop mentioning it.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Stop using it.
2026-05-28 13:27:01 -07:00
Bruno Haible
5c9941d169 fma: Work around glibc 2.43 regression.
* m4/fma.m4 (gl_FUNC_FMA_WORKS): Check against glibc 2.43 bug.
* doc/posix-functions/fma.texi: Mention glibc 2.43 as being buggy.
2026-05-27 19:08:46 +02:00
Bruno Haible
32b1ec06cd doc: Update for OpenBSD 7.9.
* doc/posix-headers/*.texi: Update.
* doc/pastposix-headers/*.texi: Update.
* doc/glibc-headers/*.texi: Likewise.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.
2026-05-22 12:13:51 +02:00
Bruno Haible
5df32c8bad thread-optim: Update documentation.
* doc/multithread.texi (Multithreading Optimizations): Update the
platforms list.
2026-05-17 08:46:47 +02:00
Bruno Haible
650a613616 stdc_bit_floor, stdc_bit_ceil: Work around Solaris 11 OpenIndiana bug.
* lib/stdbit.in.h (stdc_bit_floor, stdc_bit_ceil): Override the macro
definition from Solaris 11.
* doc/posix-functions/stdc_bit_floor.texi: Mention the Solaris 11
OpenIndiana bug.
* doc/posix-functions/stdc_bit_ceil.texi: Likewise.
2026-05-12 10:49:49 +02:00
Paul Eggert
cce9fdba3c Document Solaris 10 mmap etc. issues with caddr_t 2026-05-09 09:22:03 -07:00