-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix ErrorMessage parsing of XML Symbol Names #7277
base: main
Are you sure you want to change the base?
Fix ErrorMessage parsing of XML Symbol Names #7277
Conversation
XML-cached errors containing multiple symbol names are not stored correctly in the internal string data member with newline delimiters. This results in the symbol names becoming concatenated. As a result, suppressing them breaks when those cached files are used instead of full analysis.
Thanks for your contribution. This lacks tests. I think you "just" need to extend the tests added in #7142. |
Since this involves the builddir we also need to add a Python test which generates cached data with such messages. It is possible that a case involving this already exists and it still fails with the changes in #7079 but I do not remember such. I have not checked all failures in that other PR yet because there are still open known issues related to it. How did you come across this? Is there a message with multiple symbols in Cppcheck already (I did not check yet) or did you add one by yourself? |
Working on adding a python test as well to the other_test.py file, unless you would like it placed somewhere else. Came across this when I added a XML suppression file to an existing workflow that had a build-dir already. I suppressed errors for duplicate members by exact symbol name and the first pass with cppcheck showed them properly hidden. However, on a subsequent run, the errors re-appeared in unchanged files. After looking at it closer, I noticed the symbol field seemed weirdly concatenated (ex: "MyFirstClassMyFunctionMySecondClass") which would explain the suppressions not getting applied. Applying this change to the 2.16 version of the code base shows the behavior fixed. One ID for an error that can have multiple symbols is "duplInheritedMember". |
No, that is the current grab bag for random tests.
Right, suppressions can have symbols. I had a quick look and it seemed you cannot set those externally so I did have a deeper look. It is possible those are currently not tested at all. But that does not need to be resolved in this PR. |
FYI after #5647 has been merged I might be looking into this (or at least writing some tests) in my ongoing suppression work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks fine but I want some testing.. as you already have discussed.
XML-cached errors containing multiple symbol names are not stored correctly in the internal string data member with newline delimiters. This results in the symbol names becoming concatenated. In turn, suppressing them does not work when those cached files from the build directory are used instead of full analysis.