Skip to content

Fix #13148 FN: constStatement (static_cast<void>(integer|nullptr|NULL))#8694

Merged
chrchr-github merged 6 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_13148
Jul 13, 2026
Merged

Fix #13148 FN: constStatement (static_cast<void>(integer|nullptr|NULL))#8694
chrchr-github merged 6 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_13148

Conversation

@chrchr-github

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testincompletestatement.cpp Outdated
Comment thread test/testincompletestatement.cpp Outdated
Comment thread test/testincompletestatement.cpp Outdated
"}\n");
ASSERT_EQUALS("[test.cpp:2:22]: (warning) Redundant code: Found a statement that begins with numeric constant. [constStatement]\n"
"[test.cpp:3:22]: (warning) Redundant code: Found a statement that begins with NULL constant. [constStatement]\n"
"[test.cpp:4:5]: (warning) Redundant code: Found a statement that begins with NULL constant. [constStatement]\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.

In this test case it just looks like a redundant statement , I wonder if the severity should be "style" instead. Are there bugs discovered by this checker or just code cleanup?

We could change the severity in a separate PR.

Comment thread lib/checkother.cpp Fixed
@danmar

danmar commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

I feel this should be a style severity instead but we can think about that with a separate PR.
If the motivation is to clean up code.

@chrchr-github chrchr-github merged commit 174a569 into cppcheck-opensource:main Jul 13, 2026
70 checks passed
@chrchr-github chrchr-github deleted the chr_13148 branch July 13, 2026 07:01
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.

4 participants