aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/checksrc.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 1af6bbd72..15e9aff8e 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -249,7 +249,16 @@ sub checksrc {
$scope=999999;
}
- if($ignore_set{$warn}) {
+ # Comparing for a literal zero rather than the scalar value zero
+ # covers the case where $scope contains the ending '*' from the
+ # comment. If we use a scalar comparison (==) we induce warnings
+ # on non-scalar contents.
+ if($scope eq "0") {
+ checkwarn("BADCOMMAND",
+ $line, 0, $file, $l,
+ "Disable zero not supported, did you mean to enable?");
+ }
+ elsif($ignore_set{$warn}) {
checkwarn("BADCOMMAND",
$line, 0, $file, $l,
"$warn already disabled from line $ignore_set{$warn}");