Skip to content

removed CppCheck dependency from CppCheckExecutor::parseFromArgs() - #4967

Merged
firewave merged 2 commits into
cppcheck-opensource:mainfrom
firewave:cmd-cppcheck
Apr 16, 2023
Merged

removed CppCheck dependency from CppCheckExecutor::parseFromArgs()#4967
firewave merged 2 commits into
cppcheck-opensource:mainfrom
firewave:cmd-cppcheck

Conversation

@firewave

@firewavefirewave commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator

That function is basically just parsing the command-line options into the settings so no need for a CppCheck object yet. Also moved the object down to the actual usage.

Preparation for moving the Settings ownership out of CppCheck in #4964.

@firewave
firewave marked this pull request as draft April 14, 2023 10:49
@firewavefirewave changed the title removed CppCheck dependency from CppCheckExecutor::parseFromArgs()relaxed CppCheck dependencies in CppCheckExecutorApr 14, 2023
@firewave
firewave marked this pull request as ready for review April 14, 2023 10:59
@firewavefirewave mentioned this pull request Apr 14, 2023
Comment threadcli/cppcheckexecutor.cpp Outdated
}

CppCheck cppcheck(*this, true, executeCommand);
cppcheck.settings() = settings; // this is a copy

@firewavefirewaveApr 14, 2023

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This highlights the issue I want to resolve by moving the ownership out of CppCheck. We need to propagate back all the changes from the settings attached to CppCheck. In some cases we are not doing this correctly. This is why the settings should be immutable during the analysis so we don't have to do that.

Also we do that copy for each file with the multi-threaded implementation which is a hot spot if there are many libraries loaded.

@firewavefirewave changed the title relaxed CppCheck dependencies in CppCheckExecutorremoved CppCheck dependency from CppCheckExecutor::parseFromArgs()Apr 14, 2023
@firewave

Copy link
Copy Markdown
CollaboratorAuthor

I backed out the further refactoring as it doesn't work until the ownership has been changed.

Comment threadcli/cppcheckexecutor.cpp
@firewave
firewave merged commit 9ad26f5 into cppcheck-opensource:mainApr 16, 2023
@firewave
firewave deleted the cmd-cppcheck branch April 16, 2023 11:54
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@firewave@danmar