I'm new in cppcheck. I just want to use it to check some coding style issue, for example,
a=b+c; // bad style and should give an message
a = b + c; // good style
can I enable cppcheck to do such check?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are some style checks in cppcheck, but its focus is certainly not on formatting issues.
I suggest to check out explicit coding style checkers, e.g. http://code.google.com/p/nsiqcppstyle/ (or maybe don't even check but try code formatters like astyle)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And even though you could add new checks as regexps, your example could not be detected, since checks are run after cppcheck has preprocessed the code, and put it's own spacing rules
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm new in cppcheck. I just want to use it to check some coding style issue, for example,
a=b+c; // bad style and should give an message
a = b + c; // good style
can I enable cppcheck to do such check?
There are some style checks in cppcheck, but its focus is certainly not on formatting issues.
I suggest to check out explicit coding style checkers, e.g. http://code.google.com/p/nsiqcppstyle/ (or maybe don't even check but try code formatters like astyle)
thanks
And even though you could add new checks as regexps, your example could not be detected, since checks are run after cppcheck has preprocessed the code, and put it's own spacing rules