Fix #14471: Improve check: shadowVariable for function argument#8303
Fix #14471: Improve check: shadowVariable for function argument#8303ludviggunne wants to merge 8 commits intocppcheck-opensource:mainfrom
Conversation
8d1541b to
a5e4899
Compare
|
This should allow us to enable |
55fc5b2 to
a005907
Compare
|
Since this now reports shadowed functions the error ID is misleading. We probably need a new ID. |
The error ID does differ actually, e.g. |
Ah, sorry. I just went by the title of the PR and did not look at the code. |
fc03706 to
eeb3eec
Compare
|
|
Related premium issue: |
| shadowFunction:externals/simplecpp/simplecpp.cpp | ||
| shadowFunction:externals/simplecpp/simplecpp.h |
There was a problem hiding this comment.
Would be great if you could publish an upstream PR which fixes these so we can drop the suppressions on the next bump.
There was a problem hiding this comment.
I checked and we have -Wshadow-field from Clang enabled in simplecpp. And -Wshadow from GCC only reports shadowing in constructors (as expected), so I am curious about these.
| * @param tok A '(' or ')' token in a possible function head | ||
| * @param endsWith string after function head | ||
| * @param end string after function head | ||
| * @return token matching with endsWith if syntax seems to be a function head else nullptr |
There was a problem hiding this comment.
Rename endsWith here in the @return also
| /** | ||
| * is token pointing at function head? | ||
| * @param tok A '(' or ')' token in a possible function head | ||
| * @param endsWith string after function head |
There was a problem hiding this comment.
hmm would suffix be better
| void setArrayDimensionsUsingValueFlow(); | ||
|
|
||
| void clangSetVariables(const std::vector<const Variable *> &variableList); | ||
| void clangSetVariables(const std::vector<const Variable *> &list); |
There was a problem hiding this comment.
maybe we can rename it to "vars" instead.
| * @param recheckFiles files to recheck, empty => check all files | ||
| * @param checkLibrary Flag to indicate if the library should be checked. | ||
| * @param checkConfiguration Flag to indicate if the configuration should be checked. | ||
| * @param doCheckLibrary Flag to indicate if the library should be checked. |
There was a problem hiding this comment.
to me the "do" prefix makes it sound more like a function. how about renaming the parameters to checkConfig and checkLib instead.
| } | ||
|
|
||
| void CheckCondition::compareValueOutOfTypeRangeError(const Token *comparison, const std::string &type, MathLib::bigint value, bool result) | ||
| void CheckCondition::compareValueOutOfTypeRangeError(const Token *comp, const std::string &type, MathLib::bigint value, bool result) |



No description provided.