Export (0) Print
Expand All
Expand Minimize

Compiler Warning (levels 3 and 4) C4244

'conversion' conversion from 'type1' to 'type2', possible loss of data

An integer type is converted to a smaller integer type. This is a level-4 warning if type2 is int and type1 is smaller than int. Otherwise, it is a level 3.

C4244 can also fire at level 1; see Compiler Warning (level 1) C4244 for more information.

The conversion may have a problem due to implicit conversions.


// C4244.cpp
// compile with: /W4
int main()
   int b = 0, c = 0;
   short a = b + c;   // C4244

For more information, see Usual Arithmetic Conversions.

© 2014 Microsoft