Fix compiler int<->ptr conversion warnings
[smatch.git] / smatch_scripts / kchecker
blobed7f568ce16267fc346f87d3ef1aac5515f7a4d8
1 #!/bin/bash
3 function useage {
4 echo "Usage: $0 [--sparse][--valgrind][--debug] path/to/file.c"
5 exit 1
8 CMD=smatch
10 while true ; do
11 if [[ "$1" == "--sparse" ]] ; then
12 CMD="sparse"
13 shift
14 elif [[ "$1" == "--valgrind" ]] ; then
15 PRE="valgrind"
16 shift
17 elif [[ "$1" == "" ]] ; then
18 break
19 else
20 if [[ "$1" == "--help" ]] ; then
21 $CMD --help
22 exit 1
24 if echo $1 | grep -q ^- ; then
25 POST="$POST $1"
26 else
27 break
29 shift
31 done
33 cname=$1
34 if [[ "$cname" == "" ]] ; then
35 useage
37 if ! test -e $cname ; then
38 useage
41 oname=$(echo ${cname/.c/.o})
42 rm -f $oname
43 make C=y CHECK="$PRE $CMD $POST" $oname