[ghemical-devel] complete MY_RTTI patch

Tommi Hassinen thassine@messi.uku.fi
Thu, 27 Mar 2003 13:40:04 +0200 (WET)


Hi,

I also compiled mpqc-2.1.3 using

	export CC=gcc-3.2
	export CXX=g++-3.2
	export F77=g77-3.2

and encountered the same error. I got no info about line numbers either,
but my guess is that the error happens at
mpqc-2.1.3/src/lib/util/keyval/keyvalstr.cc on line 122:

121:          DescribedClassProxy *proxy
122:              = dynamic_cast<DescribedClassProxy*>(newdc.pointer());
123:          if (proxy) {

As you see, there is a similar dynamic_cast statement that has caused the
earlier problems as well.

We still have the last dynamic_cast statement in qm1e_mpqc.cpp file, but
the above error seems to happen before we reach it; this indeed explains
why the breakpoint you set did not trigger. The problematic line is line
80, just a few lines above the set breakpoint:

80:	if (keyval->exists("matrixkit"))
81:	{
82:		SCMatrixKit::set_default_matrixkit(dynamic_cast<>...

About the background of this problem; when trying to compile the
"ghemical" app using g++-3.2, it was found that the dynamic_cast<>()
statements caused the program crash. I tried to make simple example
programs, but those seemed to work fine. Also the heavily modified
development version of the app had same symptoms, although the class
structure is quite different. Removing the statements from "ghemical"
seem to help but now it looks to that MPQC has similar behaviour with
dynamic_cast and g++-3.2.

I remember that about 4 months earlier, we were able to make .rpm packages
for RedHat8 and Mandrake9, and those report using gcc-3.2 as well:

$ g++ --version
g++ (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Copyright (C) 2002 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.

$ g++ --version
g++ (GCC) 3.2 (Mandrake Linux 9.0 3.2-1mdk)
Copyright (C) 2002 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.

Neither of the above machines are updated, just installed from rh8 and
mdk9 CD's. I recompiled and tested: no dynamic_cast problems there!

So is this either a new problem, or a Debian-related one? I have Debian
"stable" and "testing" installations here, and both seem to have the
problem with g++-3.2. I haven't tested g++3.1 or g++-3.0.

Regards,

	Tommi