Skip to content
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

moved global CheckUnusedFunctions instance to CppCheck / cleaned up CheckUnusedFunctions interface #6013

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@@ -96,9 +96,9 @@ class TestUnusedFunctions : public TestFixture {

// Check for unused functions..
CheckUnusedFunctions checkUnusedFunctions;
checkUnusedFunctions.parseTokens(tokenizer, "someFile.c", settings1);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Another case of a language mismatch between tokenizing and usage.

@firewave
Copy link
Collaborator Author

Will file tickets for the --clang-related issues later.

@@ -560,6 +563,10 @@ unsigned int CppCheck::check(const std::string &path, const std::string &content

unsigned int CppCheck::check(const FileSettings &fs)
{
// TODO: move to constructor when CppCheck no longer owns the settings
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yet another case highlighting how all the current messes I am working on are woven together...

@firewave firewave marked this pull request as draft February 21, 2024 14:00
@firewave
Copy link
Collaborator Author

firewave commented Feb 21, 2024

This looks like a false positive:

lib/checkunusedfunctions.cpp:473:29: style:inconclusive: Boolean expression 'usage.usedOtherFile' is used in bitwise operation. [bitwiseOnBoolean]
        usage.usedOtherFile |= entry.second.usedOtherFile;
                            ^

If both sides are just a bool type it should be safe.

@firewave
Copy link
Collaborator Author

I filed https://trac.cppcheck.net/ticket/12455 about the bitwiseOnBoolean false positive.

@firewave firewave marked this pull request as ready for review February 21, 2024 18:58
@@ -0,0 +1,7 @@
static void f4_0() {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a gap in the test coverage which was uncovered by me not properly propagating all the data in an earlier version of these changes.

@firewave firewave changed the title moved "global" CheckUnusedFunctions instance to CppCheck / cleaned up CheckUnusedFunctions interface moved global CheckUnusedFunctions instance to CppCheck / cleaned up CheckUnusedFunctions interface Feb 22, 2024
@firewave firewave merged commit 8c90edb into danmar:main Feb 27, 2024
64 checks passed
@firewave firewave deleted the unused-xyz-2 branch February 27, 2024 15:51
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