title: Turning indexed accesses to pointer accesses
body: <p>Say I have a function <code>int access_p_i(uintptr_t i)</code> that accesses
  <code>p[i]</code> where <code>char *p;</code> is a global variable.</p>
  
  <pre><code>char *p;
  int access_p_i(uintptr_t i)
  {
      return printf("p[%lx]=%c\n", i, p[i]);
  }
  </code></pre>
  
  <p>The intended usage is as follows:</p>
  
  <pre><code>char buf[] = "abcde";
  p = buf; /*set p once*/
  access_p_i(3); //prints p[3]=d
  access_p_i(2); //prints p[2]=c
  </code></pre>
  
  <p>Say I want to hijack it (without modifying the function) to take absolute pointers:</p>
  
  <pre><code>memset(&amp;p,0,sizeof(char*)); /*set p once*/
  access_p_i((uintptr_t)"d");
  access_p_i((uintptr_t)"c");
  </code></pre>
  
  <p>Would this be portable and legal C?</p>