From 7a53bb3600c2d2063123382c232e4436a788f175 Mon Sep 17 00:00:00 2001 From: TatWai Chong Date: Tue, 16 Apr 2024 13:57:38 -0700 Subject: Fix gcc warning of comparison of different signedness integers This warning is raised in the integer comparison of `applyClip`. Signed-off-by: TatWai Chong Change-Id: If427cb08b8456480898375d8b77302ca7162f737 --- reference_model/src/arith_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ T applyClip(T value, U min_val, U max_val) value = applyMax(value, min_val); // Handle the numbers of an unsigned type U that becomes unrepresentable when type casting to signed. - if (std::is_signed_v && std::is_unsigned_v && max_val > std::numeric_limits::max()) + if (std::is_signed_v && std::is_unsigned_v && max_val > static_cast(std::numeric_limits::max())) { max_val = std::numeric_limits::max(); } -- cgit v1.2.1