diff options
| author | Matthew Plough <matt@arena.io> | 2017-01-27 12:49:48 -0500 |
|---|---|---|
| committer | Matthew Plough <matt@arena.io> | 2017-01-27 12:49:48 -0500 |
| commit | d0c418c0bb150cce670bbfd1d9343f91f894125a (patch) | |
| tree | 2b547ee22de2835a904a0980008a86057845ca45 /include/git2 | |
| parent | 8df1cfc9d710db48469e2ea34152cfe03d4bf515 (diff) | |
| download | libgit2-d0c418c0bb150cce670bbfd1d9343f91f894125a.tar.gz | |
Fix uninitialized variable warning
Fix the following warning emitted by clang:
[ 16%] Building C object CMakeFiles/libgit2_clar.dir/src/submodule.c.o
/Users/mplough/devel/external/libgit2/src/submodule.c:408:6: warning: variable 'i' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if ((error = load_submodule_names(names, cfg)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:448:20: note: uninitialized use occurs here
git_iterator_free(i);
^
/Users/mplough/devel/external/libgit2/src/submodule.c:408:2: note: remove the 'if' if its condition is always false
if ((error = load_submodule_names(names, cfg)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:404:17: note: initialize the variable 'i' to silence this warning
git_iterator *i;
^
= NULL
1 warning generated.
Diffstat (limited to 'include/git2')
0 files changed, 0 insertions, 0 deletions
