title: Casting a function pointer to another type
body: <p>Let's say I have a function that accepts a <code>void (*)(void*)</code> function pointer for use as a callback:</p>
  
  <pre><code>void do_stuff(void (*callback_fp)(void*), void* callback_arg);
  </code></pre>
  
  <p>Now, if I have a function like this:</p>
  
  <pre><code>void my_callback_function(struct my_struct* arg);
  </code></pre>
  
  <p>Can I do this safely?</p>
  
  <pre><code>do_stuff((void (*)(void*)) &amp;my_callback_function, NULL);
  </code></pre>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/188839/function-pointer-cast-to-different-signature">this question</a> and I've looked at some C standards which say you can cast to 'compatible function pointers', but I cannot find a definition of what 'compatible function pointer' means.</p>