# HG changeset patch # User Rik # Date 1547699535 28800 # Node ID 50439c2e8bbfe2ee9662fc465b6656642e6a1fb5 # Parent c40b3b6715132bd327fd6f45d83cef564436cc10 Fix uninitialized argument value found by clang static analysis (bug #55440). * dSparse.cc (bsolve): Initialize anorm to 0.0. For consistency, initialize atmp to "0.0" rather than "0.". diff -r c40b3b671513 -r 50439c2e8bbf liboctave/array/dSparse.cc --- a/liboctave/array/dSparse.cc Wed Jan 16 23:38:19 2019 +0100 +++ b/liboctave/array/dSparse.cc Wed Jan 16 20:32:15 2019 -0800 @@ -4717,9 +4717,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm) @@ -5056,9 +5057,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm) @@ -5410,9 +5412,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm)