From 1b851758bd02c03fa9ae1736bc2646ac46d81df0 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 3 Sep 2022 11:43:46 +0100 Subject: [PATCH] Add some missing #includes. My experimental build with clang-cl at -Wall did show up a few things that are safe enough to fix right now. One was this list of missing includes, which was causing a lot of -Wmissing-prototype warnings, and is a real risk because it means the declarations in headers weren't being type-checked against the actual function definitions. Happily, no actual mismatches. --- cmake/gitcommit.cmake | 1 + keygen/mpunsafe.c | 1 + psocks.c | 1 + utils/x11_dehexify.c | 1 + utils/x11_identify_auth_proto.c | 1 + utils/x11_parse_ip.c | 1 + windows/no-jump-list.c | 2 ++ windows/plink.c | 1 + windows/utils/arm_arch_queries.c | 1 + windows/utils/minefield.c | 1 + windows/utils/platform_get_x_display.c | 1 + windows/window.c | 1 + 12 files changed, 13 insertions(+) diff --git a/cmake/gitcommit.cmake b/cmake/gitcommit.cmake index adb644bc..0aa8a095 100644 --- a/cmake/gitcommit.cmake +++ b/cmake/gitcommit.cmake @@ -45,6 +45,7 @@ if(OUTPUT_TYPE STREQUAL header) * Generated by cmake/gitcommit.cmake. */ +#include \"putty.h\" const char commitid[] = \"${commit}\"; ") elseif(OUTPUT_TYPE STREQUAL halibut) diff --git a/keygen/mpunsafe.c b/keygen/mpunsafe.c index 6265d40f..2cd7a37a 100644 --- a/keygen/mpunsafe.c +++ b/keygen/mpunsafe.c @@ -7,6 +7,7 @@ #include "puttymem.h" #include "mpint.h" +#include "mpunsafe.h" #include "crypto/mpint_i.h" /* diff --git a/psocks.c b/psocks.c index 64c46953..eb7c8f01 100644 --- a/psocks.c +++ b/psocks.c @@ -7,6 +7,7 @@ #include #include "putty.h" +#include "storage.h" #include "misc.h" #include "ssh.h" #include "ssh/channel.h" diff --git a/utils/x11_dehexify.c b/utils/x11_dehexify.c index 13ffb0d0..080f8c91 100644 --- a/utils/x11_dehexify.c +++ b/utils/x11_dehexify.c @@ -4,6 +4,7 @@ */ #include "putty.h" +#include "ssh.h" void *x11_dehexify(ptrlen hexpl, int *outlen) { diff --git a/utils/x11_identify_auth_proto.c b/utils/x11_identify_auth_proto.c index 14075a3f..46e26dc0 100644 --- a/utils/x11_identify_auth_proto.c +++ b/utils/x11_identify_auth_proto.c @@ -4,6 +4,7 @@ */ #include "putty.h" +#include "ssh.h" int x11_identify_auth_proto(ptrlen protoname) { diff --git a/utils/x11_parse_ip.c b/utils/x11_parse_ip.c index 12649b49..8f6a7bfb 100644 --- a/utils/x11_parse_ip.c +++ b/utils/x11_parse_ip.c @@ -6,6 +6,7 @@ #include #include "putty.h" +#include "ssh.h" bool x11_parse_ip(const char *addr_string, unsigned long *ip) { diff --git a/windows/no-jump-list.c b/windows/no-jump-list.c index 7c76f668..beabd107 100644 --- a/windows/no-jump-list.c +++ b/windows/no-jump-list.c @@ -3,6 +3,8 @@ * that don't update the jump list. */ +#include "putty.h" + void add_session_to_jumplist(const char * const sessionname) {} void remove_session_from_jumplist(const char * const sessionname) {} void clear_jumplist(void) {} diff --git a/windows/plink.c b/windows/plink.c index 4ae6cf4d..05c25073 100644 --- a/windows/plink.c +++ b/windows/plink.c @@ -8,6 +8,7 @@ #include #include "putty.h" +#include "ssh.h" #include "storage.h" #include "tree234.h" #include "security-api.h" diff --git a/windows/utils/arm_arch_queries.c b/windows/utils/arm_arch_queries.c index b683ac15..b0193276 100644 --- a/windows/utils/arm_arch_queries.c +++ b/windows/utils/arm_arch_queries.c @@ -4,6 +4,7 @@ */ #include "putty.h" +#include "ssh.h" #if !(defined _M_ARM || defined _M_ARM64) /* diff --git a/windows/utils/minefield.c b/windows/utils/minefield.c index de4d4836..c5262ae6 100644 --- a/windows/utils/minefield.c +++ b/windows/utils/minefield.c @@ -11,6 +11,7 @@ */ #include "putty.h" +#include "puttymem.h" #define PAGESIZE 4096 diff --git a/windows/utils/platform_get_x_display.c b/windows/utils/platform_get_x_display.c index b3d11afc..e2a9ddc6 100644 --- a/windows/utils/platform_get_x_display.c +++ b/windows/utils/platform_get_x_display.c @@ -4,6 +4,7 @@ */ #include "putty.h" +#include "ssh.h" char *platform_get_x_display(void) { diff --git a/windows/window.c b/windows/window.c index 99acdbf2..059a123c 100644 --- a/windows/window.c +++ b/windows/window.c @@ -14,6 +14,7 @@ #define COMPILE_MULTIMON_STUBS #include "putty.h" +#include "ssh.h" #include "terminal.h" #include "storage.h" #include "putty-rc.h"