/* >>>------------------------------------------------------------ * * File: rule_9.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 9.1 (Required): * All automatic variables shall have been assigned a value before * being used. * * Implemented by messages: * 2883 This 'goto' statement will always bypass the * initialization of local variables. * * 2961 Definite: Using value of uninitialized automatic object * '%s'. * * 2962 Apparent: Using value of uninitialized automatic object * '%s'. * * 2971 Definite: Passing address of uninitialized object '%s' * to a function parameter declared as a pointer to const. * * 2972 Apparent: Passing address of uninitialized object '%s' * to a function parameter declared as a pointer to const. * * <<<------------------------------------------------------------ */ /* PRQA S 2983,3447 ++ */ #include "misra.h" #include "m2cmex.h" extern S16 test_0901a( const S16 *p ); extern S16 test_0901( void ) { S16 a; S16 b; S16 c; S16 d; S16 e; S16 r; r = a; /* MISRA Violation */ if ( s16a > 0 ) { b = s16a; e = s16a; } r = r + b; /* MISRA Violation */ c = test_0901a( &d ); /* MISRA Violation */ d = 1; c += test_0901a( &e ); /* MISRA Violation */ return r + c + d; }