Open esabol opened 6 years ago
The clang static analyzer generates a bunch of HTML output files with more verbose information. Unfortunately, I haven't figured out a way to get them out of Travis CI and put them somewhere that's visible. Any suggestions?
For reference, here is how I modified the .travis.yml
file:
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,11 @@ matrix:
artifacts: true
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
+ script:
+ - ./bootstrap.sh -a
+ - scan-build -v --use-cc="${CC}" --use-c++="${CXX}" ./configure --enable-ssl
+ - scan-build -v --use-cc="${CC}" --use-c++="${CXX}" make
+ - make test
- compiler: gcc
addons:
apt:
Based on some examples I saw, I added -enable-checker core -enable-checker unix -enable-checker cplusplus -enable-checker security
arguments to scan-build
. That resulted in a few more warnings, mainly about strcpy()
usage at first glance. The full build log can be found at:
https://travis-ci.org/esabol/gearmand/builds/461609044
Another reference: https://clang-analyzer.llvm.org/faq.html
Do you think enhancement tag would be enough for the issue, @esabol?
Do you think enhancement tag would be enough for the issue, @esabol?
I'm not sure how to categorize this, but that sounds fine.
References: https://clang-analyzer.llvm.org/scan-build.html https://www.mankier.com/1/scan-build
Over in my fork, I added
scan-build -v --use-cc="${CC}" --use-c++="${CXX}"
prior to the./configure
andmake
lines to the clang-5.0 build in Travis CI. Here are the resulting warnings:At first glance, a lot of these warnings seem very spurious. Some of the "Potential leak of memory" warnings might be worth investigating, but I'm not seeing any glaring bugs. Any comments?