File 0001-util-add-PRINTF-to-xavsprintf_append-definition.patch of Package mingw64-dtc
From 6e8f1190393d9b62c3acc6cedbb1c52af8b3bef2 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Sat, 3 Jan 2026 12:50:34 +0100
Subject: [PATCH 1/2] util: add PRINTF to xavsprintf_append definition
In dtc v1.7.2, xavsprintf_append() is declared with PRINTF()
in util.h, but its definition in util.c lacks the attribute.
This causes GCC (notably MinGW/UCRT) to emit
-Wsuggest-attribute=format warnings which become fatal
when -Werror is enabled.
Add the missing PRINTF attribute to the definition.
---
util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/util.c b/util.c
index 4125923..033b3bc 100644
--- a/util.c
+++ b/util.c
@@ -60,6 +60,7 @@ char *xstrndup(const char *s, size_t n)
return d;
}
+PRINTF(2, 0)
int xavsprintf_append(char **strp, const char *fmt, va_list ap)
{
int n, size = 0; /* start with 128 bytes */
--
2.51.0