Project

General

Profile

Bug #14085

many redefinition warnings on test/win32ole/test_word.rb

Added by usa (Usaku NAKAMURA) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-11-06 trunk 60666) [x64-mswin64_100]
[ruby-dev:50311]

Description

win32oleのテストで、以下のような警告が出ます。
警告が出るのは WIN32OLE.const_load(w, Word) というコードですが、
該当コードが複数回呼ばれているわけではなくて、これを1回呼ぶだけで、
定数の再定義が何度も行われてしまうようです。
実害はないような気もしますが、できれば出ないようにできないでしょうか?

D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here

Related issues

Related to Ruby trunk - Bug #13894: win32ole/test_word.rb sometimes not quit WordClosedActions

Associated revisions

Revision 856aca46
Added by suke (Masaki Suketa) over 1 year ago

  • ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition warnings when WIN32OLE.const_load [Bug #14085]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 60740
Added by suke (Masaki Suketa) over 1 year ago

  • ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition warnings when WIN32OLE.const_load [Bug #14085]

Revision 60740
Added by suke (Masaki Suketa) over 1 year ago

  • ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition warnings when WIN32OLE.const_load [Bug #14085]

Revision 60740
Added by suke (Masaki Suketa) over 1 year ago

  • ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition warnings when WIN32OLE.const_load [Bug #14085]

History

Updated by suke (Masaki Suketa) over 1 year ago

#13984 で入れたんですけど、一旦、戻しましょうか。

WIN32OLEから定数を取得するときに、Wordサーバから複数回、同じ定数を返されるので、そうなるんですよね。
warningの対策は別で考えるとして。

Updated by usa (Usaku NAKAMURA) over 1 year ago

実害ないのなら、revertまではしなくていいんじゃないかと思います。
2.5.0のリリースまでに対策するということで。

#3

Updated by usa (Usaku NAKAMURA) over 1 year ago

  • Related to Bug #13894: win32ole/test_word.rb sometimes not quit Word added
#4

Updated by suke (Masaki Suketa) over 1 year ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r60740.


  • ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition warnings when WIN32OLE.const_load [Bug #14085]

Also available in: Atom PDF