[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[misc 01/18] friedman: Fix GCC warning about uninitialized fr.w.
From: |
Ben Pfaff |
Subject: |
[misc 01/18] friedman: Fix GCC warning about uninitialized fr.w. |
Date: |
Sat, 11 Dec 2010 22:19:55 -0800 |
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 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/language/stats/friedman.c b/src/language/stats/friedman.c
index 9711167..9950543 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);
--
1.7.1
- [misc 00/18] miscellaneous minor improvements, Ben Pfaff, 2010/12/12
- [misc 06/18] expressions: Make extract_min_valid() parameter const., Ben Pfaff, 2010/12/12
- [misc 01/18] friedman: Fix GCC warning about uninitialized fr.w.,
Ben Pfaff <=
- [misc 15/18] i18n: Remove unnecessary #ifs., Ben Pfaff, 2010/12/12
- [misc 12/18] DO REPEAT: Make this command usable anywhere., Ben Pfaff, 2010/12/12
- [misc 16/18] AGGREGATE: Align arg_func_tab[] in columns., Ben Pfaff, 2010/12/12
- [misc 10/18] NPAR TESTS: Prefer lex_match_id() over lex_match_hyphenated_word(), Ben Pfaff, 2010/12/12
- [misc 14/18] ECHO: Use text_item, as intended., Ben Pfaff, 2010/12/12
- [misc 04/18] covariance: Fix const-ness of covariance_calculate[_unnormalized] retval., Ben Pfaff, 2010/12/12
- [misc 08/18] DEBUG XFORM FAIL: Issue an error message as part of transformation., Ben Pfaff, 2010/12/12
- [misc 18/18] value-parser: Remove redundant call to lex_force_string() in parse_value()., Ben Pfaff, 2010/12/12
- [misc 17/18] GET DATA: Fix punctuation in error message., Ben Pfaff, 2010/12/12
- [misc 07/18] INPUT PROGRAM: Remove unused enumeration., Ben Pfaff, 2010/12/12