+2023-03-17 Bruno Haible <bruno@clisp.org>
+
+ vasnwprintf: Fix test failure on OpenBSD.
+ * lib/vasnprintf.c (VASNPRINTF): Don't use the %n directive on OpenBSD.
+
2023-03-17 Bruno Haible <bruno@clisp.org>
time: Fix test failure on AIX 7.2.
|| ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
&& !defined __UCLIBC__) \
|| (defined __APPLE__ && defined __MACH__) \
+ || defined __OpenBSD__ \
|| defined __ANDROID__ \
|| (defined _WIN32 && ! defined __CYGWIN__))
/* We can avoid passing %n and instead rely on SNPRINTF's
- On macOS 10.13 or newer, the use of %n in format
strings in writable memory by default crashes the
program.
+ - On OpenBSD, since 2021-08-30, the use of %n in format
+ strings produces an abort (see
+ <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/vfprintf.c.diff?r1=1.79&r2=1.80&f=h>,
+ <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/vfwprintf.c.diff?r1=1.20&r2=1.21&f=h>).
- On Android, starting on 2018-03-07, the use of %n in
format strings produces a fatal error (see
<https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>).
crashes the program. See
<https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
- On the first three of these platforms, if !WIDE_CHAR_VERSION,
+ On the first four of these platforms, if !WIDE_CHAR_VERSION,
it is not a big deal to avoid %n, because on these platforms,
HAVE_SNPRINTF_RETVAL_C99 and HAVE_SNPRINTF_TRUNCATION_C99 are
1.