Extras: Perl 5.26 requires { to be escaped by \
authorAnders Wallin via lttng-dev <lttng-dev@lists.lttng.org>
Wed, 25 Nov 2020 08:31:40 +0000 (09:31 +0100)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 4 Dec 2020 21:35:14 +0000 (16:35 -0500)
Unescaped literal "{" characters in regular expression patterns are no
longer permissible

Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
extras/checkpatch.pl

index 286c94de33462d0d79d1b2712a431d6bf9e1ee88..14e16fae12cb20d0743e960dea976a63c0bf95d9 100755 (executable)
@@ -2433,8 +2433,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);
                }
@@ -2709,8 +2709,8 @@ sub process {
 ##             }
 
 #need space before brace following if, while, etc
-               if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
-                   $line =~ /do{/) {
+               if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) ||
+                   $line =~ /do\{/) {
                        ERROR("SPACING",
                              "space required before the open brace '{'\n" . $herecurr);
                }
@@ -3005,7 +3005,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/\n*$//;
                                my $herectx = $here . "\n";
This page took 0.033027 seconds and 4 git commands to generate.