From 543bff1002fb4b1b15d4a8f6cccec597e158b98b Mon Sep 17 00:00:00 2001 From: Eduard Bagdasaryan Date: Tue, 14 Feb 2023 16:25:32 +0000 Subject: [PATCH] Enable compiler checks for printf-like SBuf methods (#1270) After commit 0f17e25, these two are the only known printf()-like functions not already covered by these compiler checks. Some helper debugging hacks do not have PRINTF_FORMAT_ARG2 or similar attributes, but they are covered because their `__GNUC__` variants use standard fprintf(). --- src/sbuf/SBuf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbuf/SBuf.h b/src/sbuf/SBuf.h index e88a07ded3..2844c37011 100644 --- a/src/sbuf/SBuf.h +++ b/src/sbuf/SBuf.h @@ -211,13 +211,13 @@ public: * \note arguments may be evaluated more than once, be careful * of side-effects */ - SBuf& Printf(const char *fmt, ...); + SBuf& Printf(const char *fmt, ...) PRINTF_FORMAT_ARG2; /** Append operation with printf-style arguments * \note arguments may be evaluated more than once, be careful * of side-effects */ - SBuf& appendf(const char *fmt, ...); + SBuf& appendf(const char *fmt, ...) PRINTF_FORMAT_ARG2; /** Append operation, with vsprintf(3)-style arguments. * \note arguments may be evaluated more than once, be careful -- 2.47.3