This one I only happen to catch a) because it is a method I hadn't utilitzed in my project yet and. b) because there was another style or performance results that pointed within the scope of this for loop. But clearly this is a good candidate for a proper 'infinite loop' result of some kind.
I do not think there is anything to warn about in the shown code, sometimes there are different variables in a for loop statement by intention.
but well if we looked at the code in the loop also we might see that the looping is redundant or something. Redundant stuff is something I feel we can write a stylistic message about.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I hear you. If cppcheck isn't tracking how "p" would not change for however many times "i" needs to do something, I can see how that might be valid. (I thought if "p" is used as the vector index, and p is never changed in the scope of the loop, perhaps this would be a good warning)
Thanks for looking at it!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This one I only happen to catch a) because it is a method I hadn't utilitzed in my project yet and. b) because there was another style or performance results that pointed within the scope of this for loop. But clearly this is a good candidate for a proper 'infinite loop' result of some kind.
I caught this 'manually' while the result indicated a line within the for loop scope.
'Hope that helps.
I do not think there is anything to warn about in the shown code, sometimes there are different variables in a for loop statement by intention.
but well if we looked at the code in the loop also we might see that the looping is redundant or something. Redundant stuff is something I feel we can write a stylistic message about.
Thanks for the suggestion! Feel free to suggest more stuff if you see some bugs..
I hear you. If cppcheck isn't tracking how "p" would not change for however many times "i" needs to do something, I can see how that might be valid. (I thought if "p" is used as the vector index, and p is never changed in the scope of the loop, perhaps this would be a good warning)
Thanks for looking at it!
yeah. I created https://trac.cppcheck.net/ticket/9744 and https://trac.cppcheck.net/ticket/9745