title: C (gcc) warning: initialization from incompatible pointer type when calling pthread_cleanup_push()
body: <p>gcc version 4.3.3 under Ubuntu Linux 9.04 in case that is relevant.</p>
  
  <p>This is the offending code:</p>
  
  <pre><code>pthread_cleanup_push(ctl_cleanup, NULL);
  </code></pre>
  
  <p>with ctl_cleanup() defined as</p>
  
  <pre><code>void* ctl_cleanup(void *arg);
  </code></pre>
  
  <p>There are other instances where this warning pops up, in similar circumstances. The warning also appears if I call something like</p>
  
  <pre><code>pthread_cleanup_push(pthread_mutex_unlock, (void *)&amp;m);
  </code></pre>
  
  <p>where m is of type pthread_mutex_t. The warning reads:</p>
  
  <blockquote>
    <p>warning: initialization from incompatible pointer type</p>
  </blockquote>
  
  <p>I don't understand. I've passed other things around using void pointers (e.g. when passing arguments to a pthread) without that warning. Can someone help me out?</p>