/* >>>------------------------------------------------------------ * * File: rule_10.4.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 10.4 (Required): * The value of a complex expression of floating type shall only * be cast to a floating type that is narrower or of the same size. * * Implemented by messages: * 4392 A composite expression of 'essentially floating' type * (%1s) is being cast to a wider floating type, '%2s'. * * 4395 A composite expression of 'essentially floating' type * (%1s) is being cast to a different type category, '%2s'. * * <<<------------------------------------------------------------ */ /* PRQA S 2982 ++ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1004( void ) { f32a = ( F32 )( f64a + f64b ); f64a = ( F64 )f32a; f64a = ( F64 )( f32a + f32b ); /* MISRA Violation */ f128a = ( F128 )( f32a + f32b ); /* MISRA Violation */ f128a = ( F128 )( f64a + f64b ); /* MISRA Violation */ s16a = (S16)(f32a + f32b); /* MISRA Violation */ return 0; }