Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1659389 > unrolled thread
| Started by | Cyril Bur <cyrilbur@gmail.com> |
|---|---|
| First post | 2017-06-07 08:10 +0200 |
| Last post | 2017-06-07 10:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings Cyril Bur <cyrilbur@gmail.com> - 2017-06-07 08:10 +0200
Re: [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings Joe Perches <joe@perches.com> - 2017-06-07 10:40 +0200
| From | Cyril Bur <cyrilbur@gmail.com> |
|---|---|
| Date | 2017-06-07 08:10 +0200 |
| Subject | [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings |
| Message-ID | <tPCkh-2Lp-5@gated-at.bofh.it> |
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.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
scripts/checkpatch.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4b9569fa931b..33e50614a5d9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3541,7 +3541,7 @@ sub process {
$fixedline =~ s/\s*=\s*$/ = {/;
fix_insert_line($fixlinenr, $fixedline);
$fixedline = $line;
- $fixedline =~ s/^(.\s*){\s*/$1/;
+ $fixedline =~ s/^(.\s*)\{\s*/$1/;
fix_insert_line($fixlinenr, $fixedline);
}
}
@@ -3882,7 +3882,7 @@ sub process {
my $fixedline = rtrim($prevrawline) . " {";
fix_insert_line($fixlinenr, $fixedline);
$fixedline = $rawline;
- $fixedline =~ s/^(.\s*){\s*/$1\t/;
+ $fixedline =~ s/^(.\s*)\{\s*/$1\t/;
if ($fixedline !~ /^\+\s*$/) {
fix_insert_line($fixlinenr, $fixedline);
}
@@ -4371,7 +4371,7 @@ sub process {
if (ERROR("SPACING",
"space required before the open brace '{'\n" . $herecurr) &&
$fix) {
- $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/;
+ $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
}
}
--
2.13.0
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-06-07 10:40 +0200 |
| Subject | Re: [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings |
| Message-ID | <tPEFr-4bF-3@gated-at.bofh.it> |
| In reply to | #1659389 |
On Wed, 2017-06-07 at 16:01 +1000, Cyril Bur wrote:
> 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.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Acked-by: Joe Perches <joe@perches.com>
> ---
> scripts/checkpatch.pl | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4b9569fa931b..33e50614a5d9 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3541,7 +3541,7 @@ sub process {
> $fixedline =~ s/\s*=\s*$/ = {/;
> fix_insert_line($fixlinenr, $fixedline);
> $fixedline = $line;
> - $fixedline =~ s/^(.\s*){\s*/$1/;
> + $fixedline =~ s/^(.\s*)\{\s*/$1/;
> fix_insert_line($fixlinenr, $fixedline);
> }
> }
> @@ -3882,7 +3882,7 @@ sub process {
> my $fixedline = rtrim($prevrawline) . " {";
> fix_insert_line($fixlinenr, $fixedline);
> $fixedline = $rawline;
> - $fixedline =~ s/^(.\s*){\s*/$1\t/;
> + $fixedline =~ s/^(.\s*)\{\s*/$1\t/;
> if ($fixedline !~ /^\+\s*$/) {
> fix_insert_line($fixlinenr, $fixedline);
> }
> @@ -4371,7 +4371,7 @@ sub process {
> if (ERROR("SPACING",
> "space required before the open brace '{'\n" . $herecurr) &&
> $fix) {
> - $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/;
> + $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
> }
> }
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web