Fix #12079: Misra: calling unknown function in condition => false pos…#5568
Merged
danmar merged 1 commit intocppcheck-opensource:mainfrom Oct 19, 2023
Merged
Conversation
danmar
reviewed
Oct 17, 2023
7a8a33b to
774766d
Compare
danmar
reviewed
Oct 18, 2023
af151d7 to
3c46935
Compare
danmar
reviewed
Oct 19, 2023
3c46935 to
f454d92
Compare
…itive 14.4, missing misra-config warning
f454d92 to
1e721c2
Compare
danmar
approved these changes
Oct 19, 2023
Collaborator
danmar
left a comment
There was a problem hiding this comment.
If CI pass I feel this can be merged.
dzid26
reviewed
Jun 6, 2024
| if w['message'].endswith('[-Wimplicit-function-declaration]'): | ||
| self.reportError(cppcheckdata.Location(w), 17, 3) | ||
| for token in cfg.tokenlist: | ||
| if token.str not in ["while", "if"]: |
Contributor
There was a problem hiding this comment.
Why is misra-17.3 only checked inside if/while condition ?
Collaborator
There was a problem hiding this comment.
it was probably to avoid some false positives. But it's not a good heuristic.
We don't assume that cppcheck users provide the include paths for standard headers. And the misra.py addon does not load std.cfg file.
Contributor
There was a problem hiding this comment.
Yeah, I noticed misra addon treated __typeof__ extension as a function and it was only reported when inside if( ) condition.
Loading Gnu.cfg library also was not helping as it misra addon also doesn't know typeof() .
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…itive 14.4, missing misra-config warning