[previous] 1263 [next] Floating constant causes implicit conversion of other (integral) operand.
Arithmetic type - Balancing

An operand of integral type is being implicitly converted to a floating type because the other operand of this balancing operation is a constant of floating type. Perhaps a cast should be introduced ?

For example:


/*PRQA S 2017,3112,3121,3408,3447 ++*/

extern int sia;

extern void foo(void)
{
    sia + 1.23F;                /* Message 1263 + 3763 - Implicit conversion: int to float       */
    (float)sia + 1.23F;

    sia + 1.23 ;                /* Message 1263 + 3764 - Implicit conversion: int to double      */
    (double)sia + 1.23 ;

    sia + 1.23L;                /* Message 1263 + 3765 - Implicit conversion: int to long double */
    (long double)sia + 1.23L;
}


No MISRA C:2012 Rules applicable to message 1263


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents