Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid warnings when compiling under Wpedantic #437

Merged
merged 8 commits into from
Jul 30, 2024
Prev Previous commit
Next Next commit
Avoid void pointer to function pointer casts
  • Loading branch information
andrjohns committed Jun 23, 2024
commit 4b5e033bc8ecb17b01c80040fb0229fad4bacf1f
5 changes: 2 additions & 3 deletions quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ static JSValue js_printf_internal(JSContext *ctx,
int64_t int64_arg;
double double_arg;
const char *string_arg;
/* Use indirect call to dbuf_printf to prevent gcc warning */
int (*dbuf_printf_fun)(DynBuf *s, const char *fmt, ...) = (void*)dbuf_printf;
int (*dbuf_printf_fun)(DynBuf *s, const char *fmt, ...) = dbuf_printf;

js_std_dbuf_init(ctx, &dbuf);

Expand Down Expand Up @@ -518,7 +517,7 @@ static JSModuleDef *js_module_loader_so(JSContext *ctx,
goto fail;
}

init = dlsym(hd, "js_init_module");
init = (JSInitModuleFunc *)dlsym(hd, "js_init_module");
if (!init) {
JS_ThrowReferenceError(ctx, "could not load module filename '%s': js_init_module not found",
module_name);
Expand Down