In Visual C ++ 2012, the code
double d = 0.5; float f = d; int i = f;
gives 2 warnings for me:
test.cpp(26): warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data test.cpp(27): warning C4244: 'initializing' : conversion from 'float' to 'int', possible loss of data
I want to suppress the first warning, which I consider to be spam, but keep the second warning, which I find very useful. Is it possible to suppress one and save the other? Do people generally just crush them all? We had a bad mistake, in which we mistakenly transmitted a double melt. But we, tons of our math code, will trigger double swimming warnings.
source share