title: Is "return voidFunction()" valid code?
body: <p>I know the return statement is unnecessary and therefore can be avoided, but out of curiosity: is this valid code?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void printNumber(int a)
  {
      printf("Your number is: %d\n", a);
  }
  
  void doStuff()
  {
      const int a = 12;
      return printNumber(a); // Is this valid, well-defined code?
  }
  
  int main()
  {
      doStuff();
      return 0;
  }
  </code></pre>
  
  <p>This compiles with no warnings using gcc and g++ 4.8.4:</p>
  
  <p><code>gcc -W -Wall -Werror -Wextra voidtest.cxx</code></p>
  
  <p><code>g++ -W -Wall -Werror -Wextra voidtest.cxx</code></p>
  
  <p>It also runs as one would expect.</p>
  
  <p>The question is tagged as C and C++ because I'd like to know if there's any difference in the answer for both languages.</p>