*new* check_test_bit: check for test_bit(BIT(0), &foo)
[smatch.git] / smatch_scripts / gen_no_return_funcs.sh
blob16e0959296b893db41b6f5049eecac5ca3554fa6
1 #!/bin/bash
3 file=$1
4 project=$2
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages>"
8 exit 1
9 fi
11 if [[ "$project" = "-p=kernel" ]] ; then
12 outfile="kernel.no_return_funcs"
13 else
14 outfile="no_return_funcs"
17 bin_dir=$(dirname $0)
18 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
19 tmp=$(mktemp /tmp/smatch.XXXX)
20 tmp2=$(mktemp /tmp/smatch.XXXX)
22 echo "// list of functions which don't return." > $outfile
23 echo '// generated by `gen_no_return_funcs.sh`' >> $outfile
24 cat $(echo ${bin_dir}/../smatch_data/no_return_funcs) >> $outfile
26 grep no_return_funcs $file | cut -d ' ' -f 2 | cut -d '(' -f 1 > $tmp
28 cat $tmp | sort -u > $tmp2
29 mv $tmp2 $tmp
30 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
31 rm $tmp
32 echo "Done. List saved as '$outfile'"
33 echo "Copy it to smatch_data/<project>.no_return_funcs"