[previous] MISRA-C:2004  Rule  14.7:  (Required) [next] A function shall have a single point of exit at the end of the function.
This is required by IEC 61508, under good programming style.

Example Code:


#include "misra.h"
#include "m2cmex.h"

extern S16 test_1407( void )            /* MISRA Violation */
{
   if ( s16a > 0 )
   {
      return 0;
   }
   else
   {
      return 1;
   }
}


QAC messages that encompass this guideline:

2889 This function has more than one 'return' path.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents