-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codecheck: 'const' for a literal parameter ... does not catch all instances #1622
Comments
I get this one all the time. This false positive is sooo annoying… E.g.: 8c502ef @ https://travis-ci.org/github/widelands/widelands/jobs/734548358#L3627 |
It's not a false positive - the rule is performing there as it's intended to do. I don't know what motivated this rule though. @SirVer do you remember? |
It is a false positive when it catches the definition as well as the declaration. There is no reason why I shouldn't be allowed to make a literal parameter |
It seems the main problem is that it checks line by line, so it cannot distinguish declarations from definitions when they span multiple lines. Perhaps it shouldn't match any lines that don't end with a |
+1 for restricting it to .h files. Sorry, I overlooked that it was in a .cc file.
Difficult for long function signatures that span multiple lines. We'd need to rewrite the rule to support multiline. |
In this function:
I will get the following codecheck error:
'const' for a literal parameter is an implementation detail. Remove the const from the interface definition.
However, with this function:
no error is triggered.
Imported from Launchpad using lp2gh.
The text was updated successfully, but these errors were encountered: