Files
valgrind/drd/tests/dlopen_lib.c
Paul Floyd 9f28b44348 regtest: fix compiler warnings with clang 16
Mostly warnings about deprecated use of K&R function definitions.
2023-08-27 16:57:24 +02:00

28 lines
541 B
C

#include <stdio.h>
#include <stdint.h>
#include <pthread.h>
#include "dlopen_lib.h"
void *PrintHello(void *threadid)
{
const long tid = (uintptr_t)threadid;
printf("Hello World! It's me, thread #%ld!\n", tid);
pthread_exit(NULL);
}
void foo()
{
pthread_t thread;
int rc;
uintptr_t t = 1;
printf("In main: creating thread %u\n", (unsigned)t);
rc = pthread_create(&thread, NULL, PrintHello, (void *)t);
if (rc)
printf("ERROR; return code from pthread_create() is %d\n", rc);
else
pthread_join(thread, NULL);
}