diff --git a/vlib/compiler/fn.v b/vlib/compiler/fn.v index 39736e09f0..78c1ab900e 100644 --- a/vlib/compiler/fn.v +++ b/vlib/compiler/fn.v @@ -664,7 +664,7 @@ fn (p mut Parser) async_fn_call(f Fn, method_ph int, receiver_var, receiver_type p.genln(' CreateThread(0,0, $wrapper_name, $parg, 0,0);') } else { - p.genln('int $tmp2 = pthread_create(& $thread_name, NULL, $wrapper_name, $parg);') + p.genln('int $tmp2 = pthread_create(& $thread_name, NULL, (void *)$wrapper_name, $parg);') } p.check(.rpar) } diff --git a/vlib/compiler/live.v b/vlib/compiler/live.v index e8dc83f89b..963d201461 100644 --- a/vlib/compiler/live.v +++ b/vlib/compiler/live.v @@ -56,7 +56,7 @@ fn (v &V) generate_hotcode_reloading_main_caller() { cgen.genln(' char *live_library_name = "$so_name";') cgen.genln(' load_so(live_library_name);') cgen.genln(' pthread_t _thread_so;') - cgen.genln(' pthread_create(&_thread_so , NULL, &reload_so, live_library_name);') + cgen.genln(' pthread_create(&_thread_so , NULL, (void *)&reload_so, live_library_name);') } else { // windows: so_name := file_base + if v.pref.ccompiler == 'msvc' {'.dll'} else {'.so'}