4 project
=$
(echo "$2" | cut
-d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
11 outfile
="${project}.sizeof_param"
13 remove
=$
(echo ${bin_dir}/..
/smatch_data
/${outfile}.remove
)
14 tmp
=$
(mktemp
/tmp
/smatch.XXXX
)
15 tmp2
=$
(mktemp
/tmp
/smatch.XXXX
)
18 echo "// list of function parameters that are the size of a buffer." > $outfile
19 echo '// generated by `gen_sizeof_param.sh`' >> $outfile
21 grep sizeof_param
$file |
grep '[0-9] [0-9]$' | cut
-d ' ' -f 5- | \
22 sort -u |
sed -e "s/'//g" > $tmp
23 grep -f $remove $tmp >> $tmp2
24 cat $tmp $tmp2 2> /dev
/null |
sort |
uniq -u >> $outfile
28 echo "Done. List saved as '$outfile'"