Quote Originally Posted by matsp View Post
It doesn't sound to me as if it will actually give a warning for the above scenario still, since there is no loss of data in the conversin of int to unsigned int - they have the same number of bits, the only difference comes when you start using the value for comparisons - in all other aspects, it's the same.

--
Mats
On a bit level, yes they are the same, but on a numeric meaning they are very different, and the loss of data is the negative number flag. I've seen VC++ give warnings about signed/unsigned comparisons, so I can't see why it wouldn't warn you about this? Is this in the C++ standard because of some legacy C crap, or did they actually think it was a good idea?