build: delete/replace clang warning pragmas

- delete redundant warning suppressions for `-Wformat-nonliteral`.
  This now relies on `CURL_PRINTF()` and it's theoratically possible
  that this macro isn't active but the warning is. We're ignoring this
  as a corner-case here.

- replace two pragmas with code changes to avoid the warnings.

Follow-up to aee4ebe591 #12803
Follow-up to 0923012758 #12540
Follow-up to 3829759bd0 #12489

Reviewed-by: Daniel Stenberg
Closes #12812
This commit is contained in:
Viktor Szakats 2024-01-27 17:40:38 +00:00
parent ecb5d6bee9
commit 5b286c2508
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
9 changed files with 5 additions and 87 deletions

View file

@ -448,14 +448,7 @@ void curl_dbg_log(const char *format, ...)
return;
va_start(ap, format);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif
nchars = mvsnprintf(buf, LOGLINE_BUFSIZE, format, ap);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
va_end(ap);
if(nchars > LOGLINE_BUFSIZE - 1)