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 */ } |