← Commit list

62ba3604dc

Viktor Szakats
Viktor Szakats
2026-01-15
SUCCESS Duration: 509s

Subject

checksrc: do not apply `BANNEDFUNC` to struct member functions

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

scripts/checksrc.pl+5 -3
@@ -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/;
tests/data/test1185+3 -0
@@ -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>