mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Greatly improve printf format-string checking.
I've added the gcc-style attribute("printf") to a lot of printf-shaped functions in this code base that didn't have it. To make that easier, I moved the wrapping macro into defs.h, and also enabled it if we detect the __clang__ macro as well as __GNU__ (hence, it will be used when building for Windows using clang-cl). The result is that a great many format strings in the code are now checked by the compiler, where they were previously not. This causes build failures, which I'll fix in the next commit.
This commit is contained in:
@ -308,8 +308,9 @@ void pageant_unregister_client(PageantClient *pc)
|
||||
sfree(pc->info);
|
||||
}
|
||||
|
||||
static void failure(PageantClient *pc, PageantClientRequestId *reqid,
|
||||
strbuf *sb, const char *fmt, ...)
|
||||
static PRINTF_LIKE(4, 5) void failure(PageantClient *pc,
|
||||
PageantClientRequestId *reqid,
|
||||
strbuf *sb, const char *fmt, ...)
|
||||
{
|
||||
strbuf_clear(sb);
|
||||
put_byte(sb, SSH_AGENT_FAILURE);
|
||||
|
Reference in New Issue
Block a user