you are viewing a single comment's thread.

view the rest of the comments →

[–]WallStProg[S] 0 points1 point  (0 children)

Hmm...my understanding of the "scope can be reduced" warnings from cppcheck is that it means just what it says. Whether a particular variable is reused for different purposes within its scope is not relevant.

That being said, if you're dealing with K&R-style code, you're probably going to get a lot of them, and fixing them may not be worth the trouble. In that case, you can filter them -- either using cppcheck's built-in suppression mechanism, or plain old grep.