can someone tell me what am I doing wrong? (I omitted the rest of the program because its very long...)
#include <pthread.h>
void *RTPfun(char *client_addr);
int main(int argc, char *argv[])
{
char* client_addr;
pthread_t RTPthread;
// ...
pthread_create(&RTPthread, NULL, &RTPfun, client_addr)
}
void *RTPfun(char * client_addr)
{
// ...
return;
}
the error:
TCPserver.c: In function ‘main’: TCPserver.c:74:5: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [enabled by default] /usr/include/pthread.h:225:12: note: expected ‘void * (*)(void *)’ but argument is of type ‘void * (*)(char *)’
return;
without an expression in a function with non-void
return type. If that return statement is ever actually reached, your program has undefined behavior. – Casey