-
Notifications
You must be signed in to change notification settings - Fork 791
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
enable unusedFunction #1878
base: master
Are you sure you want to change the base?
enable unusedFunction #1878
Conversation
tests/misra/suppressions.txt
Outdated
@@ -15,6 +15,9 @@ unmatchedSuppression | |||
# All interrupt handlers are defined, including ones we don't use | |||
unusedFunction:*/interrupt_handlers*.h | |||
|
|||
# REGISTER_INTERRUPT defined in interrupt_handlers.h | |||
unknownMacro:*/gmlan_alt.h |
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.
why does this fix it?
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.
used this to suppress the unknownMacro error that was being generated. Nothing to do with the unusedFunction error. Need to figure out if this is a false positive.
tests/misra/test_misra.sh
Outdated
#printf "\n${GREEN}** UNUSED ALL CODE **${NC}\n" | ||
#cppcheck --enable=unusedFunction --quiet $PANDA_DIR/board/ | ||
printf "\n${GREEN}** UNUSED ALL CODE **${NC}\n" | ||
cppcheck --enable=unusedFunction --quiet $PANDA_DIR/board/main.c |
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.
hmm, also not sure how this works now. it needs to also analyze the bootstub and jungle builds
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.
Seems like a bug from cppchecker's side. All the unused function seems to have been be generated by board/main.c
as we can see in previous CI runs.
Running cppcheck $PANDA_OPTS -DSTM32H7 -DUID_BASE $PANDA_DIR/board/main.c $PANDA_DIR/board/jungle/main.c $PANDA_DIR/board/jungle/bootstub.c
also seems to remove the unused function error ( it also adds another unknownMacro
error )
We should also add a test case for panda/tests/misra/test_mutation.py Line 38 in 00fab5e
|
Not sure how the new test case is passing. It didn't catch either of these:
|
hmm.. defining pre-processor symbols like seems to invoke the unusedFunction error. Any particular reason you undefined it @adeebshihadeh ? Log:
|
H7 and F4 should be mutually exclusive. |
I guess we can add both cases to our misra tests since they generate slightly different results. |
for #1794