summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-21 19:25:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-21 19:26:16 +0900
commit418b03c750ab8c5742670d0d06ab84a3132f64dd (patch)
treefbdd64e7c6e7a1a6d773a787e51c34ea22f43aad /tool
parent06b62cbbdd560c6210d48a50ba99cfdc2f110dfe (diff)
tool/leaked-globals: ignore function typedef [ci skip]
Diffstat (limited to 'tool')
-rwxr-xr-xtool/leaked-globals5
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/leaked-globals b/tool/leaked-globals
index d95f3794e8..083f658fb1 100755
--- a/tool/leaked-globals
+++ b/tool/leaked-globals
@@ -29,8 +29,9 @@ if platform and !platform.empty?
else
REPLACE.concat(
h .gsub(%r[/\*.*?\*/]m, " ") # delete block comments
- .gsub(%r[//.*], ' ') # delete oneline comments
+ .gsub(%r[//.*], " ") # delete oneline comments
.gsub(/^\s*#.*(?:\\\n.*)*/, "") # delete preprocessor directives
+ .gsub(/(?:\A|;)\K\s*typedef\s.*?;/m, "")
.scan(/\b((?!rb_|DEPRECATED|_)\w+)\s*\(.*\);/)
.flatten)
end
@@ -44,7 +45,7 @@ ARGV.reject! do |n|
end
print "Checking leaked global symbols..."
STDOUT.flush
-IO.foreach("|#{NM} -Pgp #{ARGV.join(' ')}") do |line|
+IO.foreach("|#{NM} #{ARGV.join(' ')}") do |line|
n, t, = line.split
next unless /[A-TV-Z]/ =~ t
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")