I have the following code :
unsigned int a;
if (a > numeric_limits<int>::max())
do_stuff();
When compiling, gcc complains about
warning: "comparison between signed and unsigned"
OK, I understand
But, with the following code :
unsigned int a;
if (a > (numeric_limits<int>::max()))
do_stuff();
The warning is no longer displayed and I really don't know why... Is there any logical reason for such a behavior or am I doing something wrong?!
It's because it is a bug. See bug 50012
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With