Open llvmbot opened 11 years ago
That's mostly what I meant. It's a checker whose usefulness is strongly dependent on the conventions and style guidelines of a particular codebase. I'll add it to the potential checkers list.
I'm not sure what you mean by a "style checker".
This is a check that many people might not want and so should be disabled by default, but I think it would be valuable to have as an option.
This is /definitely/ a style checker, since in LLVM at least we often use temporary variables just to break up large expressions. Marking local variable const could certainly be considered good practice, but it's not something people do often, especially not for pointers.
assigned to @tkremenek
Extended Description
I think if it would be nice if the following reported some kind of error:
int foo() { int i = 0;
}
where a variable is never modified (to me, this indicates that some code that modified the variable is missing). If the variable is really not supposed to change, the user can declare it as "const" (or use a #define).