[lug] g++ question: dynamic casts?
ed at eh3.com
Wed Jan 30 19:55:24 MST 2002
On Wed, 2002-01-30 at 19:10, Scott A. Herod wrote:
> I know there are some g++ experts around. I've got code that
> uses dynamic casts on objects retrieved from a library. The
> library was built with gcc 2.95.2. My code is built with 2.96.
> The dynamic cast dies; not returns null but dies. A static cast
> works and if I build with 2.95.2 the dynamic cast works.
> Should I be surprised and upset?
No, don't be upset. Thats to be expected.
While I don't have a URL reference handy, I'm certain that the name
mangling for RH's so-called "GCC 2.96 release" (which is *not* an
official GCC release) is (for *some* of the language front-ends that it
supports) different than that of both the official GCC 2.95.x releases
and the recent official GCC 3.x series. The GCC folks do try to
maintain (or is it guarantee?) name mangling compatibility within a
release series but will sometimes break it for new release series.
AFAIK, RH GCC 2.96 was a snapshot of the 3.x development tree and, as
such, is not C++-name-mangling-compatible with the 2.95.x series and is
*perhaps* not 100% C++-name-mangling-compatible with the final 3.x
series, either. Also I *think* I read that the C name mangling is
nearly 100% compatible between the 2.95.x, 2.96, and 3.x series.
Yes, its confusing. ;-)
Edward H. Hill III, PhD
Post-Doctoral Researcher | Email: ed at eh3.com, ehill at mines.edu
Division of ESE | URL: http://www.eh3.com
Colorado School of Mines | Phone: 303-273-3483
Golden, CO 80401 | Fax: 303-273-3311
Key fingerprint = 5BDE 4DA1 66BE 4F7B BC17 3A0C 932B 7266 1E76 F123
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 232 bytes
Desc: This is a digitally signed message part
More information about the LUG