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.cChecked automatically with code checker

Synopsis:A function "return" expression shall be compatible with its explicitly defined type.
Language:C
Severity Level:2
Category:Statement and Blocks


Description:

Justification

Using non-compatible return expressions leads to undefined behavior when the function is used.

Example 1

float f(void)
{
   int i = 0;
   ...
   return; /* WRONG */
}

Example 2

void f(void)
{
   return (0); /* WRONG */
}