Possible Duplicate:
g++ -Wall not warning about double-> int cast
Per the question here, direct conversion from double/float to unsigned integer is not portable. I found I had a few cases in my code where this happens and I would like to tell g++ to warn me if this occurs, but I can't find such an option. Does anyone know if there is an option to do this?
Note: I do see -Wconversion, but that also warns about all kinds of other conversions that I don't care about (like converting int to unsigned int, which is portable per the standard).
Edit: Here's a code example for which I would like to see a warning:
double dblNumber = -234;
unsigned long uintNumber = dblNumber;
On one version of g++, this gives me an integer value of 0xFFFFFF16 (which is -234 in 2's complement) . On another it gives me 0. Clearly the code is ambiguous, which is why it is understandably not considered portable.