]> sourceware.org Git - lvm2.git/commit
libdm: fix uninitialized variable warnings on older gcc
authorBryn M. Reeves <bmr@redhat.com>
Fri, 4 Sep 2015 10:40:19 +0000 (11:40 +0100)
committerBryn M. Reeves <bmr@redhat.com>
Fri, 4 Sep 2015 10:46:48 +0000 (11:46 +0100)
commitcdca2782d2b43c20d552d64359ac0ce80d24af5f
tree242dbb5ef441022914a22bd191644e96818673dc
parentcebbb0feafb97516377388eb1747e3207c4f0596
libdm: fix uninitialized variable warnings on older gcc

Older versions of gcc aren't able to track the assignments of
local variables as well as the latest versions leading to spurious
warnings like:

libdm-stats.c:2183: warning: "len" may be used uninitialized in this
function
libdm-stats.c:2177: warning: "minwidth" may be used uninitialized in
this function

Both of these variables are in fact assigned in all possible paths
through the function and later compilers do not produce these
warnings.

There's no reason to not initialize these variables though and
it makes the function slightly easier to follow.

Also fix one use of 'unsigned' for a nr_bins value.
libdm/libdm-stats.c
This page took 0.035266 seconds and 5 git commands to generate.