1*1f5207b7SJohn Levon#!/bin/bash
2*1f5207b7SJohn Levon
3*1f5207b7SJohn Levonfile=$1
4*1f5207b7SJohn Levon
5*1f5207b7SJohn Levonif [[ "$file" = "" ]] ; then
6*1f5207b7SJohn Levon    echo "Usage:  $0 <file with smatch messages>"
7*1f5207b7SJohn Levon    exit 1
8*1f5207b7SJohn Levonfi
9*1f5207b7SJohn Levon
10*1f5207b7SJohn Levongrep " unchecked " $file | cut -d ' ' -f 5- | sort -u > unchecked
11*1f5207b7SJohn Levongrep " undefined " $file | cut -d ' ' -f 5- | sort -u > null_calls.txt
12*1f5207b7SJohn Levoncat null_calls.txt unchecked | sort | uniq -d > null_params.txt
13*1f5207b7SJohn LevonIFS="
14*1f5207b7SJohn Levon"
15*1f5207b7SJohn Levonfor i in $(cat null_params.txt) ; do
16*1f5207b7SJohn Levon	grep "$i" $file | grep -w undefined
17*1f5207b7SJohn Levondone
18*1f5207b7SJohn Levon
19*1f5207b7SJohn Levon
20