/* >>>------------------------------------------------------------ * * File: rule_20.4.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 20.4 (Required): * Dynamic heap memory allocation shall not be used. * * Implemented by message: * 5118 Dynamic heap memory allocation shall not be used. * * <<<------------------------------------------------------------ */ /* PRQA S 2983 ++ */ #include #include "misra.h" #include "m2cmex.h" #define L 4U extern S16 test_2004( void ) { S8 *p; p = ( S8 * )malloc( L ); /* MISRA Violation */ free( p ); /* MISRA Violation */ p = ( S8 * )calloc( 10U, L ); /* MISRA Violation */ p = ( S8 * )realloc( p, L ); /* MISRA Violation */ return 0; }