From e3c4bdf2098a6b59d7600a3a9dbb32e82b3503fc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 4 Apr 2024 14:06:11 +1030 Subject: [PATCH] renepay: fix gcc -O3 overzealous warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0 with -O3 gives: ``` In file included from plugins/renepay/test/../mcf.c:5, from plugins/renepay/test/run-arc.c:13: ccan/ccan/tal/str/str.h: In function ‘minflow’: ccan/ccan/tal/str/str.h:43:9: error: ‘errmsg’ may be used uninitialized [-Werror=maybe-uninitialized] 43 | tal_fmt_(ctx, TAL_LABEL(char, "[]"), __VA_ARGS__) | ^~~~~~~~ plugins/renepay/test/../mcf.c:1565:15: note: ‘errmsg’ was declared here 1565 | char *errmsg; | ^~~~~~ cc1: all warnings being treated as errors ``` Signed-off-by: Rusty Russell --- plugins/renepay/mcf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/renepay/mcf.c b/plugins/renepay/mcf.c index deea4d66c..ecf344794 100644 --- a/plugins/renepay/mcf.c +++ b/plugins/renepay/mcf.c @@ -1451,6 +1451,8 @@ get_flow_paths(const tal_t *ctx, const struct gossmap *gossmap, flows[i] = tal_steal(flows,flows[i]); assert(flows[i]); } + if (fail) + *fail = NULL; tal_free(this_ctx); return flows;