Re: [BUG] checkpatch: unescaped left brace in regex is deprecated

From: Joe Perches
Date: Tue Dec 15 2015 - 19:13:39 EST


On Tue, 2015-12-15 at 20:58 -0300, Geyslan G. Bem wrote:
> 2015-12-10 8:24 GMT-03:00 Geyslan G. Bem <geyslan@xxxxxxxxx>:
> > Suggested-by: Peter Senna Tschudin <peter.senna@xxxxxxxxx>
> > Reported-by: Geyslan G. Bem <geyslan@xxxxxxxxx>
> >
>
> Joe, do you applied this patch? If not, would I send it?

You can resend, but I believe there are a few more instances
of this that might need fixing too.

I don't have perl 5.22 so it's difficult for me to test.

Here's a grep with some possible false positives
and maybe missing some too.

$ git grep -n "=[\!~].*{" scripts/checkpatch.pl|grep -vw qr|grep -vP '{$|{\s*#|\${|\\{|{[\d$]'
scripts/checkpatch.pl:1143: $remainder =~ /^(else)(?:\s|{)/ &&
scripts/checkpatch.pl:1233: $stmt =~ s/^\s*{//;
scripts/checkpatch.pl:2458: if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
scripts/checkpatch.pl:2802: if ($line =~ /^\+(.*)\(\s*$Type\s*\)([ \t]++)((?![={]|\\$|$Attribute|__attribute__))/ &&
scripts/checkpatch.pl:3015: $s =~ s/{.*$//s;
scripts/checkpatch.pl:3168: $s =~ s/^\s*{//;
scripts/checkpatch.pl:3274: if ($line =~ /^.\s*{/ &&
scripts/checkpatch.pl:3282: $fixedline =~ s/\s*=\s*$/ = {/;
scripts/checkpatch.pl:3285: $fixedline =~ s/^(.\s*){\s*/$1/;
scripts/checkpatch.pl:3606: if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and
scripts/checkpatch.pl:3613: $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/;
scripts/checkpatch.pl:3625: if ($line =~ /^.\s*{/ &&
scripts/checkpatch.pl:3635: $fixedline =~ s/^(.\s*){\s*/$1\t/;
scripts/checkpatch.pl:4104:##  if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
scripts/checkpatch.pl:4124: $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/;
scripts/checkpatch.pl:4734: $seen++ if ($block =~ /^\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/