The following code:
|
template<length_t L, typename T, qualifier Q> |
|
GLM_FUNC_QUALIFIER vec<L, bool, Q> lessThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
|
{ |
|
assert(x.length() == y.length()); |
|
|
|
vec<L, bool, Q> Result; |
|
for(length_t i = 0; i < x.length(); ++i) |
|
Result[i] = x[i] < y[i]; |
|
|
|
return Result; |
|
} |
Produces this warning with MSVC 2013 update 5:
include\glm\detail\func_vector_relational.inl(17): warning C4701: potentially uninitialized local variable 'Result' used
This isn't a bug because the Result vector is always populated in the loop, and there is already an assertion to check the lengths are equal to be sure. I guess it'd be wasteful to initialize the result vector at the beginning, but it would be nice to silence such warnings within glm.
The following code:
glm/glm/detail/func_vector_relational.inl
Lines 8 to 18 in 0d973b4
Produces this warning with MSVC 2013 update 5:
This isn't a bug because the
Resultvector is always populated in the loop, and there is already an assertion to check the lengths are equal to be sure. I guess it'd be wasteful to initialize the result vector at the beginning, but it would be nice to silence such warnings within glm.