summaryrefslogtreecommitdiff
path: root/contrib/warn_summary
diff options
context:
space:
mode:
authormanfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-01 00:26:36 +0000
committermanfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-01 00:26:36 +0000
commite2014fd34856369aa3a10230d28451bf51f084f0 (patch)
treedfc29d24b3f6c183db9e44919a1253bfa1c2fbf4 /contrib/warn_summary
parent9a8a89d7cff77612891df0c052e63a9328029c23 (diff)
downloadgcc-e2014fd34856369aa3a10230d28451bf51f084f0.tar.gz
* warn_summary: Update to Kaveh's latest version allowing to specify the last stage built. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20161 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib/warn_summary')
-rwxr-xr-xcontrib/warn_summary29
1 files changed, 22 insertions, 7 deletions
diff --git a/contrib/warn_summary b/contrib/warn_summary
index 1fb62b03e6c..c1607872861 100755
--- a/contrib/warn_summary
+++ b/contrib/warn_summary
@@ -4,14 +4,18 @@
#
# By Kaveh Ghazi (ghazi@caip.rutgers.edu) 12/13/97.
-# This function displays all warnings from stage3 of the bootstrap.
-stage3warns()
+# This function displays all warnings from stageN of the bootstrap.
+stageNwarns()
{
+ stageNminus1=`expr $stageN - 1`
# 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}'
+ $AWK "/ warning: /{if(t==1)print} ; /stage$stageNminus1/{if(t==0)t=1} ; /stage$stageN/{if(t==1)t=0}"
}
+usage="usage: `basename $0` [-s stage] [file(s)]"
+stageN=3
+
# Find a good awk.
if test -z "$AWK" ; then
for AWK in gawk nawk awk ; do
@@ -23,18 +27,29 @@ if test -z "$AWK" ; then
done
fi
+while test -n "$1" ; do
+ case "$1" in
+ -s) if test -z "$2"; then echo $usage; exit 1; fi; stageN="$2"; shift 2 ;;
+ -s*) stageN="`expr $1 : '-s\(.*\)'`" ; shift ;;
+ -*) echo $usage ; exit 1 ;;
+ *) break ;;
+ esac
+done
+
+
+
for file in "$@" ; do
- count=`stage3warns $file | wc -l`
- echo There are $count warnings in stage3 of this bootstrap.
+ count=`stageNwarns $file | wc -l`
+ echo There are $count warnings in stage$stageN of this bootstrap.
echo
echo Number of warnings per file:
- stage3warns $file | $AWK -F: '{print$1}' | sort | uniq -c | sort -nr
+ stageNwarns $file | $AWK -F: '{print$1}' | sort | uniq -c | sort -nr
echo
echo Number of warning types:
- stage3warns $file | sed 's/.*warning: //;
+ stageNwarns $file | sed 's/.*warning: //;
s/`\(int\)'"'"'/"\1"/g;
s/`\(char\)'"'"'/"\1"/g;
s/`\(inline\)'"'"'/"\1"/g;