mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
checksrc: add ASTERISKSPACE
Verifies a 'char *name' style, with no space after the asterisk.
This commit is contained in:
parent
74ffa040a4
commit
bc7e08471c
@ -55,7 +55,8 @@ my %warnings = (
|
|||||||
'COPYRIGHT' => 'file missing a copyright statement',
|
'COPYRIGHT' => 'file missing a copyright statement',
|
||||||
'BADCOMMAND' => 'bad !checksrc! instruction',
|
'BADCOMMAND' => 'bad !checksrc! instruction',
|
||||||
'UNUSEDIGNORE' => 'a warning ignore was not used',
|
'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 {
|
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++;
|
$line++;
|
||||||
$prevl = $ol;
|
$prevl = $ol;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user