+2026-07-26 Bruno Haible <bruno@clisp.org>
+
+ [v]szprintf: Improve port to Fil-C.
+ Suggested by Paul Eggert in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2026-07/msg00181.html>.
+ * lib/vasnprintf.c (USE_SNPRINTF): Define to 0 on Fil-C.
+ * lib/szprintf.c (szprintf): Revert last change.
+ * lib/vszprintf.c (vszprintf): Likewise.
+ * lib/unistdio/u-vsprintf.h (VSPRINTF): Likewise.
+
2026-07-26 Bruno Haible <bruno@clisp.org>
Pacify -fsanitize=address in rawmemchr, strchrnul also with clang < 22.
#include <stdio.h>
#include <errno.h>
-#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
size_t lenbuf = SIZE_MAX;
if (lenbuf >= ~ (uintptr_t) str)
lenbuf = ~ (uintptr_t) str;
-#if defined __FILC__
- if (lenbuf > INT_MAX)
- lenbuf = INT_MAX;
-#endif
char *output = vasnprintf (str, &lenbuf, format, args);
size_t len = lenbuf;
size_t length = (SIZE_MAX < INT_MAX ? SIZE_MAX : INT_MAX);
if (length > (~ (uintptr_t) buf) / sizeof (DCHAR_T))
length = (~ (uintptr_t) buf) / sizeof (DCHAR_T);
-#if defined __FILC__
- if (length > INT_MAX / sizeof (DCHAR_T))
- length = INT_MAX / sizeof (DCHAR_T);
-#endif
DCHAR_T *result = VASNPRINTF (buf, &length, format, args);
if (result == NULL)
|| (defined __APPLE__ && defined __MACH__) \
|| (defined __FreeBSD__ || defined __DragonFly__) \
|| defined __OpenBSD__ \
- || defined __ANDROID__ || defined _UCRT))
+ || defined __ANDROID__ || defined _UCRT) \
+ && !defined __FILC__)
# define USE_SNPRINTF 1
# else
# define USE_SNPRINTF 0
#include <stdio.h>
#include <errno.h>
-#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
size_t lenbuf = SIZE_MAX;
if (lenbuf >= ~ (uintptr_t) str)
lenbuf = ~ (uintptr_t) str;
-#if defined __FILC__
- if (lenbuf > INT_MAX)
- lenbuf = INT_MAX;
-#endif
char *output = vasnprintf (str, &lenbuf, format, args);
size_t len = lenbuf;