radare2/sys/clang-analyzer.sh

48 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/sh
2015-09-04 15:49:35 +00:00
2015-11-18 09:33:59 +00:00
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
"
2015-09-04 15:49:35 +00:00
2015-11-18 09:33:59 +00:00
for a in ${CHECKERS} ; do
PLUGINS="${PLUGINS} -enable-checker $a"
done
2015-09-04 15:49:35 +00:00
if [ -z "${MAKE}" ]; then
MAKE=make
2015-11-09 21:28:21 +00:00
gmake --help >/dev/null 2>&1
[ $? = 0 ] && MAKE=gmake
2015-11-09 21:28:21 +00:00
export MAKE="${MAKE}"
fi
scan-build echo >/dev/null
[ $? = 0 ] || exit 1
# find root
cd `dirname $PWD/$0` ; cd ..
# build
2013-02-07 18:31:18 +00:00
${MAKE} mrproper > /dev/null 2>&1
rm -rf scan-log
2015-09-04 15:49:35 +00:00
scan-build ./configure --prefix=/usr
scan-build ${PLUGINS} -o ${PWD}/clang-log ${MAKE} -j 4
echo Check ${PWD}/clang-log