![]() |
![]() |
2889 | ![]() |
||||
![]() | |||||||
| Control flow | |||||||
This function returns in more than one place. According to structured programming principles, a function should only contain a single exit point. Note that one of the return paths referred to in this message may be an implicit "return;" statement at the end of the function. For example:
/*PRQA S 2006,2017,3120,3227,3408 ++*/
extern int foo(int n) /* 2889 */
{
if (n > 10)
{
return 0;
}
return n;
}
MISRA-C:2004 Rules applicable to message 2889:
| Rule 14.7 (Required) | A function shall have a single point of exit at the end of the function. |
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |