tool/leaked-globals: ignore function typedef [ci skip]
This commit is contained in:
parent
06b62cbbdd
commit
418b03c750
@ -704,4 +704,4 @@ mjit_build_dir.$(SOEXT): $(MJIT_MIN_HEADER) $(srcdir)/ruby-runner.c ruby-runner.
|
|||||||
|
|
||||||
# yes-test-basic: leaked-globals
|
# yes-test-basic: leaked-globals
|
||||||
leaked-globals: $(COMMONOBJS) prog $(tooldir)/leaked-globals PHONY
|
leaked-globals: $(COMMONOBJS) prog $(tooldir)/leaked-globals PHONY
|
||||||
$(Q) $(XRUBY) $(tooldir)/leaked-globals NM=$(NM) SYMBOL_PREFIX=$(SYMBOL_PREFIX) PLATFORM=$(hdrdir)/ruby/$(PLATFORM_DIR).h $(srcdir)/configure.ac $(COMMONOBJS)
|
$(Q) $(XRUBY) $(tooldir)/leaked-globals NM="$(NM) -Pgp" SYMBOL_PREFIX=$(SYMBOL_PREFIX) PLATFORM=$(hdrdir)/ruby/$(PLATFORM_DIR).h $(srcdir)/configure.ac $(COMMONOBJS)
|
||||||
|
@ -29,8 +29,9 @@ if platform and !platform.empty?
|
|||||||
else
|
else
|
||||||
REPLACE.concat(
|
REPLACE.concat(
|
||||||
h .gsub(%r[/\*.*?\*/]m, " ") # delete block comments
|
h .gsub(%r[/\*.*?\*/]m, " ") # delete block comments
|
||||||
.gsub(%r[//.*], ' ') # delete oneline comments
|
.gsub(%r[//.*], " ") # delete oneline comments
|
||||||
.gsub(/^\s*#.*(?:\\\n.*)*/, "") # delete preprocessor directives
|
.gsub(/^\s*#.*(?:\\\n.*)*/, "") # delete preprocessor directives
|
||||||
|
.gsub(/(?:\A|;)\K\s*typedef\s.*?;/m, "")
|
||||||
.scan(/\b((?!rb_|DEPRECATED|_)\w+)\s*\(.*\);/)
|
.scan(/\b((?!rb_|DEPRECATED|_)\w+)\s*\(.*\);/)
|
||||||
.flatten)
|
.flatten)
|
||||||
end
|
end
|
||||||
@ -44,7 +45,7 @@ ARGV.reject! do |n|
|
|||||||
end
|
end
|
||||||
print "Checking leaked global symbols..."
|
print "Checking leaked global symbols..."
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
IO.foreach("|#{NM} -Pgp #{ARGV.join(' ')}") do |line|
|
IO.foreach("|#{NM} #{ARGV.join(' ')}") do |line|
|
||||||
n, t, = line.split
|
n, t, = line.split
|
||||||
next unless /[A-TV-Z]/ =~ t
|
next unless /[A-TV-Z]/ =~ t
|
||||||
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
|
next unless n.sub!(/^#{SYMBOL_PREFIX}/o, "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user