OpenIoTAcademy / EmbeddedTemplate

Template Project For Embedded Projects
2 stars 2 forks source link

Tool : MISRA-C 2012 Checker #5

Open zaya-mc opened 4 years ago

alifiratari commented 4 years ago

We can use this repo (https://github.com/danmar/cppcheck) and can be use with Github Actions or Another CI tools.

An example cpptest tool output:

[test.cpp:5] -> [test.cpp:4]: (warning) Either the condition 'if(p)' is redundant or there is possible null pointer dereference: p.
[test.cpp:23]: (warning) Possible null pointer dereference: p
[test.cpp:33]: (warning) Possible null pointer dereference: p

There is a demo for testing : http://cppcheck.sourceforge.net/demo/

Missing checks for MISRA C 2012 Compliance : http://cppcheck.sourceforge.net/misra.php

zaya-mc commented 4 years ago

https://www.synopsys.com/content/dam/synopsys/sig-assets/datasheets/coverity-misra-standards-ds-ul.pdf

zaya-mc commented 4 years ago

Guys, the Coverity should be de best option while it is also free for open source projects if you can have a look at, it would be great.

Just I am wondering can we somehow use it in our local PCs.

For example, I am using SPLint/PC-Lint for static analysis but it is an EXE so we can run in my local but Coverity may need us to upload the code to their servers.

You might test a run : https://scan.coverity.com/