From 418b03c750ab8c5742670d0d06ab84a3132f64dd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 21 Jan 2023 19:25:45 +0900 Subject: tool/leaked-globals: ignore function typedef [ci skip] --- tool/leaked-globals | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tool') 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, "") -- cgit v1.2.3