C (gcc) warning: initialization from incompatible pointer type when calling pthread_cleanup_push()
问题 gcc version 4.3.3 under Ubuntu Linux 9.04 in case that is relevant. This is the offending code: pthread_cleanup_push(ctl_cleanup, NULL); with ctl_cleanup() defined as void* ctl_cleanup(void *arg); There are other instances where this warning pops up, in similar circumstances. The warning also appears if I call something like pthread_cleanup_push(pthread_mutex_unlock, (void *)&m); where m is of type pthread_mutex_t. The warning reads: warning: initialization from incompatible pointer type I