build: more -Wformat fixes

- memdebug: update to not trigger `-Wformat-nonliteral` warnings.
- imap: mark `imap_sendf()` with  `CURL_PRINTF()`.
- tool_msgs: mark static function with `CURL_PRINTF()`.

Follow-up to 3829759bd0 #12489

Closes #12540
This commit is contained in:
Viktor Szakats 2023-12-16 17:23:40 +00:00
parent 03e7dff8ff
commit 0923012758
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 21 additions and 66 deletions

View file

@ -36,6 +36,11 @@
#define NOTE_PREFIX "Note: "
#define ERROR_PREFIX "curl: "
static void voutf(struct GlobalConfig *config,
const char *prefix,
const char *fmt,
va_list ap) CURL_PRINTF(3, 0);
static void voutf(struct GlobalConfig *config,
const char *prefix,
const char *fmt,
@ -107,7 +112,6 @@ void notef(struct GlobalConfig *config, const char *fmt, ...)
* Emit warning formatted message on configured 'errors' stream unless
* mute (--silent) was selected.
*/
void warnf(struct GlobalConfig *config, const char *fmt, ...)
{
va_list ap;
@ -115,6 +119,7 @@ void warnf(struct GlobalConfig *config, const char *fmt, ...)
voutf(config, WARN_PREFIX, fmt, ap);
va_end(ap);
}
/*
* Emit help formatted message on given stream. This is for errors with or
* related to command line arguments.