diff options
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 022b193aa..c56e9c841 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -356,6 +356,14 @@ sub scanfile { } } + if($nostr =~ /^((.*)(if) *\()(.*)\)/) { + my $pos = length($1); + if($4 =~ / = /) { + checkwarn("ASSIGNWITHINCONDITION", + $line, $pos+1, $file, $l, + "assignment within conditional expression"); + } + } # check spaces after open parentheses if($l =~ /^(.*[a-z])\( /i) { checkwarn("SPACEAFTERPAREN", |