aboutsummaryrefslogtreecommitdiff
path: root/lib/checksrc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-xlib/checksrc.pl8
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",