From 1349c6885196987a8a167b852ff5c482de834333 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Thu, 9 Feb 2006 01:35:33 +0000 Subject: re PR libgcj/25187 (dereferencing type-punned pointer warnings while building libgcj) 2006-02-08 Bryce McKinlay PR libgcj/25187: * gnu/gcj/io/natSimpleSHSStream.cc (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast. * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to _Jv_InterpFrame(). * boehm.cc: #undef some autoconf macros before including gc-config.h. (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable. (_Jv_MarkArray): Likewise. * java/lang/ref/natReference.cc (java::lang::ref::Reference::create): Simplify _Jv_GCRegisterDisappearingLink() call. * java/lang/Class.h (getComponentType): Use element_type. (element_type): New field declaration, as a union with "methods". * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type". * java/net/natVMNetworkInterfacePosix.cc (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to avoid sign comparison warning. * include/java-interp.h (_Jv_InterpFrame): Take thread as second argument, not parent call frame. * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly, without a cast. (restore_rt): Declare with hidden visibility, not "static". * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string constant. * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias warning From-SVN: r110783 --- libjava/jni.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libjava/jni.cc') diff --git a/libjava/jni.cc b/libjava/jni.cc index 5a93753..62a96ce 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -2426,7 +2426,12 @@ _Jv_JNI_DestroyJavaVM (JavaVM *vm) { JvAssert (the_vm && vm == the_vm); - JNIEnv *env; + union + { + JNIEnv *env; + void *env_p; + }; + if (_Jv_ThreadCurrent () != NULL) { jstring main_name; @@ -2440,8 +2445,7 @@ _Jv_JNI_DestroyJavaVM (JavaVM *vm) return JNI_ERR; } - jint r = _Jv_JNI_AttachCurrentThread (vm, main_name, - reinterpret_cast (&env), + jint r = _Jv_JNI_AttachCurrentThread (vm, main_name, &env_p, NULL, false); if (r < 0) return r; -- cgit v1.1