-
Notifications
You must be signed in to change notification settings - Fork 8.4k
sca: Add cppcheck (FOSS and premium) #80961
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
base: main
Are you sure you want to change the base?
sca: Add cppcheck (FOSS and premium) #80961
Conversation
a1554b5 to
e8355ad
Compare
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
9db0694 to
b917536
Compare
d703fb8 to
c4e5050
Compare
8b98c73 to
de49dac
Compare
d417452 to
1ac676d
Compare
1ac676d to
4d89828
Compare
4d89828 to
228aa1d
Compare
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
@rettichschnidi Hi, there are some minor code fixes would it be possible to merge them separately into zephyr main branch soonish? |
|
@rettichschnidi for your information we have a customer that wants to run Cppcheck on a Zephyr project and the analysis is aborted because of the preprocessor errors. :-( |
|
@rettichschnidi I'll see if I have some luck to commit the UB fixes in the separate PR #92062 |
|
@danmar Sorry for not replying any sooner and thanks a lot. Feel free to take over the work, as I'll probably not get to it before late summer/autumn. |
|
@rettichschnidi no problem. my PR got merged so you can cleanup this PR.. :-) |
228aa1d to
0393bdf
Compare
|
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This commit adds cppcheck as a Static Analyser using Zephyr's SCA framework. By specifing -DZEPHYR_SCA_VARIANT=cppcheck to west build, the file sca/cppcheck/index.html will be generated. Signed-off-by: Reto Schneider <[email protected]>
0393bdf to
b4718ac
Compare
|
|
@danmar I am back on track, would be great if we could get this in shape to be merged. |
|
The relevant issue in Cppcheck/simplecpp to be resolved is this: danmar/simplecpp#549 |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
It will not be solved in Cppcheck-2.19 :-( Hope we can fix this in Cppcheck-2.20 |



This allows to use cppcheck directly, without going trough CodeChecker.
Warning: As of 2025-09-17, both, Cppcheck Premium as well as the latest FOSS Git version has problems with parsing the Zephyr code base.
Cppcheck Premium 25.8.2:
Cppcheck FOSS :
TODO:
-j <n>)include/zephyr/kernel/internal/mm.hBackground: I am doing this because I am currently evaluating Cppcheck Premium.