Skip to content

Fix #9997 False negative: variable is not used#4104

Merged
danmar merged 4 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix9997
Jun 7, 2022
Merged

Fix #9997 False negative: variable is not used#4104
danmar merged 4 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix9997

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github chrchr-github marked this pull request as draft May 11, 2022 21:41
@chrchr-github chrchr-github marked this pull request as ready for review May 11, 2022 23:02
Comment thread lib/programmemory.cpp
++indentlevel;
continue;
}
tok2 = cond->astParent()->previous();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this changed? If the condition is false we should be skipping the entire block.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah wait, I see, it's a dead store. Thats a bug. I think we need to continue here and not break. I think we can fix this in a later PR.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Also ran into this: https://trac.cppcheck.net/ticket/11063

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Is this ready to be merged?

@danmar danmar merged commit 69834d5 into cppcheck-opensource:main Jun 7, 2022
@chrchr-github chrchr-github deleted the chr_Fix9997 branch June 22, 2022 14:14
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.

3 participants