diff options
| author | Michael Adam <obnox@samba.org> | 2015-11-30 13:35:23 +0100 | 
|---|---|---|
| committer | Jeff Darcy <jdarcy@redhat.com> | 2015-12-02 04:43:27 -0800 | 
| commit | 2e9376a2f1b992d3649dd1d5a8e844b4c031ef3c (patch) | |
| tree | 123794a1f3be530388cb6c29a448a915b3e20823 /extras | |
| parent | 905b3d26a794510892f6a9b51139bc9cfd947c02 (diff) | |
extras: fix deprecation warining in checkpatch.pl
Left braces in patterns need to be escaped.
Otherwise, for perl >= 5.16, we get a warning:
"Unescaped left brace in regex is deprecated, passed through in regex;"
This patch fixes the relevant braces.
Hence perl -c ./examples/checkpatch.pl is clean again.
Change-Id: I938c9c262239f53de57d30a2cff7030f22e63dc1
BUG: 1198849
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-on: http://review.gluster.org/12828
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras')
| -rwxr-xr-x | extras/checkpatch.pl | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/extras/checkpatch.pl b/extras/checkpatch.pl index 5a314258142..5a4e018def9 100755 --- a/extras/checkpatch.pl +++ b/extras/checkpatch.pl @@ -2702,8 +2702,8 @@ sub process {  # function brace can't be on same line, except for #defines of do while,  # or if closed on same line -        if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and -            !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) { +        if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and +            !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {              ERROR("OPEN_BRACE",                    "open brace '{' following function declarations go on the next line\n" . $herecurr);          } @@ -3104,8 +3104,8 @@ sub process {  ##              }  #need space before brace following if, while, etc -        if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || -            $line =~ /do{/) { +        if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || +            $line =~ /do\{/) {              if (ERROR("SPACING",                        "space required before the open brace '{'\n" . $herecurr) &&                  $fix) { @@ -3493,7 +3493,7 @@ sub process {                  $dstat !~ /^for\s*$Constant$/ &&                                # for (...)                  $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ &&       # for (...) bar()                  $dstat !~ /^do\s*{/ &&                                  # do {... -                $dstat !~ /^\({/ &&                                             # ({... +                $dstat !~ /^\(\{/ &&                                             # ({...                  $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)              {                  $ctx =~ s/\n*$//;  | 
