/* >>>------------------------------------------------------------ * * File: rule_16.8.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 16.8 (Required): * All exit paths from a function with non-void return type shall * have an explicit return statement with an expression. * * Implemented by messages: * 745 [U] 'return;' found in '%s()', which has been defined * with a non-'void' return type. * * 2887 Function 'main' ends with an implicit 'return' * statement. * * 2888 This function has been declared with a non-void 'return' * type but ends with an implicit 'return ;' statement. * * 3113 [U] 'return' statement includes no expression but * function '%s()' is implicitly of type 'int'. * * 3114 [U] Function '%s()' is implicitly of type 'int' but ends * without returning a value. * * <<<------------------------------------------------------------ */ /* PRQA S 2983,3203 ++ */ #include "misra.h" #include "m2cmex.h" static S16 test_1608a( S16 j ); static S16 test_1608a( S16 j ) { S16 r; r = j + 2; return; /* MISRA Violation */ } static test_1608b( void ) /* MISRA Violation - Rule 8.1 */ { /* MISRA Violation - Rule 8.2 */ return; /* MISRA Violation */ } static test_1608c( void ) /* MISRA Violation - Rule 8.1 */ { /* MISRA Violation - Rule 8.2 */ } /* MISRA Violation */ extern S16 test_1608( void ) /* MISRA Violation */ { S16 r; r = test_1608a( 1 ) + test_1608b() + test_1608c(); }