[previous] 4462 [next] A non-constant expression of 'essentially floating' type (%1s) is being converted to narrower floating type, '%2s' on assignment.
Arithmetic type - Assignment

This message is issued whenever a non-constant expression of essentially floating type undergoes an assigning conversion to a narrower floating type.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 4462 --*/

void foo (float b);

float f4462 (double a)
{
  float fta = a;            /* 4462 */

  foo (a + 1.0);            /* 4462 */

  fta = (a - 1.0);          /* 4462 */

  return a;                 /* 4462 */
}

For the purposes of QA·C conversion messages, types are ordered according to the configured size (-s option), by default; hence if type float and type double are both implemented in 64 bits, the types will be considered equivalent. However, when the -strictrank option is specified, the types will be ordered according to their rank, and float will be considered narrower than double.

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