[ROOT] Cint does not call operator const char *()

From: James Peachey (peachey@bigband.gsfc.nasa.gov)
Date: Thu Jan 09 2003 - 18:53:50 MET


Hello,

I am having problems with conversion operators being
called by Cint. Specifically, I have a class with an
operator const char *(), but I cannot pass an object
in this class say to strcmp. If I do I get an error
like:

Error: strcmp parameter mismatch param[0] C u FILE:A_test.C LINE:43
*** Interpreter error recovered ***

The attached tarfile should suffice to reproduce the
problem. I saw in April 2002 in the Cint digest there
was a short discussion of this problem, with the subject
line "[CINT] operator const char*() not called", concerning
the signature of strtol, which in Cint had a signature
which used char * instead of const char *. Indeed I find if
I change my operator to be operator char *(), Cint
calls the operator if I pass my object to strcmp.

However, I'd much rather define operator const char *(),
so my question is: could Cint's signatures for all
string-related functions be changed to make them
consistent with ISO standard C library signatures?

Thanks,
James

PS: I see this problem on both SunOS 5.8, with the WS 6.0 compiler,
and RedHat Linux 7.1, with g++ 3.1.1. In both cases, the
Root version is 3.03.07, which comes with Cint 5.15.50.





This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET