diff options
-rwxr-xr-x | lib/checksrc.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 9a74a6f46..479a5dbde 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -485,6 +485,19 @@ sub scanfile { $line, length($1)-1, $file, $ol, "no space before asterisk"); } + + # check for 'void func() {', but avoid false positives by requiring + # both an open and closed parentheses before the open brace + if($l =~ /^((\w).*){\z/) { + my $k = $1; + $k =~ s/const *//; + $k =~ s/static *//; + if($k =~ /\(.*\)/) { + checkwarn("BRACEPOS", + $line, length($l)-1, $file, $ol, + "wrongly placed open brace"); + } + } $line++; $prevl = $ol; } |