From: Chih-Hung Hsieh Date: Fri, 4 Sep 2015 19:04:11 +0000 (-0700) Subject: tests: Init local variable enctype before use in print_base_type varlocs.c. X-Git-Tag: elfutils-0.164~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b85f80ab687044ece15d51de8a5e7f63bc1d3fa9;p=thirdparty%2Felfutils.git tests: Init local variable enctype before use in print_base_type varlocs.c. clang compiler static analysis failed. Signed-off-by: Chih-Hung Hsieh Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 44a8f0454..15c3ef9f9 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2015-09-04 Chih-Hung Hsieh + + * varlocs.c (print_base_type): Initialize enctype. + 2015-09-04 Chih-Hung Hsieh * md5-sha1-test.c (md5_expected): Removed. diff --git a/tests/varlocs.c b/tests/varlocs.c index b5733e7bf..c3fba89ec 100644 --- a/tests/varlocs.c +++ b/tests/varlocs.c @@ -82,7 +82,7 @@ print_base_type (Dwarf_Die *base) assert (dwarf_tag (base) == DW_TAG_base_type); Dwarf_Attribute encoding; - Dwarf_Word enctype; + Dwarf_Word enctype = 0; if (dwarf_attr (base, DW_AT_encoding, &encoding) == NULL || dwarf_formudata (&encoding, &enctype) != 0) error (EXIT_FAILURE, 0, "base type without encoding");