All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Cyril Bur <cyrilbur@gmail.com>,
	apw@canonical.com, Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings
Date: Wed, 07 Jun 2017 01:31:13 -0700	[thread overview]
Message-ID: <1496824273.1968.42.camel@perches.com> (raw)
In-Reply-To: <20170607060135.17384-1-cyrilbur@gmail.com>

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 {/;
>  			}
>  		}
>  

      reply	other threads:[~2017-06-07  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  6:01 [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings Cyril Bur
2017-06-07  8:31 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496824273.1968.42.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=cyrilbur@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.