/* >>>------------------------------------------------------------ * * File: rule_17.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 17.1 (Required): * Pointer arithmetic shall only be applied to pointers that * address an array or array element. * * Implemented by messages: * 2930 Constant: Computing an invalid pointer value. * * 2931 Definite: Computing an invalid pointer value. * * 2932 Apparent: Computing an invalid pointer value. * * <<<------------------------------------------------------------ */ /* PRQA S 488,2982,2983,3447 ++ */ #include "misra.h" #include "m2cmex.h" extern S16 glob; extern S16 lot[10]; extern S16 test_1701( void ) { S16 *p; p = &lot[20]; /* MISRA Violation */ p = &glob; p = p + 10; /* MISRA Violation */ if (glob > 10) { } p = &lot[glob]; /* MISRA Violation */ return 0; }