title: How to print the address of a function?
body: <p>I let <code>gcc</code> compile the following example using <code>-Wall -pedantic</code>:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
    printf("main: %p\n", main); /* line 5 */
    printf("main: %p\n", (void*) main); /* line 6 */
  
    return 0;
  }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>main.c:5: warning: format ‘%p’ expects type ‘void *’, but argument 2 has type ‘int (*)()’
  main.c:6: warning: ISO C forbids conversion of function pointer to object pointer type
  </code></pre>
  
  <p>Line 5 made my change the code like in line 6.</p>
  
  <p>What am I missing to remove the warning when printing a function's address?</p>