Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix for unusedFunction
  • Loading branch information
0x41head committed Feb 18, 2024
commit bc1c597c295f0e9fd160134a2d43da1020309979
3 changes: 3 additions & 0 deletions tests/misra/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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.


# all of the below suppressions are from new checks introduced after updating
# cppcheck from 2.5 -> 2.13. they are listed here to separate the update from
# fixing the violations and all are intended to be removed soon after
Expand Down
4 changes: 2 additions & 2 deletions tests/misra/test_misra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ printf "\n${GREEN}** PANDA H7 CODE **${NC}\n"
cppcheck $PANDA_OPTS -DSTM32H7 -DUID_BASE $PANDA_DIR/board/main.c

# unused needs to run globally
#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 --check-library $PANDA_DIR/board/main.c

printf "\n${GREEN}Success!${NC} took $SECONDS seconds\n"