title: Converting a non-`void` pointer to `uintptr_t` and vice-versa
body: <p>There are two related C standard rules:</p>
  
  <p>C99 standard, <code>6.3.2.3</code>:</p>
  
  <blockquote>
    <p>A pointer to void may be converted to or from a pointer to any
    incomplete or object type. A pointer to any incomplete or object type
    may be converted to a pointer to void and back again; the result shall
    compare equal to the original pointer.</p>
  </blockquote>
  
  <p>And <code>7.20.1.4</code>:</p>
  
  <blockquote>
    <p>The following type designates an unsigned integer type with the
    property that any valid pointer to void can be converted to this type,
    then converted back to pointer to void, and the result will compare
    equal to the original pointer:
             <code>uintptr_t</code></p>
  </blockquote>
  
  <p>It means, that the following code is compliant:</p>
  
  <pre><code>int *p = NULL;
  void *q = (void*)p;
  uintptr_t s = (uintptr_t)q;
  </code></pre>
  
  <p>But does it really need the two-step cast? Will the compiler perform an implicit intermediate cast if doing something like:</p>
  
  <pre><code>int *p = NULL;
  uintptr_t s = (uintptr_t)p;
  </code></pre>
  
  <p>(Well, it probably will on most compilers, but my question is about standard compliance)</p>