From 6e86fffc5e5780c209f52986be4f150b16b96d29 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Oct 2016 15:15:33 +1030 Subject: [PATCH 1/1] foreach: fixed maybe uninitialized warning in test (-O2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit /home/rusty/devel/cvs/ccan/ccan/tap/tap.h:57:59: warning: ‘max_iters’ may be used uninitialized in this function [-Wmaybe-uninitialized] _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ ^ /home/rusty/devel/cvs/ccan/ccan/foreach/test/run-nested.c:47:17: note: ‘max_iters’ was declared here int i, j, sum, max_iters; Signed-off-by: Rusty Russell --- ccan/foreach/test/run-nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/foreach/test/run-nested.c b/ccan/foreach/test/run-nested.c index aa20437e..0bb21c98 100644 --- a/ccan/foreach/test/run-nested.c +++ b/ccan/foreach/test/run-nested.c @@ -44,7 +44,7 @@ static int count_iters(void) int main(void) { - int i, j, sum, max_iters; + int i, j, sum, max_iters = 0 /* keep gcc happy */; const char *istr, *jstr; plan_tests(13); -- 2.39.2