Update scan-build call.
authorEmil Mikulic <emikulic@gmail.com>
Mon, 28 Mar 2016 03:50:18 +0000 (14:50 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Mon, 28 Mar 2016 03:50:18 +0000 (14:50 +1100)
dev_analyze.sh

index 84c67b4..1406278 100755 (executable)
@@ -1,15 +1,42 @@
-#!/bin/sh -x
+#!/bin/bash -x
 #
 # Run the clang static analyzer.
 #
 #
 # Run the clang static analyzer.
 #
-TARGET=dev_all.c
-
-# Adjust to suit:
-LLVM=$HOME/llvm
-CHECKER=$LLVM/llvm/tools/clang/tools/scan-build/ccc-analyzer
-CLANG=$LLVM/install/bin/clang
-
-$LLVM/llvm/tools/clang/tools/scan-build/scan-build \
+time $HOME/llvm/install/bin/scan-build \
   -analyze-headers \
   -analyze-headers \
-  --use-analyzer=$LLVM/install/bin/clang \
-  $CLANG -c $TARGET
+\
+  -enable-checker alpha.core.BoolAssignment \
+  -enable-checker alpha.core.CallAndMessageUnInitRefArg \
+  -enable-checker alpha.core.CastSize \
+  -enable-checker alpha.core.CastToStruct \
+  -enable-checker alpha.core.DynamicTypeChecker \
+  -enable-checker alpha.core.FixedAddr \
+  -enable-checker alpha.core.IdenticalExpr \
+  -enable-checker alpha.core.PointerArithm \
+  -enable-checker alpha.core.PointerSub \
+  -enable-checker alpha.core.SizeofPtr \
+  -enable-checker alpha.core.TestAfterDivZero \
+  -enable-checker alpha.cplusplus.VirtualCall \
+  -enable-checker alpha.deadcode.UnreachableCode \
+  -enable-checker alpha.security.ArrayBound \
+  -enable-checker alpha.security.ArrayBoundV2 \
+  -enable-checker alpha.security.MallocOverflow \
+  -enable-checker alpha.security.ReturnPtrRange \
+  -enable-checker alpha.security.taint.TaintPropagation \
+  -enable-checker alpha.unix.Chroot \
+  -enable-checker alpha.unix.PthreadLock \
+  -enable-checker alpha.unix.SimpleStream \
+  -enable-checker alpha.unix.Stream \
+  -enable-checker alpha.unix.cstring.BufferOverlap \
+  -enable-checker alpha.unix.cstring.NotNullTerminated \
+  -enable-checker alpha.unix.cstring.OutOfBounds \
+  -enable-checker llvm.Conventions \
+  -enable-checker nullability.NullableDereferenced \
+  -enable-checker nullability.NullablePassedToNonnull \
+  -enable-checker nullability.NullablePassedToNonnull \
+  -enable-checker optin.performance.Padding \
+  -enable-checker security.FloatLoopCounter \
+  -enable-checker security.insecureAPI.rand \
+  -enable-checker security.insecureAPI.strcpy \
+\
+  '$CC -c dev_all.c'