forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclang-analyzer.sh
executable file
·47 lines (42 loc) · 1.03 KB
/
clang-analyzer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
CHECKERS="alpha.core.TestAfterDivZero
alpha.core.BoolAssignment
alpha.core.CastToStruct
alpha.core.FixedAddr
alpha.core.IdenticalExpr
alpha.core.PointerArithm
alpha.core.PointerSub
alpha.core.SizeofPtr
alpha.core.TestAfterDivZero
alpha.deadcode.UnreachableCode
alpha.security.ArrayBoundV2
alpha.security.MallocOverflow
alpha.security.ReturnPtrRange
alpha.security.taint.TaintPropagation
alpha.unix.Chroot
alpha.unix.PthreadLock
alpha.unix.SimpleStream
alpha.unix.cstring.BufferOverlap
alpha.unix.cstring.NotNullTerminated
alpha.unix.cstring.OutOfBounds
security.FloatLoopCounter
"
for a in ${CHECKERS} ; do
PLUGINS="${PLUGINS} -enable-checker $a"
done
if [ -z "${MAKE}" ]; then
MAKE=make
gmake --help >/dev/null 2>&1
[ $? = 0 ] && MAKE=gmake
export MAKE="${MAKE}"
fi
scan-build echo >/dev/null
[ $? = 0 ] || exit 1
# find root
cd `dirname $PWD/$0` ; cd ..
# build
${MAKE} mrproper > /dev/null 2>&1
rm -rf scan-log
scan-build ./configure --prefix=/usr
scan-build ${PLUGINS} -o ${PWD}/clang-log ${MAKE} -j 4
echo Check ${PWD}/clang-log