From: Ivan Maidanski Date: Mon, 22 Oct 2012 04:26:27 +0000 (+0400) Subject: Eliminate 'uninitialized variable use' warning in test_printf (cord) X-Git-Tag: gc7_4_0~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2cf0ba5b43653fd675426f5ec06cede4af5a9ae;p=gc Eliminate 'uninitialized variable use' warning in test_printf (cord) * cord/tests/cordtest.c (test_printf): Initialize "l" and "s" local variables (those values should be set by CORD_sprintf) to prevent "uninitialized variable use" compiler (or static code analysis tool) warning as well as for better testing of CORD_sprintf. --- diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c index a089f80d..fd0bc325 100644 --- a/cord/tests/cordtest.c +++ b/cord/tests/cordtest.c @@ -203,8 +203,8 @@ void test_printf(void) { CORD result; char result2[200]; - long l; - short s; + long l = -1; + short s = (short)-1; CORD x; if (CORD_sprintf(&result, "%7.2f%ln", 3.14159F, &l) != 7)