From 3d98ebbd7fda376c1d2ae6f6daa6389652ca0e55 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 8 Apr 2019 13:06:01 -0700 Subject: [PATCH] build: fix maybe-uninitialized error on some gcc versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on gcc (GCC) 7.4.0 devtools/create-gossipstore.c: In function ‘main’: devtools/create-gossipstore.c:107:9: error: ‘infd’ may be used uninitialized .. while (read_all(infd, &be_inlen, sizeof(be_inlen))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: William Casarin --- devtools/create-gossipstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/create-gossipstore.c b/devtools/create-gossipstore.c index ee426bc23..9f826f5b7 100644 --- a/devtools/create-gossipstore.c +++ b/devtools/create-gossipstore.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) struct amount_sat sat; bool verbose = false; char *infile = NULL, *outfile = NULL, *scidfile = NULL, *csat = NULL; - int infd, outfd; + int infd = 0, outfd; FILE * scidfd; struct scidsat * scids = NULL; unsigned max = -1U;