Continued from the comments above...
(1) The pthread_create
start function (3rd parameter) must have a signature of
void *(*start_routine) (void *)
that is, a function that takes a void pointer and returns a void pointer. For example:
void* myfunc(void *)
You are getting compile errors because your start function probably (and incorrectly) looks like this:
void myfunc(void)
in other words a function that takes no parameters and returns no result. You got around this compiler error by casting myfunc to a pointer to void but it is unnecessary and wrong. Your real problem is that your start function "myfunc" has the wrong signature.
(2) It seems you are hung up on void and pointers to void. There several good answers here on this including this. Basically a pointer to void is a generic pointer that can point to any type.
pthread_create
is itself an excellent example of the use of void ptrs. Because there is no way for a start function to know what kind of data a developer wants to pass into (and return) from the function they use a void ptr that can point to any type. It is up to the developer of the start function to then cast the void ptr to appropriate type he actually passed before using whatever the void ptr points to. So now the start function can process a ptr that may in actually point to an int, a double, an array, a structure, or whatever.
In your case you are turning a pointer to a function with a specific signature into a pointer to anything. This may satisfy the compiler because it assumes you know what you are doing. But in this instance you don't because you are papering over the real error which is that the signature of your start function is wrong.