title: Cast a long to a function pointer?
body: <p>I have the following code:</p>
  
  <pre><code>long fp = ...
  void (*ptr)(long, char*, char*) = fp;
  </code></pre>
  
  <p>The long <code>fp</code> is a correct function pointer, which comes in as a long. I am getting the standard "makes pointer from int without a cast" warning. I want to be able to compile with:</p>
  
  <pre><code>-std=iso9899:1990 -pedantic-errors
  </code></pre>
  
  <p>which turns that warning into an error. The question is: what is the correct cast? I have tried various guesses, e.g.:</p>
  
  <pre><code>void (*ptr)(long, char*, char*) = (void)(*)(long, char*, char*) fp;
  </code></pre>
  
  <p>But can't seem to find the right one.</p>