title: Difference in incomplete array pointer conversion rules between C and C++
body: <p>When I compile the following code with <code>gcc</code> and <code>g++</code>, <code>g++</code> gives error and not <code>gcc</code>. Note that the code converts from <code>int (*)[4]</code> to <code>int (*)[]</code> (which is pointer to incomplete array type).</p>
  
  <pre><code>int arr[4];
  int (*p_arr)[] = &amp;arr;
  </code></pre>
  
  <p>As discussed in <a href="https://stackoverflow.com/questions/33777054/incomplete-array-type">Incomplete array type?</a>, <code>C</code> language allows this conversion. But why does <code>C++</code> disallow this and gives the error <code>error: cannot convert ‘int (*)[4]’ to ‘int (*)[]’ in assignment</code>. I know C++ is more type-safe than C, but does this assignment is really type-unsafe, because the later dereference of the pointer (e.g. <code>sizeof(*p_arr)</code>) anyway gives error in <code>C</code> as well?</p>