regtest: fix compiler warnings with clang 16
[valgrind.git] / drd / tests / dlopen_lib.c
blob34d61676144196f143c2bb7963afff5585672681
1 #include <stdio.h>
2 #include <stdint.h>
3 #include <pthread.h>
4 #include "dlopen_lib.h"
6 void *PrintHello(void *threadid)
8 const long tid = (uintptr_t)threadid;
10 printf("Hello World! It's me, thread #%ld!\n", tid);
11 pthread_exit(NULL);
15 void foo()
17 pthread_t thread;
18 int rc;
19 uintptr_t t = 1;
21 printf("In main: creating thread %u\n", (unsigned)t);
22 rc = pthread_create(&thread, NULL, PrintHello, (void *)t);
23 if (rc)
24 printf("ERROR; return code from pthread_create() is %d\n", rc);
25 else
26 pthread_join(thread, NULL);