[previous] 1274 [next] Unsuffixed floating constant causes implicit conversion of other (floating) operand.
Arithmetic type - Balancing

An unsuffixed floating constant is an operand of a balancing operation and is causing the other operand (of type float) to be implicitly converted to type double. An unsuffixed floating constant is of type double. Perhaps an F suffix should be added ?

For example:


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

extern float       fta;
extern double      dba;

extern void foo(void)
{
    fta + 5.0 ;                /* Message 1274 */
    fta + 5.0F;                /*              */

    fta + 5.0L;                /* Message 1275 */
    fta + 5.0F;                /*              */

    dba + 5.0L;                /* Message 1275 */
    dba + 5.0 ;                /*              */
}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents