]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Enable compiler checks for printf-like SBuf methods (#1270)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 14 Feb 2023 16:25:32 +0000 (16:25 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 14 Feb 2023 16:35:21 +0000 (16:35 +0000)
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

index e88a07ded36120c878c2436acb616e08c8e2fb45..2844c3701160af4ea8e6a7af4709d4672365a27a 100644 (file)
@@ -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