-
Notifications
You must be signed in to change notification settings - Fork 461
Static Analysis
Developers are highly encouraged to use scan-build to check for various issues before the manifest themselves in defect reports. Please do this before submitting pull requests.
In many Linux distributions, scan-build is included with the clang
package.
Below is an example of how to run a scan against the bladeRF host code:
$ cd ~/projects/bladeRF/host/ $ mkdir -p build/scan $ cd build/scan $ cmake -DCMAKE_C_COMPILER=/usr/share/clang/scan-build/ccc-analyzer ../../ $ /usr/share/clang/scan-build/scan-build make clean all
When this completes, it will print instructions on how to view the defect reports, which will be html pages populated in a /tmp directory.
Coverity does not allow for public access to defect lists. However, it does allow project maintainers to grant registered Coverity users Contributor/Member, Contributer/Viewer, and Other/Observer permissions. You're more than welcome to the bladeRF Coverity scan results, all you have to do is ask! :)
- Download Coverity Scan from https://scan.coverity.com/download
- Extract and add the Coverity Scan tools to the path
- Add the FX3 compiler to the Coverity configuration
- `cov-configure --comptype gcc --compiler /opt/cypress/fx3_sdk/arm-2011.03/bin/arm-none-eabi-gcc`
- Replace /opt/cypress/fx3_sdk/arm-2011.03/bin/arm-none-eabi-gcc with wherever your FX3 SDK is installed
Always use the root level CMakeLists.txt to do a build, not the one in host. If you do a build in host, the fx3 sources will be removed from Coverity.
- cd to root of source tree (e.g. cd ~/bladeRF)
- `mkdir build`
- `cd build`
- `cmake ..`
- cd to root build folder (e.g. cd ~/bladeRF/build)
- `make clean`
- `rm -rf cov-int`
- `cov-build --dir cov-int make`
- `tar -czvf bladeRF.tgz cov-int/`
- The tarball can be manually submitted to the website, or you can automatically submit it via
- curl --form project=bladeRF --form token=PUT_YOUR_API_TOKEN_HERE--form email=PUT_YOU_EMAIL@HERE --form file=@bladeRF.tgz --form version=0.4.0 --form description=Description http://scan5.coverity.com/cgi-bin/upload.py