[previous] 2887 [next] Function 'main' ends with an implicit 'return' statement.
Control flow

Function 'main' ends with an implicit return statement.

The function 'main' returns a value of type 'int' in a hosted environment. In the absence of an explicit return statement, a conforming ISO:C90 implementation will return an undefined value; but a conforming ISO:C99 implementation, will simply return a value of 0.

It is good practice for the 'main' function to include an explicit return statement with a return expression of type int.


/*PRQA S 744,2017 ++*/

int main(void)                  /* 2887 */
{

}


MISRA C:2012 Rules applicable to message 2887:

Rule-17.4  (Mandatory) All exit paths from a function with non-void return type shall have an explicit return statement with an expression


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents