Skip to content

Fix #12036 FN knownConditionTrueFalse comparing enum with number#5510

Merged
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix12036
Oct 5, 2023
Merged

Fix #12036 FN knownConditionTrueFalse comparing enum with number#5510
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix12036

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Any reason not to warn for known comparisons with enum values?

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Oct 5, 2023

Any reason not to warn for known comparisons with enum values?

Please elaborate.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

chrchr-github commented Oct 5, 2023

Well I changed those test cases where we previously wouldn't warn for e.g. if (Four == 4) {}.
I see no reason not to warn, since we do so for integer constants as well.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Oct 5, 2023

Well I changed those test cases where we previously wouldn't warn for e.g. if (Four == 4) {}. I see no reason not to warn, since we do so for integer constants as well.

Alright, I thought I missed something.

I don't see any reason not to warn either.

@chrchr-github chrchr-github merged commit 787da43 into cppcheck-opensource:main Oct 5, 2023
@chrchr-github chrchr-github deleted the chr_Fix12036 branch October 5, 2023 16:15
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