From 9744ef2289b606515b91f39c827a65f55c6ca909 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 21 Oct 2015 13:46:03 +0200 Subject: checksrc: add crude // detection --- lib/checksrc.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/checksrc.pl') 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 =~ / *\#/) { -- cgit v1.2.3