the static keywork is a workaround for an internal bug of GCC

"internal compiler error: in trunc_int_for_mode, at explow.c:55"
This commit is contained in:
Dennis Mannhart
2018-04-30 13:39:14 +02:00
committed by Lorenz Meier
parent 742e9f7b15
commit 09b7d0f659
@@ -69,7 +69,10 @@ bool ControlMathTest::testPrioritizeVector()
// v0 already at max
matrix::Vector2f v0(max, 0);
matrix::Vector2f v1(v0(1), -v0(0));
matrix::Vector2f v_r = ControlMath::constrainXY(v0, v1, max);
// the static keywork is a workaround for an internal bug of GCC
// "internal compiler error: in trunc_int_for_mode, at explow.c:55"
static matrix::Vector2f v_r = ControlMath::constrainXY(v0, v1, max);
ut_assert_true(fabsf(v_r(0)) - max < FLT_EPSILON && v_r(0) > 0.0f);
ut_assert_true(fabsf(v_r(1) - 0.0f) < FLT_EPSILON);