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

Oops, this causes a compilation error on FreeBSD and OpenBSD.

This patch fixes it:


2026-07-13  Bruno Haible  <[email protected]>

        vasnprintf: Fix compilation error on FreeBSD, OpenBSD (regr. today).
        * lib/vasnprintf.c (THOUSEP_MAXLEN): Define always.

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index bd0c0d6c98..63e59562b4 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -576,6 +576,13 @@ thousands_separator_wchar (wchar_t stackbuf[10])
    separator.  */
 #define THOUSEP_WCHAR_MAXLEN 1
 
+/* Maximum number of units needed for a thousands separator.  */
+#if WIDE_CHAR_VERSION
+# define THOUSEP_MAXLEN THOUSEP_WCHAR_MAXLEN
+#else
+# define THOUSEP_MAXLEN THOUSEP_CHAR_MAXLEN
+#endif
+
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) || 
(NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || 
NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT)
 # ifndef grouping_rule_defined
 #  define grouping_rule_defined 1
@@ -1891,13 +1898,6 @@ is_borderline (const char *digits, size_t precision)
 #  define MAX_ROOM_NEEDED max_room_needed
 # endif
 
-/* Maximum number of units needed for a thousands separator.  */
-# if WIDE_CHAR_VERSION
-#  define THOUSEP_MAXLEN THOUSEP_WCHAR_MAXLEN
-# else
-#  define THOUSEP_MAXLEN THOUSEP_CHAR_MAXLEN
-# endif
-
 /* Returns the number of TCHAR_T units needed as temporary space for the result
    of sprintf or SNPRINTF of a single conversion directive.  */
 static size_t




Reply via email to