aboutsummaryrefslogtreecommitdiff
path: root/contrib/warn_summary
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-05-23 16:35:33 -0600
committerJeff Law <law@gcc.gnu.org>1998-05-23 16:35:33 -0600
commitd258564a1d1da86dbbf2d9f13f34de3689f0f6f3 (patch)
tree6a70b2ebe0cc3db5baad7bebdc6c3c4aad92d069 /contrib/warn_summary
parent10c62dce0453890fb31bd380e938c3c090e7a3f4 (diff)
downloadgcc-d258564a1d1da86dbbf2d9f13f34de3689f0f6f3.zip
gcc-d258564a1d1da86dbbf2d9f13f34de3689f0f6f3.tar.gz
gcc-d258564a1d1da86dbbf2d9f13f34de3689f0f6f3.tar.bz2
Moved here from the gcc subdir.
From-SVN: r19990
Diffstat (limited to 'contrib/warn_summary')
-rwxr-xr-xcontrib/warn_summary52
1 files changed, 52 insertions, 0 deletions
diff --git a/contrib/warn_summary b/contrib/warn_summary
new file mode 100755
index 0000000..1fb62b0
--- /dev/null
+++ b/contrib/warn_summary
@@ -0,0 +1,52 @@
+#!/bin/sh
+# This script parses the output of a gcc bootstrap when using warning
+# flags and determines various statistics.
+#
+# By Kaveh Ghazi (ghazi@caip.rutgers.edu) 12/13/97.
+
+# This function displays all warnings from stage3 of the bootstrap.
+stage3warns()
+{
+# Some awks choke on long lines so grep them out.
+ grep -v libf2c.a $1 | \
+ $AWK '/ warning: /{if(t==1)print} ; /stage2/{if(t==0)t=1}'
+}
+
+# Find a good awk.
+if test -z "$AWK" ; then
+ for AWK in gawk nawk awk ; do
+ if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then
+ :
+ else
+ break
+ fi
+ done
+fi
+
+for file in "$@" ; do
+
+ count=`stage3warns $file | wc -l`
+ echo There are $count warnings in stage3 of this bootstrap.
+
+ echo
+ echo Number of warnings per file:
+ stage3warns $file | $AWK -F: '{print$1}' | sort | uniq -c | sort -nr
+
+ echo
+ echo Number of warning types:
+ stage3warns $file | sed 's/.*warning: //;
+ s/`\(int\)'"'"'/"\1"/g;
+ s/`\(char\)'"'"'/"\1"/g;
+ s/`\(inline\)'"'"'/"\1"/g;
+ s/`\(else\)'"'"'/"\1"/g;
+ s/`\(return\)'"'"'/"\1"/g;
+ s/`\(static\)'"'"'/"\1"/g;
+ s/`\(extern\)'"'"'/"\1"/g;
+ s/`\(longjmp\)'"'"' or `\(vfork\)'"'"'/"\1" or "\2"/g;
+ s/`'"[^']*'/"'`???'"'/g;"'
+ s/.*format, .* arg (arg [0-9]*)/??? format, ??? arg (arg ???)/;
+ s/(arg [0-9]*)/(arg ???)/;
+ s/"\([^"]*\)"/`\1'"'"'/g' | \
+ sort | uniq -c | sort -nr
+
+done