From: Rusty Russell Date: Mon, 4 Jul 2022 00:11:57 +0000 (+0930) Subject: ccan/rune: compile without warnings on -O3. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=8448fd2813c4a8bdeff08c739129c877204341a7;hp=7343770f9760cf95311ae0a835171ad8d3057f13 ccan/rune: compile without warnings on -O3. ``` ccan/ccan/rune/rune.c: In function ‘rune_alt_single_int’: ccan/ccan/rune/rune.c:257:5: error: ‘runeval_int’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 257 | if (cond) | ^ ccan/ccan/rune/rune.c:305:6: note: ‘runeval_int’ was declared here 305 | s64 runeval_int; | ^~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:919: ccan-rune-rune.o] Error 1 ``` Signed-off-by: Rusty Russell --- diff --git a/ccan/rune/rune.c b/ccan/rune/rune.c index 0ff7968b..84296c66 100644 --- a/ccan/rune/rune.c +++ b/ccan/rune/rune.c @@ -302,7 +302,7 @@ static const char *rune_alt_single(const tal_t *ctx, const s64 *fieldval_int) { char strfield[STR_MAX_CHARS(s64) + 1]; - s64 runeval_int; + s64 runeval_int = 0 /* gcc v9.4.0 gets upset with uninitiaized var at -O3 */; const char *err; /* Caller can't set both! */