From e589d16bb2fd92366c02217d5ba6ca6a77ac3515 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Oct 2016 14:37:00 +1030 Subject: [PATCH] cdump: fix uninitialized warning with optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit /home/rusty/devel/cvs/ccan/ccan/cdump/cdump.c: In function ‘get_type’: /home/rusty/devel/cvs/ccan/ccan/strmap/strmap.h:88:39: warning: ‘m’ may be used uninitialized in this function [-Wmaybe-uninitialized] tcon_cast((map), canary, strmap_get_(&(map)->raw, (member))) ^ /home/rusty/devel/cvs/ccan/ccan/cdump/cdump.c:216:20: note: ‘m’ was declared here cdump_map_t *m; ^ Signed-off-by: Rusty Russell --- ccan/cdump/cdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/cdump/cdump.c b/ccan/cdump/cdump.c index 85c818a6..7e42dbd7 100644 --- a/ccan/cdump/cdump.c +++ b/ccan/cdump/cdump.c @@ -213,7 +213,7 @@ static struct cdump_type *get_type(struct cdump_definitions *defs, enum cdump_type_kind kind, const char *name) { - cdump_map_t *m; + cdump_map_t *m = (void *)0x1L; /* Shouldn't be used */ struct cdump_type *t; switch (kind) { -- 2.39.2