-
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
generate ctu-info from FileSettings for whole project analysis #6499
Conversation
6f3ecc2
to
8983636
Compare
There can only be either the files or the FileSettings. They will never be provided both. This is a pending refactoring. We also need tests for this. Right now I cannot remember if I already started adding those. |
Which is why only one of those for loops would execute. I couldn't figure out how ctus can be combined from multiple file configuration analyses. In any case, I am looking forward to see whole system addons to work with |
The change is fine. I did introduce the TODO but didn't fix it yet because I did't (actually don't) understand the whole program analysis fully. And we were most likely missing tests for. |
Now that I have written a test for this I filed https://trac.cppcheck.net/ticket/12839 for tracking this. |
My fix doesn't work great with different configurations though. But neither the current cppcheck with With my fix swapping the order of the .json file entries changes the outcome. This is because ctu-infos are deleted between runs, so addon doesn't have whole project information. E.g.
produces:
But if I swap the order of json:
I get errors reported:
So really the last configuration is what is being reported for the "whole program". Link to testscases covering the issue: #6551 |
Less confusing dots.
46b723b
to
367e2cf
Compare
Yes, configurations do not work properly. But let's take this one step at a time and use a test-driven approach. I am pretty sure there might be more shortcomings with configurations. I already have a few more tests for the whole program analysis which I will publish after the current PR and the fix for the initial issues have been merged. |
I published a PR incorporating part of your changes with #6525. |
It would be great if you could turn the example you provided earlier into a Python test. Same for any other shortcomings you might be aware of. I still have another PR upcoming after this so maybe wait for that to be merged. |
Partially fixes https://sourceforge.net/p/cppcheck/discussion/general/thread/1911a624d8/ - for multiple configurations only the last one is analyzed. There still needs to be some way of generating and handling multiple ctu for the same file.