History

checkpatch: silence perl 5.26.0 unescaped left brace warnings

As of perl 5, version 26, subversion 0 (v5.26.0) some new warnings have occurred when running checkpatch. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ <-- HERE \s*/ at scripts/checkpatch.pl line 3544. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ <-- HERE \s*/ at scripts/checkpatch.pl line 3885. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(\+.*(?:do|\))){ <-- HERE / at scripts/checkpatch.pl line 4374. It seems perfectly reasonable to do as the warning suggests and simply escape the left brace in these three locations.

Cyril Bur committed 9 years ago

Commit 8d81ae01 parent a0ad7591 file · +3 −3Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−3
@@ -3555,7 +3555,7 @@ sub process { · 3554 unmodified lines
35553555 $fixedline =~ s/\s*=\s*$/ = {/;
35563556 fix_insert_line($fixlinenr, $fixedline);
35573557 $fixedline = $line;
3558− $fixedline =~ s/^(.\s*){\s*/$1/;
3558+ $fixedline =~ s/^(.\s*)\{\s*/$1/;
35593559 fix_insert_line($fixlinenr, $fixedline);
35603560 }
35613561 }
@@ -3896,7 +3896,7 @@ sub process { · 334 unmodified lines
38963896 my $fixedline = rtrim($prevrawline) . " {";
38973897 fix_insert_line($fixlinenr, $fixedline);
38983898 $fixedline = $rawline;
3899− $fixedline =~ s/^(.\s*){\s*/$1\t/;
3899+ $fixedline =~ s/^(.\s*)\{\s*/$1\t/;
39003900 if ($fixedline !~ /^\+\s*$/) {
39013901 fix_insert_line($fixlinenr, $fixedline);
39023902 }
@@ -4385,7 +4385,7 @@ sub process { · 482 unmodified lines
43854385 if (ERROR("SPACING",
43864386 "space required before the open brace '{'\n" . $herecurr) &&
43874387 $fix) {
4388− $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/;
4388+ $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
43894389 }
43904390 }
43914391