add check for static function names

This commit is contained in:
Karel Miko 2017-06-20 19:22:15 +02:00 committed by Steffen Jaeckel
parent 27b3ffc627
commit 8f433f1a36

View File

@ -54,6 +54,11 @@ sub check_source {
push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/;
push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/;
push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/;
if ($file =~ m|src/.*\.c$| &&
$file !~ m|src/math/.+_desc.c$| &&
$l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
push @{$troubles->{staticfunc_name}}, "$lineno($1)";
}
$lineno++;
}
for my $k (sort keys %$troubles) {