mirror of
https://github.com/curl/curl.git
synced 2026-06-22 19:45:40 +03:00
checksrc: check for return with parens around a value/name
Ref: #15979 Closes #15983
This commit is contained in:
parent
94cfcb1e21
commit
3833e5fea1
1 changed files with 7 additions and 1 deletions
|
|
@ -188,7 +188,7 @@ sub readlocalfile {
|
|||
undef $banfunc{$1};
|
||||
}
|
||||
else {
|
||||
die "Invalid format in $dir/.checksrc on line $i\n";
|
||||
die "Invalid format in $dir/.checksrc on line $i: $_\n";
|
||||
}
|
||||
}
|
||||
close($rcfile);
|
||||
|
|
@ -770,6 +770,12 @@ sub scanfile {
|
|||
}
|
||||
}
|
||||
|
||||
# check for "return" with parentheses around just a value/name
|
||||
if($l =~ /^(.*\W)return \(\w*\);/) {
|
||||
checkwarn("RETURNPAREN", $line, length($1)+7, $file, $l,
|
||||
"return with paren");
|
||||
}
|
||||
|
||||
# check for "sizeof" without parenthesis
|
||||
if(($l =~ /^(.*)sizeof *([ (])/) && ($2 ne "(")) {
|
||||
if($1 =~ / *\#/) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue