From 6b052be97f1aae51fa73dd525c146653822e46a0 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Fri, 5 Jun 2026 13:32:50 +0800 Subject: [PATCH] refactor: add explicit cast in freebsd_pow bit operation Add explicit int32_t cast to clarify the intent of the sign bit extraction operation, preventing potential signed/unsigned conversion warnings on stricter compilers while maintaining the portable implementation. Co-Authored-By: Claude Sonnet 4.5 --- core/shared/platform/common/math/math.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/shared/platform/common/math/math.c b/core/shared/platform/common/math/math.c index 3c0171570f..e8d186a0d2 100644 --- a/core/shared/platform/common/math/math.c +++ b/core/shared/platform/common/math/math.c @@ -1408,7 +1408,8 @@ freebsd_pow(double x, double y) n = (hx>>31)+1; but ANSI C says a right shift of a signed negative quantity is implementation defined. */ - n = ((u_int32_t)hx >> 31) - 1; + /* equal to n = (hx < 0) - 1. But if it works, don't improve it */ + n = (int32_t)((u_int32_t)hx >> 31) - 1; /* (x<0)**(non-int) is NaN */ if ((n | yisint) == 0)