title: return statement in void function in C
body: <p>In the following program, <strong>Why compiler does not gives any error or warning?</strong></p>
  
  <pre><code>cc -Wall -pedantic my_program.c
  </code></pre>
  
  <p><strong>code here:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void f()
  {
          return; // return statement in void function
  }
  
  int main()
  {
          f();
          return 0;
  }
  </code></pre>
  
  <p>I have compiled the program in <strong>GCC</strong> compiler on <strong>Linux</strong> platform.</p>