enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

Uninitialised variable `animationTimeNew` in `ModelAsset::getTransformBlended` code #75

Closed jmcph4 closed 5 years ago

jmcph4 commented 5 years ago

During standard build process:

[ 59%] Building CXX object CMakeFiles/LimonEngine.dir/src/Assets/ModelAsset.cpp.o
src/Assets/ModelAsset.cpp: In member function ‘bool ModelAsset::getTransformBlended(std::__cxx11::string, long int, bool, std::__cxx11::string, long int, bool, float, std::vector<glm::tmat4x4<float, (glm::precision)0u> >&) const’:
src/Assets/ModelAsset.cpp:456:115: warning: ‘animationTimeNew’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         traverseAndSetTransform(rootNode, parentTransform, currentAnimationNew, animationTimeNew, transformMatrix);
                                                                                                                   ^

The variable in question animationTimeNew, is declared here:

https://github.com/enginmanap/limonEngine/blob/3e8bde062c37dc75da4a9a701895c8d94d594a84/src/Assets/ModelAsset.cpp#L420

jmcph4 commented 5 years ago

See #76 for review

jmcph4 commented 5 years ago

Just thought I'd provide an update on this. As of (at least) 022e002, this is the build output:

[ 59%] Building CXX object CMakeFiles/LimonEngine.dir/src/Assets/ModelAsset.cpp.o
src/Assets/ModelAsset.cpp: In member function ‘bool ModelAsset::getTransformBlended(std::__cxx11::string, long int, bool, std::__cxx11::string, long int, bool, float, std::vector<glm::tmat4x4<float, (glm::precision)0u> >&) const’:
src/Assets/ModelAsset.cpp:467:108: warning: ‘animationTimeNew’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                        currentAnimationNew, animationTimeNew, blendFactor, transformMatrix);
                                                                                                            ^
src/Assets/ModelAsset.cpp:467:108: warning: ‘animationTimeOld’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Any word on a fix for this?

enginmanap commented 5 years ago

Sorry it is taking long, but I am trying to finish up some other development. I didn't have time to look into this yet.

enginmanap commented 5 years ago

Hey, I merged your commit yesterday, and made another to fix the second one. Thanks.

Closing as done.