From: Eduard Bagdasaryan Date: Tue, 14 Feb 2023 16:25:32 +0000 (+0000) Subject: Enable compiler checks for printf-like SBuf methods (#1270) X-Git-Tag: SQUID_6_0_1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=543bff1002fb4b1b15d4a8f6cccec597e158b98b;p=thirdparty%2Fsquid.git 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(). --- 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