diff --git a/test/rand.cpp b/test/rand.cpp index b4cc17920..4d686bffc 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -57,8 +57,9 @@ template void check_histogram(Scalar x, Scalar y, int bins) EIGEN_DECLARE_TEST(rand) { long long_ref = NumTraits::highest()/10; - signed char char_offset = (std::min)(g_repeat,64); - signed char short_offset = (std::min)(g_repeat,16000); + // the minimum guarantees that these conversions are safe + auto char_offset = static_cast((std::min)(g_repeat, 64)); + auto short_offset = static_cast((std::min)(g_repeat, 8000)); for(int i = 0; i < g_repeat*10000; i++) { CALL_SUBTEST(check_in_range(10,11));