I got warning:
Pe186 \"Pointless comparison of unsigned int with zero\"
when I tried to compile the following code:
As already stated by others unsigned int is always >= 0 i.e. pointless comparison. Mayank Jindal posted for me the starting point for a solution.
To document the "fix" as a whole: do the following instead, this works as intended:
unsigned int cpLoopStart = 23U;
unsigned int clLoop = 0U;
for(clLoop = cpLoopStart; clLoop > 0U; clLoop--}
{
//Do something
}
clLoop will start at 23 and end at 1 then exits the loop. I hope it was intended that clLoop will never be 0 inside the loop.
I also prefer to append "U" for unsigned typed values, this makes is clearer also when comparing values and variables.