title: Type-qualifiers on function return type
body: <p>Given the following C source code:</p>
  
  <pre><code>const int foo(void)
  {
      return 42;
  }
  </code></pre>
  
  <p><code>gcc</code> compiles without errors, but with <code>-Wextra</code> or <code>-Wignored-qualifiers</code>, the following warning appears:</p>
  
  <pre><code>warning: type qualifiers ignored on function return type
  </code></pre>
  
  <p>I understand that there's good reason in C++ to distinguish between <code>const</code> functions and non-<code>const</code> functions, e.g. in the context of operator overloading.</p>
  
  <p>In plain C however, I fail to see why <code>gcc</code> doesn't emit an error, or more concisely, why the standard allows <code>const</code> functions.</p>
  
  <p>Why is it allowed to use type qualifiers on function return types?</p>