[previous] 1262 [next] Unsuffixed floating constant implicitly converted to different floating type.
Arithmetic type - Balancing

A constant of type double is being implicitly converted to type long double in a balancing operation. Perhaps the constant should be rewritten with an L suffix ? The suffixes for floating constants are: F for float and L for long double; an unsuffixed constant is of type double.

For example:


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

extern double      dba;
extern long double lda;

extern void foo(void)
{
    dba + 5.0F;                /* Message 1261 */
    lda + 5.0F;                /* Message 1261 */

    lda + 5.0 ;                /* Message 1262 */
}

See also:

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