From: Viktor Szakats Date: Tue, 13 Jan 2026 12:44:43 +0000 (+0100) Subject: tests/server: use `CURL_PRINTF()`, drop `-Wformat-nonliteral` workaround X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80739fa89de144fdef1b9c9e87ce11ea287dcafa;p=thirdparty%2Fcurl.git tests/server: use `CURL_PRINTF()`, drop `-Wformat-nonliteral` workaround Closes #20286 --- diff --git a/tests/server/first.h b/tests/server/first.h index 49d5b89aaa..0d0dc30a0e 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -126,7 +126,7 @@ extern int getpart(char **outbuf, size_t *outlen, /* utility functions */ extern char *data_to_hex(char *data, size_t len); -extern void logmsg(const char *msg, ...); +extern void logmsg(const char *msg, ...) CURL_PRINTF(1, 2); extern void loghex(unsigned char *buffer, ssize_t len); extern int win32_init(void); extern FILE *test2fopen(long testno, const char *logdir2); diff --git a/tests/server/util.c b/tests/server/util.c index 276c54dba5..e1cc138d18 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -111,14 +111,7 @@ void logmsg(const char *msg, ...) now.tm_hour, now.tm_min, now.tm_sec, (long)tv.tv_usec); va_start(ap, msg); -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wformat-nonliteral" -#endif vsnprintf(buffer, sizeof(buffer), msg, ap); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif va_end(ap); do {