こんにちは、なかむら(う)です。

VC++で標準拡張ライブラリのコンパイル時に幾つかwarningが出る
のを消してみました(dlとwin32oleです)。
いかがなもんでしょう?

特に、dl.cのはバグだと思いますです。
# 直し方がこれでいいかどうかは別として

Index: ext/dl/dl.c =================================================================== RCS file: /home/cvs/ruby/ext/dl/dl.c,v retrieving revision 1.8 diff -u -p -w -2 -r1.8 dl.c --- ext/dl/dl.c 2002/06/11 01:27:47 1.8 +++ ext/dl/dl.c 2002/06/11 10:48:04 @@ -609,5 +609,5 @@ rb_dl_callback(int argc, VALUE argv[], V break; default: - rb_raise(rb_eDLTypeError, "unsupported type `%s'", STR2CSTR(rettype)); + rb_raise(rb_eDLTypeError, "unsupported type `%c'", STR2CSTR(type)[0]); } Index: ext/dl/mkcallback.rb =================================================================== RCS file: /home/cvs/ruby/ext/dl/mkcallback.rb,v retrieving revision 1.2 diff -u -p -w -2 -r1.2 mkcallback.rb --- ext/dl/mkcallback.rb 2002/06/09 17:47:33 1.2 +++ ext/dl/mkcallback.rb 2002/06/11 10:48:04 @@ -34,5 +34,5 @@ def mkfunc(rettype, fnum, argc) " proto = rb_ary_entry(obj, 0);", " proc = rb_ary_entry(obj, 1);", - " rb_dl_scan_callback_args(buff, STR2CSTR(proto), &argc, &argv);", + " rb_dl_scan_callback_args(buff, STR2CSTR(proto), &argc, _((VALUE (*)[]))&argv);", " retval = rb_funcall2(proc, id_call, argc, argv);", "", Index: ext/win32ole/win32ole.c =================================================================== RCS file: /home/cvs/ruby/ext/win32ole/win32ole.c,v retrieving revision 1.1 diff -u -p -w -2 -r1.1 win32ole.c --- ext/win32ole/win32ole.c 2002/06/01 12:34:29 1.1 +++ ext/win32ole/win32ole.c 2002/06/11 10:48:05 @@ -4641,5 +4641,5 @@ ary2ptr_dispparams(ary, pdispparams) VALUE v; VARIANT *pvar; - for(i = 0; i < RARRAY(ary)->len && i < pdispparams->cArgs; i++) { + for(i = 0; i < RARRAY(ary)->len && (unsigned int)i < pdispparams->cArgs; i++) { v = rb_ary_entry(ary, i); pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
それでは -- U.Nakamura <usa / osb.att.ne.jp>