-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix #11842 FN constParameterPointer with library function #5257
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
Merged
chrchr-github
merged 40 commits into
cppcheck-opensource:main
from
chrchr-github:chr_Fix11842
Aug 5, 2023
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
02a86e0
Fix #11842 FN constParameterPointer with library function
chrchr-github e297190
const
chrchr-github 8b89852
const
chrchr-github 0843ce9
suppress
chrchr-github 1907388
suppress, fix
chrchr-github ea15f12
const
chrchr-github fd55133
Use getOverloadedFunctions()
chrchr-github 47c5485
Comment
chrchr-github 597cfa5
const
chrchr-github 3463e48
const
chrchr-github 36cd2fe
Merge
chrchr-github 115cc01
const
chrchr-github bfb8afa
Delete
chrchr-github 7bd1cd6
const / suppress
chrchr-github a270b79
const
chrchr-github 4d267e6
const
chrchr-github 726dc1d
const
chrchr-github 0418a53
const
chrchr-github 6a19d3f
const
chrchr-github ae8befb
const
chrchr-github c953763
const
chrchr-github 9f84088
const
chrchr-github c956233
const
chrchr-github 846de59
const
chrchr-github 489b17c
const
chrchr-github 99b3caa
const
chrchr-github 46c59f7
const
chrchr-github b8b067b
const
chrchr-github 9b85ae7
const
chrchr-github 907b248
const
chrchr-github d8f17e6
Fix cfg
chrchr-github 8ce46a7
unsuppress
chrchr-github 4b406da
const
chrchr-github dc8eba9
Revert "Delete"
chrchr-github d7b238a
Merge branch 'danmar:main' into chr_Fix11842
chrchr-github f915148
undo
chrchr-github 9e0734d
Merge branch 'chr_Fix11842' of https://github.com/chrchr-github/cppch…
chrchr-github 80072c1
undo
chrchr-github e090a11
Fix cfg
chrchr-github e900fce
Merge branch 'chr_Fix11842' of https://github.com/chrchr-github/cppch…
chrchr-github File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this logic should be in
isVariableChangedByFunctionCall, but I wonder why we skip it when the parent is a cast.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this test:
Seems not ideal though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isVariableChangedByFunctionCall()already has handling for library functions, but it is not quite aligned withgetTokenArgumentFunction()(constructors, init lists).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have an issue to track that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only rely on
isVariableChangedByFunctionCall(), there would be FPs for those:I'm not convinced that
isVariableChangedByFunctionCall()should returntruehere.