TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  6.8.6.4.bChecked automatically with code checker

Synopsis:There shall be no return statement in a void function.
Language:C
Severity Level:9
Category:Statement and Blocks


Description:

Justification

There is no need for a return statement in a void function. Absence of a return statement prevents adding an expression to the return statement.

Example 1

void f(void)
{
   /* any statement */
   return (i); /* WRONG */
}

Example 2

void f(void)
{
   /* any statement */
   /* no return statement */ /* RIGHT */
}