From: Joe Perches <joe@perches.com>
To: David Laight <David.Laight@ACULAB.COM>,
Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: "linux-kernel-mentees@lists.linuxfoundation.org"
<linux-kernel-mentees@lists.linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lukas.bulwahn@gmail.com" <lukas.bulwahn@gmail.com>
Subject: Re: [PATCH] checkpatch: fix unescaped left braces
Date: Tue, 05 Jan 2021 02:49:07 -0800 [thread overview]
Message-ID: <120df949b3071bdde9c554451130d736eb1fa60c.camel@perches.com> (raw)
In-Reply-To: <027501cb2506426d9c05adf56d002781@AcuMS.aculab.com>
On Tue, 2021-01-05 at 10:35 +0000, David Laight wrote:
> From: Joe Perches
> > Sent: 05 January 2021 10:01
> >
> > On Tue, 2021-01-05 at 15:05 +0530, Dwaipayan Ray wrote:
> > > Perl 5.22 onwards require that "A literal "{" should now be
> > > escaped in a pattern".
>
> Sounds like a good reason to never use perl :-)
>
> > Not quite correct.
> >
> > > checkpatch contains several literal "{". Fix such instances
> > > by preceding them with a backslash.
> >
> > Not all literal left braces need to be escaped.
> > https://www.perlmonks.org/?node_id=1191981
> >
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -2036,7 +2036,7 @@ sub annotate_values {
> > > print "ASSIGN($1)\n" if ($dbg_values > 1);
> > > $type = 'N';
> > >
> > >
> > > - } elsif ($cur =~/^(;|{|})/) {
> > > + } elsif ($cur =~ /^(;|\{|\})/) {
>
> isn't (;|{|}) much the same as [;{}] ??
Yes, but without the capture, so /^([;{}])/ would be the same.
I presume the | style was used for consistency with other uses
in the same block.
Andy Whitcroft wrote that bit a long time ago.
prev parent reply other threads:[~2021-01-05 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 9:35 Dwaipayan Ray
2021-01-05 10:01 ` Joe Perches
2021-01-05 10:08 ` Dwaipayan Ray
2021-01-05 10:35 ` David Laight
2021-01-05 10:49 ` 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=120df949b3071bdde9c554451130d736eb1fa60c.camel@perches.com \
--to=joe@perches.com \
--cc=David.Laight@ACULAB.COM \
--cc=dwaipayanray1@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®