From a9594573092ce1543b2776b6d1766275989291c0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 1 Jul 2024 16:12:09 +0300 Subject: [PATCH] Add recommended workaround for dlsym void* return cast --- quickjs-libc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs-libc.c b/quickjs-libc.c index 85e2448..f66f872 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -517,7 +517,7 @@ static JSModuleDef *js_module_loader_so(JSContext *ctx, goto fail; } - init = (JSInitModuleFunc *)dlsym(hd, "js_init_module"); + *(void **) (&init) = dlsym(hd, "js_init_module"); if (!init) { JS_ThrowReferenceError(ctx, "could not load module filename '%s': js_init_module not found", module_name);