![]() |
![]() |
1267 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Casts | |||||||
A constant of floating type is being cast to a different floating type. Perhaps this is intended but be aware that the type of a floating constant depends on its suffix.
/*PRQA S 2017,3121,3198,3408,3447 ++*/
extern float fta;
extern double dba;
extern long double lda;
extern void foo(void)
{
fta = (float)12.34; /* Message 1268 */
fta = (float)12.34L; /* Message 1267 */
dba = (double)12.34F; /* Message 1267 */
dba = (double)12.34L; /* Message 1267 */
lda = (long double)12.34F; /* Message 1267 */
lda = (long double)12.34; /* Message 1268 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |