This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] check_GNU_style.sh "80 characters exceeded" error fix
- From: Mantas Mikaitis <Mantas dot Mikaitis at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Nov 2014 13:51:30 +0000
- Subject: [PATCH] check_GNU_style.sh "80 characters exceeded" error fix
- Authentication-results: sourceware.org; auth=none
- References: <5473371E dot 9000904 at arm dot com>
check_GNU_style.sh error "Lines should not exceed 80 characters" does not return the file name and line number where error is present,
only the line of code. Whereas other kind of errors return full information.
This small patch will fix this and make check_GNU_style.sh return full information when patch contains lines longer than 80 errors.
Tested on patches containing >80 chars lines and the script produces full information as necessary.
Would this be a useful enhancement for trunk?
Mantas Mikaitis
gcc/ChangeLog:
* contrib/check_GNU_style.sh (col): Got rid of cut operation
from the pipe chain and instead added cut inside awk command.
diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
index ef8fdda..c405eeb 100755
--- a/contrib/check_GNU_style.sh
+++ b/contrib/check_GNU_style.sh
@@ -86,8 +86,7 @@ col (){
shift 1
grep -nH '^+' $* \
| grep -v ':+++' \
- | cut -f 2 -d '+' \
- | awk '{ if (length ($0) > 80) print $0 }' \
+ | awk -F':\\+' '{ if (length($2) > 80) print $0}' \
> $tmp
if [ -s $tmp ]; then
printf "\n$msg\n"