[ROOT] bug concerning interpreted exceptions

From: James Peachey (peachey@bigband.gsfc.nasa.gov)
Date: Tue Feb 04 2003 - 18:42:30 MET


Hi,

Building root 3.04.02 on Solaris 2.8 with WS 6.0 compiler I have
the following problem if I add the flags -DG__EXCEPTION and
-DG__STD_EXCEPTION in order to catch compiled exceptions in
the interpreter:

CC -O -KPIC -DG__REGEXP1 -DG__UNIX -DG__OSFDLL -Iinclude  -DG__EXCEPTION -DG__ST
D_EXCEPTION -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -ptr/data/anu/isdc/root-3.0
4.02/src/spud/sparc-sun-solaris2.8  -o cint/src/Api.o -c cint/src/Api.cxx
"cint/src/Api.cxx", line 338: Error: The name exception is ambiguous, exception 
and std::exception.
1 Error(s) detected.
make[2]: *** [cint/src/Api.o] Error 1

The problem is that in /usr/include/math.h on Solaris (which
gets #included somehow) there is a C structure with the
unfortunate name of exception, which is completely unrelated
to C++'s std::exception. Thus, even though in Api.cxx there
is a "using std::exception;" statement, the ambiguity
described above still occurs.

I find that if I fully qualify the typename exception in
cint/src/Api.cxx:338:

  catch(std::exception& x) {

...the problem goes away, and I am able to build Root.

However, in my code the problem comes back when I attempt
to derive a class from std::exception and make a dictionary
for it. Code generated by rootcint frequently (always?)
#includes math.h, and also uses the unqualified name exception,
resulting in the same ambiguity.

Although I am hitting this particular problem due to a poor
choice made by a proprietary OS, this seems to me like a more
general problem. Specifically, it would be more robust for all
code generated by Cint to qualify fully all typenames from
namespace std. Does this seem like a reasonable and/or feasible
thing to do?

Regards,
James



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