title: Double pointer const-correctness warnings in C
body: <p>A pointer to non-const data can be implicitly converted to a pointer to const data of the same type:</p>
  
  <pre><code>int       *x = NULL;
  int const *y = x;
  </code></pre>
  
  <p>Adding additional const qualifiers to match the additional indirection should logically work the same way:</p>
  
  <pre><code>int       *      *x = NULL;
  int       *const *y = x; /* okay */
  int const *const *z = y; /* warning */
  </code></pre>
  
  <p>Compiling this with GCC or Clang with the <code>-Wall</code> flag, however, results in the following warning:</p>
  
  <pre><code>test.c:4:23: warning: initializing 'int const *const *' with an expression of type
        'int *const *' discards qualifiers in nested pointer types
      int const *const *z = y; /* warning */
                        ^   ~
  </code></pre>
  
  <p>Why does adding an additional <code>const</code> qualifier "discard qualifiers in nested pointer types"?</p>