Workaround stupid warning

This commit is contained in:
Gael Guennebaud 2018-10-08 12:01:18 +02:00
parent c9643f4a6f
commit 64b1a15318

View File

@ -124,7 +124,11 @@ struct TensorEvaluator<const TensorScanOp<Op, ArgType>, Device> {
m_stride = m_stride * dims[i]; m_stride = m_stride * dims[i];
} }
} else { } else {
for (int i = NumDims - 1; i > op.axis(); --i) { // dims can only be indexed through unsigned integers,
// so let's use an unsigned type to let the compiler knows.
// This prevents stupid warnings: ""'*((void*)(& evaluator)+64)[18446744073709551615]' may be used uninitialized in this function"
unsigned int axis = internal::convert_index<unsigned int>(op.axis());
for (unsigned int i = NumDims - 1; i > axis; --i) {
m_stride = m_stride * dims[i]; m_stride = m_stride * dims[i];
} }
} }