aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-25 01:29:36 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-25 01:29:36 -0400
commit63426f79cb152e2e4cb7fc355412cc82faf29d6b (patch)
tree3efecc4ed6644275a7a5f5030d79bf672ce7de90 /contrib
parentd3c05a79f0b3e688e43edfffe9886664777517f7 (diff)
downloadtor-63426f79cb152e2e4cb7fc355412cc82faf29d6b.tar
tor-63426f79cb152e2e4cb7fc355412cc82faf29d6b.tar.gz
Include the scan-build.sh script I used for 8793
Otherwise we'll never remember what to re-run before each release, or whether we tried a given checker.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/scan-build.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/scan-build.sh b/contrib/scan-build.sh
new file mode 100644
index 000000000..623b227fe
--- /dev/null
+++ b/contrib/scan-build.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+# Copyright 2014 The Tor Project, Inc
+# See LICENSE for licensing information
+#
+# This script is used for running a bunch of clang scan-build checkers
+# on Tor.
+#
+# It has hardwired paths for Nick's desktop at the moment.
+
+CHECKERS="\
+ --use-analyzer=/opt/clang-3.4/bin/clang \
+ -disable-checker deadcode.DeadStores \
+ -enable-checker alpha.core.CastSize \
+ -enable-checker alpha.core.CastToStruct \
+ -enable-checker alpha.core.IdenticalExpr \
+ -enable-checker alpha.core.SizeofPtr \
+ -enable-checker alpha.security.ArrayBoundV2 \
+ -enable-checker alpha.security.MallocOverflow \
+ -enable-checker alpha.security.ReturnPtrRange \
+ -enable-checker alpha.unix.SimpleStream
+ -enable-checker alpha.unix.cstring.BufferOverlap \
+ -enable-checker alpha.unix.cstring.NotNullTerminated \
+ -enable-checker alpha.unix.cstring.OutOfBounds \
+ -enable-checker alpha.core.FixedAddr \
+ -enable-checker security.insecureAPI.strcpy
+"
+
+/opt/clang-3.4/bin/scan-build/scan-build \
+ $CHECKERS \
+ --use-analyzer=/opt/clang-3.4/bin/clang \
+ ./configure
+
+/opt/clang-3.4/bin/scan-build/scan-build \
+ $CHECKERS \
+ --use-analyzer=/opt/clang-3.4/bin/clang \
+ make -j2
+
+
+# Haven't tried this yet.
+# -enable-checker alpha.unix.PthreadLock
+
+# This one gives a false positive on every strcmp.
+# -enable-checker alpha.core.PointerSub
+
+# This one hates it when we stick a nonzero const in a pointer.
+# -enable-checker alpha.core.FixedAddr
+
+# This one crashes sometimes for me.
+# -enable-checker alpha.deadcode.IdempotentOperations