From: "Johnson, Lyle" Date: 2002-02-15T22:42:52+09:00 Subject: RE: SWIG/Ruby woes with g++ 3.0 > I just found a problem with generated SWIG code and g++ 3.0.3 which > escaped me until now since I've been using 2.95.4. > > In short: > 1) the SWIG/Ruby wrappers define VALUEFUNC(f) as (VALUE (*)(...))f when > __cplusplus is defined. > 2) in the initialization function, VALUEFUNC(f) is passed to > rb_define_method as the 3rd argument > 3) However, in intern.h rb_define_method is declared as taking a 3rd > argument of type VALUE (*)(), i.e., no ellipsis > 4) g++ 2.95.4 didn't complain. g++ 3.0.3 does. It says that it "cannot > convert 'VALUE (*)(...)' to 'VALUE (*)()'" and fails. > > Any insight? Is this something that can be fixed? This has been fixed in the CVS version of SWIG (and presumably will show up in the SWIG 1.3.12 release). In the CVS version of SWIG 1.3, VALUEFUNC() is just an alias for RUBY_METHOD_FUNC(), which is the macro that Matz uses in "ruby.h" to do this typecase; so SWIG-generated wrappers *should* now always be consistent with the Ruby header files against which you're compiling.