diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-11-23 07:52:38 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-11-24 23:48:45 +0100 |
commit | bc7e08471c1884a5100b6e0513a006c263ec3c6b (patch) | |
tree | 7dbda9258bca7adb60f5ede88a9c0894869567df /lib/checksrc.pl | |
parent | 74ffa040a44267c35be98d057c8ebd82b6b5be3c (diff) | |
download | curl-bc7e08471c1884a5100b6e0513a006c263ec3c6b.tar.gz |
checksrc: add ASTERISKSPACE
Verifies a 'char *name' style, with no space after the asterisk.
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 83c38b239..9eb76f47e 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -55,7 +55,8 @@ my %warnings = ( 'COPYRIGHT' => 'file missing a copyright statement', 'BADCOMMAND' => 'bad !checksrc! instruction', 'UNUSEDIGNORE' => 'a warning ignore was not used', - 'OPENCOMMENT' => 'file ended with a /* comment still "open"' + 'OPENCOMMENT' => 'file ended with a /* comment still "open"', + 'ASTERISKSPACE' => 'pointer declared with space after asterisk' ); sub readwhitelist { @@ -471,6 +472,12 @@ sub scanfile { } } + # check for 'char * name' + if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost) *\*) (\w+)/) && ($3 ne "const")) { + checkwarn("ASTERISKSPACE", + $line, length($1), $file, $ol, + "no space after declarative asterisk"); + } $line++; $prevl = $ol; } |