Do clear the range info so early.
[smatch.git] / smatch_scripts / gen_puts_list.sh
blob1071b4af5ea67eb53ea644dfb78607c6bb3bdd19
1 #!/bin/bash
3 file=$1
5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
7 exit 1
8 fi
10 bin_dir=$(dirname $0)
11 remove=$(echo ${bin_dir}/../smatch_data/kernel.puts_argument.remove)
12 tmp=$(mktemp /tmp/smatch.XXXX)
14 echo "// list of functions and the argument they decrement the ref of." > kernel.puts_argument
15 echo '// generated by `gen_puts_list.sh`' >> kernel.puts_argument
16 grep -w puts_arg $file | cut -d ' ' -f 3- >> $tmp
17 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> kernel.puts_argument
18 rm $tmp
19 echo "Done. List saved as 'kernel.puts_argument'"