summaryrefslogtreecommitdiff
path: root/lib/checksrc.pl
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2015-06-17 09:38:25 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2015-06-17 09:38:25 +0200
commitdbada9f3efae6d9d47b24d0fc06b31d5c48e59a9 (patch)
tree453623e63c0fe6672f0222a33b702b21991c3d85 /lib/checksrc.pl
parentbff9831a91669600de53ca4ed6022cb212a40b8a (diff)
Imported Upstream version 7.43.0
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-xlib/checksrc.pl9
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