cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Suggestion for a new checker - Check Suspicious For Loop

Open rmaman4 opened this issue 3 years ago • 1 comments

Severity: Style Usually, the variable which is initialized in the for loop is the same variable we would like to use in the rest of the loop. When we write many lines of code or copying lines of code from one place to another, we may not pay attention to the variables inside the for loops. This checker is meant to help us avoiding this problem. By creating this checker, we wish to notify the user in case that the variable which is initialized in the for loop does not exist in the other parts of the loop.

rmaman4 avatar May 31 '22 07:05 rmaman4

Thanks for contributing. You should add some test cases to show for what code your new check warns or doesn't.

chrchr-github avatar May 31 '22 10:05 chrchr-github

Still no reply after more than six months - closing.

firewave avatar Jan 21 '23 15:01 firewave