dynamic_cast problem in JNI code - any suggestions welcome.
Jan Hardenbergh
hardenbergh@rtviz.com
Fri Nov 8 09:34:00 GMT 2002
We are running a Java app on Redhat 7.2 using gcc3 and we have some JNI
code. We have added some dynamic_cast operator to improve the error
checking, however, when running on Linux they crash.
My searches have found two interesting bugs. This one:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=7400
and a Debian bug report that was resolved by recompiling everything with the
same compiler. I can't refind that one right now, but this seems to be the
same, but with no conclusion - 134262.
The conclusion of gcc 7400 is wrong in our case because we change the
dynamic_cast to static_cast and it goes away.
We would like to keep running a java install from Sun, and I am NOT eager to
bring everything "up to rev" unless someone really believes it will fix it,
and the dynamic_cast gives us a little bit more protection from "users"
passing in junk.
The potential choices of Master Samwise:
1) take the easy way out and #ifdef the dynamic_cast for gcc/Linux (almost
no time, but icky)
2) bring everything up to rev (will anyone help when it still
occurs?)(moderate time)
3) start using the gcj environment (huge investment of time)
Any advice?
YON - Jan C. Hardenbergh - http://www.terarecon.com - http://www.jch.com/jch
More information about the Java
mailing list