From c5ee905c92570a3f833744a841a6ece221dddf40 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 5 Nov 2018 11:39:41 +1030 Subject: [PATCH] gossipwith: correctly replace all ccan/io operations in handshake.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is kind of a hack, but let's make it a complete hack. GCC with -flto noticed we use different definitions of 'struct io_conn' here and gave the warning: ccan/ccan/io/io.h:620:17: warning: type of ‘io_close’ does not match original declaration [-Wlto-type-mismatch] struct io_plan *io_close(struct io_conn *conn); ^ ccan/ccan/io/io.c:449:17: note: ‘io_close’ was previously declared here struct io_plan *io_close(struct io_conn *conn) ^ ccan/ccan/io/io.c:449:17: note: code may be misoptimized unless -fno-strict-aliasing is used Signed-off-by: Rusty Russell --- devtools/gossipwith.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devtools/gossipwith.c b/devtools/gossipwith.c index 8c6e42abd..58a3eb4a6 100644 --- a/devtools/gossipwith.c +++ b/devtools/gossipwith.c @@ -13,6 +13,7 @@ #define io_write_ simple_write #define io_read_ simple_read +#define io_close simple_close static struct io_plan *simple_write(struct io_conn *conn, const void *data, size_t len, @@ -24,6 +25,11 @@ static struct io_plan *simple_read(struct io_conn *conn, struct io_plan *(*next)(struct io_conn *, void *), void *next_arg); +static struct io_plan *simple_close(struct io_conn *conn) +{ + return NULL; +} + #include "../connectd/handshake.c" /* This makes the handshake prototypes work. */