diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-10-21 13:46:03 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-10-21 23:18:04 +0200 |
commit | 9744ef2289b606515b91f39c827a65f55c6ca909 (patch) | |
tree | ad5db35f81170e169e7cea79af1bcf90e3afecfe /lib/checksrc.pl | |
parent | c238d4da1b1a8234e4a680d37c9641266df55adf (diff) | |
download | curl-9744ef2289b606515b91f39c827a65f55c6ca909.tar.gz |
checksrc: add crude // detection
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 8fad2cfcb..ddd0b3623 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -143,6 +143,11 @@ sub scanfile { checkwarn($line, length($1), $file, $l, "Trailing whitespace"); } + # crude attempt to detect // comments without too many false + # positives + if($l =~ /^([^"\*]*)[^:"]\/\//) { + checkwarn($line, length($1), $file, $l, "\/\/ comment"); + } # check spaces after for/if/while if($l =~ /^(.*)(for|if|while) \(/) { if($1 =~ / *\#/) { |