2 # This script parses the output of a gcc bootstrap when using warning
3 # flags and determines various statistics.
5 # By Kaveh Ghazi (ghazi@caip.rutgers.edu) 12/13/97.
7 # This function displays all warnings from stage3 of the bootstrap.
10 # Some awks choke on long lines so grep them out.
11 grep -v libf2c.a
$1 | \
12 $AWK '/ warning: /{if(t==1)print} ; /stage2/{if(t==0)t=1}'
16 if test -z "$AWK" ; then
17 for AWK
in gawk nawk
awk ; do
18 if type $AWK 2>&1 |
grep 'not found' > /dev
/null
2>&1 ; then
28 count
=`stage3warns $file | wc -l`
29 echo There are
$count warnings
in stage3 of this bootstrap.
32 echo Number of warnings per
file:
33 stage3warns
$file |
$AWK -F: '{print$1}' |
sort |
uniq -c |
sort -nr
36 echo Number of warning types
:
37 stage3warns
$file |
sed 's/.*warning: //;
38 s/`\(int\)'"'"'/"\1"/g;
39 s/`\(char\)'"'"'/"\1"/g;
40 s/`\(inline\)'"'"'/"\1"/g;
41 s/`\(else\)'"'"'/"\1"/g;
42 s/`\(return\)'"'"'/"\1"/g;
43 s/`\(static\)'"'"'/"\1"/g;
44 s/`\(extern\)'"'"'/"\1"/g;
45 s/`\(longjmp\)'"'"' or `\(vfork\)'"'"'/"\1" or "\2"/g;
46 s/`'"[^']*'/"'`???'"'/g;"'
47 s/.*format, .* arg (arg [0-9]*)/??? format, ??? arg (arg ???)/;
48 s/(arg [0-9]*)/(arg ???)/;
49 s/"\([^"]*\)"/`\1'"'"'/g' | \
50 sort |
uniq -c |
sort -nr