linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Philippe De Muyter <philippe.demuyter@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] checkpatch: Suggest using min_t or max_t
Date: Wed, 05 Sep 2012 17:35:16 -0700	[thread overview]
Message-ID: <1346891716.1906.27.camel@joe2Laptop> (raw)
In-Reply-To: <CAOoYnzJULa5Pzkhm50ppMZ2qCAHD1KO09zGL6WjTwsqbe0LopA@mail.gmail.com>

On Thu, 2012-09-06 at 02:16 +0200, Philippe De Muyter wrote:
> On Wed, Sep 5, 2012 at 7:07 PM, Joe Perches <joe@perches.com> wrote:
> > On Wed, 2012-09-05 at 13:21 +0200, Philippe De Muyter wrote:
> >> > v2: Make $match_balanced_parentheses work in perl 5.8
> >>
> >> Has this been applied  ?
> >>
> >> v3.3 version of checkpatch.pl works for me, but v3.4, v3.5 & v3.6rc2 say:
> >> Nested quantifiers in regex; marked by <-- HERE in m/(\((?:[^\(\)]++
> >> <-- HERE |(?-1))*\))/ at scripts/checkpatch.pl line 340.
> >>
> >> and my perl is :
> >>
> >>         perl --version
> >>
> >>         This is perl, v5.8.8 built for i586-linux-thread-multi
> >
> > The current version of checkpatch skips this
> > check when the perl version is less than 5.10.0
> >
> >
> > commit d7c76ba7e58bc3ca674f20759c686535db484749
> > Author: Joe Perches <joe@perches.com>
> > Date:   Tue Jan 10 15:09:58 2012 -0800
> >
> >     checkpatch: improve memset and min/max with cast checking
> >
> >     Improve the checking of arguments to memset and min/max tests.
> >
> >     Move the checking of min/max to statement blocks instead of single line.
> >     Change $Constant to allow any case type 0x initiator and trailing ul
> >     specifier.  Add $FuncArg type as any function argument with or without a
> >     cast.  Print the whole statement when showing memset or min/max messages.
> >     Improve the memset with 0 as 3rd argument error message.
> >
> >     There are still weaknesses in the $FuncArg and $Constant code as arbitrary
> >     parentheses and negative signs are not generically supported.
> >
> > []
> > # Using $balanced_parens, $LvalOrFunc, or $FuncArg
> > # requires at least perl version v5.10.0
> > # Any use must be runtime checked with $^V
> > []
> > # typecasts on min/max could be min_t/max_t
> >                 if ($^V && $^V ge 5.10.0 &&
> >                     defined $stat &&
> >                     $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) {
> >
> >
> 
> I know nothing about perl, and when I read 3.6rc2's checkpatch.pl it
> seems to me that every usage of  $balanced_parens, $LvalOrFunc, or
> $FuncArg is protected by a test for v5.10.0, but line 340, which perl
> complains about, is not a use, but merely a definition.  Should the
> definition not be protected too ?

Beats me.

I'm not a perl monk either.  Maybe it should.
I don't have 5.8 and the latest is 5.16.
5.8 is pretty old.


      reply	other threads:[~2012-09-06  0:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 12:21 [PATCH v3] w1: Add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support Clifton Barnes
2011-05-19 19:03 ` Andrew Morton
2011-05-19 20:21 ` Ryan Mallon
     [not found] ` <20110519115859.e11a7ca3.akpm@linux-foundation.org>
     [not found]   ` <1305909981.4209.33.camel@Joe-Laptop>
     [not found]     ` <20110520095037.25eadc0a.akpm@linux-foundation.org>
     [not found]       ` <1305912602.4209.41.camel@Joe-Laptop>
     [not found]         ` <20110520103529.1ef3917c.akpm@linux-foundation.org>
     [not found]           ` <1305915161.4209.56.camel@Joe-Laptop>
     [not found]             ` <20110520113830.3faf5230.akpm@linux-foundation.org>
2011-05-20 20:24               ` [PATCH] checkpatch: Suggest using min_t or max_t Joe Perches
2011-05-24 23:35                 ` Andrew Morton
2011-05-25  0:11                   ` Joe Perches
2011-05-25 23:53                     ` Andrew Morton
2011-05-27  0:35                       ` [PATCH v2] " Joe Perches
2012-09-05 11:21                         ` Philippe De Muyter
2012-09-05 17:07                           ` Joe Perches
2012-09-06  0:16                             ` Philippe De Muyter
2012-09-06  0:35                               ` 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=1346891716.1906.27.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.demuyter@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;
as well as URLs for NNTP newsgroup(s).