From dabe88b2fb375201ac0095dcd49647f14e331b7e Mon Sep 17 00:00:00 2001 From: Anders Wallin via lttng-dev Date: Wed, 25 Nov 2020 09:31:40 +0100 Subject: [PATCH] Extras: Perl 5.26 requires { to be escaped by \ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Unescaped literal "{" characters in regular expression patterns are no longer permissible Signed-off-by: Anders Wallin Signed-off-by: Jérémie Galarneau --- extras/checkpatch.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extras/checkpatch.pl b/extras/checkpatch.pl index 286c94de3..14e16fae1 100755 --- a/extras/checkpatch.pl +++ b/extras/checkpatch.pl @@ -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"; -- 2.34.1