]> gcc.gnu.org Git - gcc.git/blob - contrib/warn_summary
* warn_summary, test_summary: Moved into the contrib directory.
[gcc.git] / contrib / warn_summary
1 #!/bin/sh
2 # This script parses the output of a gcc bootstrap when using warning
3 # flags and determines various statistics.
4 #
5 # By Kaveh Ghazi (ghazi@caip.rutgers.edu) 12/13/97.
6
7 # This function displays all warnings from stage3 of the bootstrap.
8 stage3warns()
9 {
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}'
13 }
14
15 # Find a good awk.
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
19 :
20 else
21 break
22 fi
23 done
24 fi
25
26 for file in "$@" ; do
27
28 count=`stage3warns $file | wc -l`
29 echo There are $count warnings in stage3 of this bootstrap.
30
31 echo
32 echo Number of warnings per file:
33 stage3warns $file | $AWK -F: '{print$1}' | sort | uniq -c | sort -nr
34
35 echo
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
51
52 done
This page took 0.041327 seconds and 5 git commands to generate.