From 9a2679e57de987b86082ca27695238a9ac0c371a Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 29 May 2019 14:07:50 +0200 Subject: [PATCH] Fix compile error with GCC 7.2.1 Prevents "error: uninitialized variable 'tmp' in 'constexpr' function" --- misc/math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/math.h b/misc/math.h index 0129a64..d55c762 100644 --- a/misc/math.h +++ b/misc/math.h @@ -60,9 +60,9 @@ constexpr IntegralType powerModulo(const IntegralType base, const IntegralType e template , std::is_unsigned> * = nullptr> constexpr IntegralType inverseModulo(IntegralType number, IntegralType module) { - IntegralType y1 = 0, y2 = 1, tmp; + IntegralType y1 = 0, y2 = 1; while (number != 1) { - tmp = y1 - (module / number) * y2; + IntegralType tmp = y1 - (module / number) * y2; y1 = y2; y2 = tmp; tmp = module % number;