diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2015-06-17 09:38:25 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2015-06-17 09:38:25 +0200 |
commit | dbada9f3efae6d9d47b24d0fc06b31d5c48e59a9 (patch) | |
tree | 453623e63c0fe6672f0222a33b702b21991c3d85 /lib/checksrc.pl | |
parent | bff9831a91669600de53ca4ed6022cb212a40b8a (diff) |
Imported Upstream version 7.43.0
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 292ad342..8fad2cfc 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -228,6 +228,15 @@ sub scanfile { "use of $2 is banned"); } + # scan for use of non-binary fopen without the macro + if($l =~ /^(.*\W)fopen\s*\([^"]*\"([^"]*)/) { + my $mode = $2; + if($mode !~ /b/) { + checkwarn($line, length($1), $file, $l, + "use of non-binary fopen without FOPEN_* macro"); + } + } + # check for open brace first on line but not first column # only alert if previous line ended with a close paren and wasn't a cpp # line |