I got warning:
Pe186 "Pointless comparison of unsigned int with zero"
when I tried to compile the following code:
for(clLoop = cpLoopStart; clLoop >= 0; clLoop--)
{
//Do something
}
I don't understand why. I could understand, if I were looking for a value less than zero, since an unsigned int
can never be negative. But all I am looking for here is if it is equal to zero, which an unsigned int
certainly can be.
I could even see this error if in this loop I tried to pre-decrement instead of post-decrement, but again that is not the case.
while (clLoop--) { ... }
is much better. – Leclair