From 036ae30df61b1c998e1aa027863ac2349a67066b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 11 Dec 2010 21:09:17 -0800 Subject: [PATCH] friedman: Fix GCC warning about uninitialized fr.w. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On my machine GCC 4.4 complains: friedman.c: In function ‘friedman_execute’: friedman.c:106: warning: ‘fr.w’ may be used uninitialized in this function This appears to be because GCC can't see that the assignment to fr.w and its later use (in show_sig_box()) both have the same condition. At any rate, this commit suppresses the warning by always initializing fr.w. --- src/language/stats/friedman.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/language/stats/friedman.c b/src/language/stats/friedman.c index 9711167b..9950543f 100644 --- a/src/language/stats/friedman.c +++ b/src/language/stats/friedman.c @@ -202,6 +202,8 @@ friedman_execute (const struct dataset *ds, fr.w /= pow2 (fr.cc) * (pow3 (ost->n_vars) - ost->n_vars) - fr.cc * sigma_t; } + else + fr.w = SYSMIS; show_ranks_box (ost, &fr); show_sig_box (ost, &fr); -- 2.30.2