summaryrefslogtreecommitdiff
path: root/.travis/cmake-linux
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-27 15:51:41 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-09-08 22:08:34 +0000
commit93cc178cfedb281ad05f988850d601e600361d9a (patch)
tree095e8bb867b153fe363dd49b10ab512e2ac58ccf /.travis/cmake-linux
parentab4477d9315d6d62a449920a32099503c656f43a (diff)
Add tool to find directly recursive calls in toxcore.
We should avoid recursion, as it makes reasoning about stack growth harder. This tool shows (currently) 4 (non-tail) recursive functions, at least 2 of which are easy to fix.
Diffstat (limited to '.travis/cmake-linux')
-rwxr-xr-x.travis/cmake-linux7
1 files changed, 7 insertions, 0 deletions
diff --git a/.travis/cmake-linux b/.travis/cmake-linux
index fe5de10a..541eb014 100755
--- a/.travis/cmake-linux
+++ b/.travis/cmake-linux
@@ -53,8 +53,15 @@ travis_install() {
53} 53}
54 54
55run_static_analysis() { 55run_static_analysis() {
56 pylint -E other/analysis/check_recursion
57
56 export CPPFLAGS="-isystem $CACHEDIR/include" 58 export CPPFLAGS="-isystem $CACHEDIR/include"
57 export LDFLAGS="-L $CACHEDIR/lib" 59 export LDFLAGS="-L $CACHEDIR/lib"
60 cat toxav/*.c toxcore/*.c toxencryptsave/*.c \
61 | clang `pkg-config --cflags libsodium opus vpx` \
62 -Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \
63 | opt -analyze -print-callgraph 2>&1 \
64 | other/analysis/check_recursion
58 other/analysis/run-clang 65 other/analysis/run-clang
59 other/analysis/run-clang-analyze 66 other/analysis/run-clang-analyze
60} 67}