Fix gcc warning of comparison of different signedness integers
This warning is raised in the integer comparison of `applyClip`.
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Change-Id: If427cb08b8456480898375d8b77302ca7162f737
diff --git a/reference_model/src/arith_util.h b/reference_model/src/arith_util.h
index fa6d136..d1cdeee 100644
--- a/reference_model/src/arith_util.h
+++ b/reference_model/src/arith_util.h
@@ -353,7 +353,7 @@
value = applyMax<T>(value, min_val);
// Handle the numbers of an unsigned type U that becomes unrepresentable when type casting to signed.
- if (std::is_signed_v<T> && std::is_unsigned_v<U> && max_val > std::numeric_limits<T>::max())
+ if (std::is_signed_v<T> && std::is_unsigned_v<U> && max_val > static_cast<U>(std::numeric_limits<T>::max()))
{
max_val = std::numeric_limits<T>::max();
}