when looking for methods with ERTTI in CINT, one pattern is to check whether for a particular class name, method name and cprototype a G__InterfaceMethod is found. For example with root.
Here, minfo->InterfaceMethod() will evaluate to true, although there is no TNamed::SetName( int ). The other way around, looking for a char* in TH1F::SetBinsLength( int ) works fine, meaning minfo->InterfaceMethod() is NULL. Similarly a double for char* returns NULL, as does a pointer (e.g. TH1F*).
Is this a bug, or is this not expected to work like this? Thanks in advance!
(As background: I am trying to reduce a sigsev in RubyRoot to an exception)
thanks for your reply! I am a bit confused about the int to char* conversion, since this does not work with my compiler:
% cat main.cxx
#include "TNamed.h"
int main(int argc, char *argv[])
{
TNamed * tn = new TNamed();
tn->SetName( 1 );
return 0;
}
% make
/usr/bin/gcc -pthread -m32 -I/home/jschumac/root/root-head-svn/include -c main.cxx
main.cxx: In function ‘int main(int, char**)’:
main.cxx:6: error: invalid conversion from ‘int’ to ‘const char*’
main.cxx:6: error: initializing argument 1 of ‘virtual void TNamed::SetName(const char*)’
make: *** [main.o] Fehler 1
% g++ --version
g++ (GCC) 4.2.3 20080102 (prerelease) (Debian 4.2.2-5)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The same happens with 3.3 for example. Also, I tried changing my example code to use G__ClassInfo::ExactMatch: