Skip to content

Fix #8159 FN unusedFunction: sole recursive call#6517

Merged
chrchr-github merged 12 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_8159
Jun 16, 2024
Merged

Fix #8159 FN unusedFunction: sole recursive call#6517
chrchr-github merged 12 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_8159

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@@ -180,7 +181,7 @@ class TestUnusedFunctions : public TestFixture {
" if (cond) ;\n"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe also add the missing cond variable when fixing this up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah - too late.

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.

cond could be an unknown global variable.
The return2() test is not compilable though.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

chrchr-github commented Jun 12, 2024

Do we want to keep MathLib::isDigitSeparator()? It's only used in tests.
clangimport::AstNode::dumpAst() has a deactivated call somewhere. Should we remove that?
Token::astStringZ3() is useful for testing.

@firewave
Copy link
Copy Markdown
Collaborator

Do we want to keep MathLib::isDigitSeparator()? It's only used in tests.

The logic was apparently moved to simplecpp in 03d2829 shortly after it was added in 3095f47. So we should remove it.

clangimport::AstNode::dumpAst() has a deactivated call somewhere. Should we remove that? Token::astStringZ3() is useful for testing.

Add suppressions for these for now with comments which indicate how they are (not) used.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

We have a bunch of code that deals with "markup files". Is this tested explicitly anywhere?

@firewave
Copy link
Copy Markdown
Collaborator

We have a bunch of code that deals with "markup files". Is this tested explicitly anywhere?

That is tested in test/cli/qml_test.py.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

We have a bunch of code that deals with "markup files". Is this tested explicitly anywhere?

That is tested in test/cli/qml_test.py.

I see, thanks. That's one of the reasons for using strings to identify functions instead of Function*. More reasons are templates, and multiple file handling.

@chrchr-github chrchr-github merged commit 750b914 into cppcheck-opensource:main Jun 16, 2024
@chrchr-github chrchr-github deleted the chr_8159 branch June 16, 2024 09:10
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