From: root Date: Wed, 27 Nov 2019 22:39:51 +0000 (-0800) Subject: Fix compile under clang X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=88d21086018b797fbd9f57867751f8f823bb2474;p=c11tester.git Fix compile under clang --- diff --git a/threads.cc b/threads.cc index 61df56d7..5720ff77 100644 --- a/threads.cc +++ b/threads.cc @@ -178,7 +178,7 @@ void real_init_all() { } if (!pthread_exit_p) { - pthread_exit_p = (void (*)(void *))dlsym(RTLD_NEXT, "pthread_exit"); + *((void (**)(void *)) &pthread_exit_p) = (void (*)(void *))dlsym(RTLD_NEXT, "pthread_exit"); if ((error = dlerror()) != NULL) { fputs(error, stderr); exit(EXIT_FAILURE);