Fix #12172:False positive: misra-11.1 function pointer assigned to array#5667
Merged
danmar merged 1 commit intocppcheck-opensource:mainfrom Nov 16, 2023
Merged
Conversation
danmar
reviewed
Nov 16, 2023
| void *misra_11_1_bad1 = (void*)misra_11_1_p; // 11.1 8.4 | ||
|
|
||
| // #12172 | ||
| typedef void (*pfFunc)(uint32_t some); |
Collaborator
There was a problem hiding this comment.
it's unfortunate to write such generic type/variable names in the global scope in this misra-test.c. There are lots of variables, types and functions and we don't want to have any duplicates. Did you check in the whole file that there is no other function f or global array data. Next time you need to add an array or function what will you call it instead of data or f.
ensure that they are more unique.
I have used the convention to append _11_1 for names in global scope that apply to testing of rule 11.1. So please follow that convention. pfFunc_11_1 , data_11_1 and f_11_1
39dd29f to
06d107a
Compare
06d107a to
a8bbc1f
Compare
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.
No description provided.