From 799c55b4dd2577801208ca744574587b4c754bba Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 4 Jul 2026 22:39:37 -0400 Subject: [PATCH] Add `[[gnu::format(printf, 1, 2)]]` attribute to variadic function `sectError` --- src/asm/section.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asm/section.cpp b/src/asm/section.cpp index 7d6d5d70..90b86c48 100644 --- a/src/asm/section.cpp +++ b/src/asm/section.cpp @@ -121,7 +121,8 @@ static std::vector sectErrors; // `snprintf`; but passing `fmt` to `snprintf` triggers a `-Wformat-security` warning which we // can't prevent because GCC only supports the `[[gnu::format(printf, 1, 2)]]` attribute on // C-style variadic functions, not on variadic templates; so we have to use `vsnprintf`. -void sectError(char const *fmt, ...) { +[[gnu::format(printf, 1, 2)]] +static void sectError(char const *fmt, ...) { std::string result; va_list args1, args2; va_start(args1, fmt);