From: Daniel Stenberg Date: Wed, 21 Oct 2015 11:46:03 +0000 (+0200) Subject: checksrc: add crude // detection X-Git-Tag: curl-7_46_0~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9744ef2289b606515b91f39c827a65f55c6ca909;p=thirdparty%2Fcurl.git checksrc: add crude // detection --- diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 8fad2cfcbf..ddd0b36236 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 =~ / *\#/) { diff --git a/lib/checksrc.whitelist b/lib/checksrc.whitelist index e261b9da1a..d20909bdc2 100644 --- a/lib/checksrc.whitelist +++ b/lib/checksrc.whitelist @@ -8,3 +8,4 @@ return fopen(file, "r"); /* VMS */ return fopen(file, "r", "rfm=stmlf", "ctx=stm"); curl_memlog("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n", + a URL as file://localhost//foo must be valid as well, to refer to