Re: [patch] checkpatch: complain about GW-BASIC style label names

From: Joe Perches
Date: Thu May 07 2015 - 16:35:25 EST


On Thu, 2015-05-07 at 13:17 -0700, Joe Perches wrote:
> # check for label names likely used in a numeric sequence of labels
> if ($line =~ /^.\s*((?:err|error|fail|out)[0-9+])\s*:/i ||
> $line =~ /\bgoto\s+((?:err|error|fail|out)[0-9+])\s*[:;,]/) {

Meh. I told you about my perl-fu...

That + should be outside the close bracket and it's probably
better that this use a funny (?i) use inside the capture group
so that the goto is lower case only, but the label can be
lower, upper and mixed case.

if ($line =~ /^.\s*((?i)(?:err|error|fail|out)[0-9]+)\s*:/ ||
$line =~ /\bgoto\s+((?i)(?:err|error|fail|out)[0-9]+)\s*[:;,]/) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/