From 335ffaeb497c4a11b3662b87ef3fdee0dd57fff4 Mon Sep 17 00:00:00 2001 From: Som Samantray Date: Sun, 9 Aug 2026 20:27:55 +0530 Subject: [PATCH] fix: correct int/int32_t pointer mismatches for -Wincompatible-pointer-types Six call sites pass an int* where int32_t* is expected (or the reverse) in find_line_num, js_parseInt, remainingElementsCount_add, js_promise_all_resolve_element, and js_atomics_notify. Both types are 32-bit signed everywhere this project targets, so there is no behavioral change, but on any target where stdint.h defines int32_t as long int (ESP-IDF/ESP32 since v5.0), GCC 14+ treats the mismatch as a hard -Wincompatible-pointer-types error and the file fails to build. Retype the five local variables to match the callee signature already used at every other call site. --- quickjs.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/quickjs.c b/quickjs.c index bbac00c33..bfc5350d4 100644 --- a/quickjs.c +++ b/quickjs.c @@ -8098,7 +8098,8 @@ static int find_line_num(JSContext *ctx, JSFunctionBytecode *b, uint32_t pc_value, int *col) { const uint8_t *p_end, *p; - int new_line_num, new_col_num, line_num, col_num, pc, v, ret; + int new_line_num, new_col_num, line_num, col_num, pc, ret; + int32_t v; unsigned int op; *col = 1; @@ -46690,7 +46691,8 @@ static JSValue js_parseInt(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { const char *str, *p; - int radix, flags; + int flags; + int32_t radix; JSValue ret; str = JS_ToCString(ctx, argv[0]); @@ -56097,7 +56099,7 @@ static __exception int remainingElementsCount_add(JSContext *ctx, int addend) { JSValue val; - int remainingElementsCount; + int32_t remainingElementsCount; val = JS_GetPropertyUint32(ctx, resolve_element_env, 0); if (JS_IsException(val)) @@ -56128,7 +56130,8 @@ static JSValue js_promise_all_resolve_element(JSContext *ctx, JSValueConst resolve = func_data[3]; JSValueConst resolve_element_env = func_data[4]; JSValue ret, obj; - int is_zero, index; + int is_zero; + int32_t index; if (JS_ToInt32(ctx, &index, func_data[1])) return JS_EXCEPTION; @@ -62710,7 +62713,8 @@ static JSValue js_atomics_notify(JSContext *ctx, { struct list_head *el, *el1, waiter_list; int size_log2; - int32_t count, n; + int count; + int32_t n; void *ptr; uint64_t idx; JSObject *p;