Skip to content

selfcheck.yml: also run unusedFunction selfcheck without CLI (currently disabled) and GUI sources#6526

Merged
chrchr-github merged 5 commits into
cppcheck-opensource:mainfrom
firewave:self-unused
Jun 20, 2024
Merged

selfcheck.yml: also run unusedFunction selfcheck without CLI (currently disabled) and GUI sources#6526
chrchr-github merged 5 commits into
cppcheck-opensource:mainfrom
firewave:self-unused

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

This is to identify code which is only used by the CLI or GUI frontends and partially related to https://trac.cppcheck.net/ticket/12841.

But since we not do differentiate between functions with the same name but different arguments this will also reduce the amount of potential conflicts of such function and actually find some completely unused functions.

Comment thread lib/checkleakautovar.h
/** set possible usage for all variables */
void possibleUsageAll(const std::pair<const Token*, Usage>& functionUsage);

void print();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It looks like this was never used since its introduction in bd8fb0a.

@firewave
Copy link
Copy Markdown
Collaborator Author

The nocli seems to go too far for now and I will disable it but it seems to have exposed some false negatives (maybe even positives). I will also check all functions if they are actually used.

@firewave firewave changed the title selfcheck.yml: also run unusedFunction selfcheck without CLI and GUI sources selfcheck.yml: also run unusedFunction selfcheck without CLI (currently disabled) and GUI sources Jun 19, 2024
@firewave firewave force-pushed the self-unused branch 2 times, most recently from 789b0e6 to 95ffeb6 Compare June 19, 2024 23:51
@firewave firewave marked this pull request as ready for review June 20, 2024 12:39
TEST_CASE(xmlverinvalid);
TEST_CASE(doc);
TEST_CASE(docExclusive);
TEST_CASE(showtimeSummary);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was uncovered by the still disabled selfcheck with all sources enabled.

@chrchr-github chrchr-github merged commit 5c93df1 into cppcheck-opensource:main Jun 20, 2024
@firewave firewave deleted the self-unused branch June 20, 2024 22:00
Sign up for free to 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