diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-05-13 12:56:53 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-05-14 00:02:05 +0200 |
commit | 66b077576313eda129bce9f58fdc894d857cb121 (patch) | |
tree | ce4989ca7204ca1fcdcc47dcc50c72d8a8898a6c /lib/checksrc.pl | |
parent | f3f5d82e2854991cd12ad5dcf022e8abbcea7038 (diff) | |
download | curl-66b077576313eda129bce9f58fdc894d857cb121.tar.gz |
checksrc: enhance the ASTERISKSPACE and update code accordingly
Fine: "struct hello *world"
Not fine: "struct hello* world" (and variations)
Closes #5386
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index df93696d7..cbd204adb 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -640,10 +640,10 @@ sub scanfile { } # check for 'char * name' - if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost) *(\*+)) (\w+)/) && ($4 ne "const")) { - checkwarn("ASTERISKNOSPACE", + if(($l =~ /(^.*(char|int|long|void|CURL|CURLM|CURLMsg|[cC]url_[A-Za-z_]+|struct [a-zA-Z_]+) *(\*+)) (\w+)/) && ($4 !~ /^(const|volatile)$/)) { + checkwarn("ASTERISKSPACE", $line, length($1), $file, $ol, - "no space after declarative asterisk"); + "space after declarative asterisk"); } # check for 'char*' if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost|sockaddr_in|FILE)\*)/)) { |