mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -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:
@ -705,8 +705,8 @@ static void share_remove_forwarding(struct ssh_sharing_connstate *cs,
|
||||
sfree(fwd);
|
||||
}
|
||||
|
||||
static void log_downstream(struct ssh_sharing_connstate *cs,
|
||||
const char *logfmt, ...)
|
||||
static PRINTF_LIKE(2, 3) void log_downstream(struct ssh_sharing_connstate *cs,
|
||||
const char *logfmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
@ -719,8 +719,8 @@ static void log_downstream(struct ssh_sharing_connstate *cs,
|
||||
sfree(buf);
|
||||
}
|
||||
|
||||
static void log_general(struct ssh_sharing_state *sharestate,
|
||||
const char *logfmt, ...)
|
||||
static PRINTF_LIKE(2, 3) void log_general(struct ssh_sharing_state *sharestate,
|
||||
const char *logfmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
|
Reference in New Issue
Block a user