/* >>>------------------------------------------------------------ * * File: rule_11.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 11.1 (Required): * Conversions shall not be performed between a pointer to a * function and any type other than an integral type. * * Implemented by messages: * 302 [u] Cast between a pointer to function and a floating * type. * * 307 [u] Cast between a pointer to object and a pointer to * function. * * 313 Casting to different function pointer type. * * <<<------------------------------------------------------------ */ /* PRQA S 2983 ++ */ #include "misra.h" #include "m2cmex.h" typedef S32 ( *pif1 )( void ); typedef S16 ( *pif2 )( void ); extern S16 test_1101( void ) { pif1 pif32a = 0; pif2 pif16a; S32 *pi; f64a = (F64)pif32a; /* MISRA Violation */ pif32a = (pif1)f64a; /* MISRA Violation */ pi = (S32 *)pif32a; /* MISRA Violation */ pif32a = (pif1)pi; /* MISRA Violation */ pif16a = (pif2)pif32a; /* MISRA Violation */ pif32a = (pif1)pif16a; /* MISRA Violation */ return 1; }