title: Why is this implicit conversion (between different pointer types) valid?
body: <p>I found myself in the following situation:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef struct T1 { int id; } T1;  
  typedef struct T2 { int id; } T2;
  
  void f(T1 *ptr) { printf("f called\n"); }
  
  int main(void) 
  {
      T2 obj; 
      T2 *ptr = &amp;obj; 
      f(ptr); // shouldn't this be a compilation error ? 
      return 0;
  }
  </code></pre>
  
  <p>of course, this is invalid C++, but in C, the program <a href="http://ideone.com/OjSeam" rel="nofollow">prints</a> "f called". How is this valid ? </p>
  
  <h2>EDIT</h2>
  
  <p>(Just in case it's unclear) The program would still <a href="http://ideone.com/Hb1DbM" rel="nofollow">compile</a> and run if <code>T2</code> was "structurally" different, eg</p>
  
  <pre><code>typedef struct T2 { double cc[23]; } T2;
  </code></pre>