diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-05 04:17:44 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-05 04:17:44 +0000 |
commit | 8427fca49bd85205f5a8766292dd893f003c0e48 (patch) | |
tree | f0047daa0f9466ac447f5ced1f231438f526992b /thread_pthread.c | |
parent | 779c18bf238aba630e40c26e10ce8aa278c45d61 (diff) |
assigning void* to a function pointer is a POSIXism
No implicit cast is defined between these types. Should be explicit.
Also, NULL is defined to be ((void*)0) so not usable as a function
pointer value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 9401dcc2a0..1a6cf0c768 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1777,7 +1777,7 @@ rb_nativethread_self(void) static void * mjit_worker(void *arg) { - void (*worker_func)(void) = arg; + void (*worker_func)(void) = (void(*)(void))arg; if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0) { fprintf(stderr, "Cannot enable cancelation in MJIT worker\n"); @@ -1791,7 +1791,7 @@ mjit_worker(void *arg) /* Launch MJIT thread. Returns FALSE if it fails to create thread. */ int -rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void)) +rb_thread_create_mjit_thread(void (*child_hook)(void), void *worker_func) { pthread_attr_t attr; pthread_t worker_pid; |