mirror of
https://github.com/curl/curl.git
synced 2026-01-18 17:21:26 +01:00
checksrc: do not apply BANNEDFUNC to struct member functions
Omit this warning, when `close()` is banned:
```
./lib/vtls/vtls.c:947:13: warning: use of close is banned (BANNEDFUNC)
Curl_ssl->close(cf, data);
^
```
Ref: https://github.com/curl/curl/actions/runs/21012427938/job/60410334312?pr=20212#step:3:6
Ref: #20212
Closes #20323
This commit is contained in:
@@ -970,9 +970,11 @@ sub scanfile {
|
||||
my $bad = $2;
|
||||
my $prefix = $1;
|
||||
my $suff = $3;
|
||||
checkwarn("BANNEDFUNC",
|
||||
$line, length($prefix), $file, $ol,
|
||||
"use of $bad is banned");
|
||||
if($prefix !~ /(->|\.)$/) {
|
||||
checkwarn("BANNEDFUNC",
|
||||
$line, length($prefix), $file, $ol,
|
||||
"use of $bad is banned");
|
||||
}
|
||||
my $search = quotemeta($prefix . $bad . $suff);
|
||||
my $replace = $prefix . 'x' x (length($bad) + 1);
|
||||
$l =~ s/$search/$replace/;
|
||||
|
||||
@@ -88,6 +88,9 @@ void startfunc(int a, int b) {
|
||||
|
||||
// CPP comment ?
|
||||
|
||||
int d = impl->magicbad(1); /* member function always allowed */
|
||||
int e = impl.magicbad(); /* member function always allowed */
|
||||
|
||||
/* comment does not end
|
||||
|
||||
</file>
|
||||
|
||||
Reference in New Issue
Block a user