From c3dd5598f6ae90e63d364014c2d97d25871a58ac Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Sat, 3 Aug 2024 21:05:18 +0800 Subject: [PATCH] Fix a compilation warning (#3682) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: ``` wamr/core/iwasm/compilation/aot_llvm.c: In function ‘insert_native_symbol’: wamr/core/iwasm/compilation/aot_llvm.c:3290:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 3290 | if (ret < 0 || ret + 1 > sizeof(sym->symbol)) { | ^ ``` Signed-off-by: Huang Qi --- core/iwasm/compilation/aot_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index d8a5e8ee..fcf29191 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -3287,7 +3287,7 @@ insert_native_symbol(AOTCompContext *comp_ctx, const char *symbol, int32 idx) memset(sym, 0, sizeof(AOTNativeSymbol)); bh_assert(strlen(symbol) <= sizeof(sym->symbol)); ret = snprintf(sym->symbol, sizeof(sym->symbol), "%s", symbol); - if (ret < 0 || ret + 1 > sizeof(sym->symbol)) { + if (ret < 0 || ret + 1 > (int)sizeof(sym->symbol)) { aot_set_last_error_v("symbol name too long: %s", symbol); return false; }