db/fixup_kernel.sh: ignore do_loop_readv_writev()
[smatch.git] / smatch_scripts / gen_no_return_funcs.sh
blobbdf78eb2c3036c3120e397bd63562f6476ad6ceb
1 #!/bin/bash
3 file=$1
4 project=$(echo "$2" | cut -d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
8 exit 1
9 fi
11 outfile="${project}.no_return_funcs"
12 bin_dir=$(dirname $0)
13 add_file=$(echo ${bin_dir}/../smatch_data/${outfile}.add)
14 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
15 tmp=$(mktemp /tmp/smatch.XXXX)
16 tmp2=$(mktemp /tmp/smatch.XXXX)
18 echo "// list of functions which don't return." > $outfile
19 echo '// generated by `gen_no_return_funcs.sh`' >> $outfile
20 cat $(echo ${bin_dir}/../smatch_data/no_return_funcs) >> $outfile
21 cat $add_file >> $outfile
23 grep no_return_funcs $file | cut -d ' ' -f 2 | cut -d '(' -f 1 > $tmp
25 cat $tmp | sort -u > $tmp2
26 mv $tmp2 $tmp
27 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
28 rm $tmp
29 echo "Done. List saved as '$outfile'"
30 echo "Copy it to smatch_data/<project>.no_return_funcs"