Should you correct compiler warnings about type conversions using explicit typecasts?
- by BastiBechtold
In my current project, the compiler shows hundreds of warnings about type conversions.
There is a lot of code like this
iVar = fVar1*fVar2/fVar3;
// or even
iVar = fVar1*fVar2/fVar3+.5f;
which intentionally assign float values to int.
Of course, I could fix these warnings using
iVar = int(...);
but that looks kind of ugly.
Would you rather live with the ugliness or live with the warnings?
Or is there even a clean solution?