diff --git a/java/rocksjni/comparatorjnicallback.cc b/java/rocksjni/comparatorjnicallback.cc index fcae16c7c00a0920e3996a0223e46a7d45cd9440..a85b4508558ba079f5d4a89d68e4ae0dc0706dd1 100644 --- a/java/rocksjni/comparatorjnicallback.cc +++ b/java/rocksjni/comparatorjnicallback.cc @@ -17,7 +17,7 @@ BaseComparatorJniCallback::BaseComparatorJniCallback( mtx_findShortestSeparator(new port::Mutex(copt->use_adaptive_mutex)) { // Note: Comparator methods may be accessed by multiple threads, // so we ref the jvm not the env - const jint rs = env->GetJavaVM(&m_jvm); + const jint rs __attribute__((unused)) = env->GetJavaVM(&m_jvm); assert(rs == JNI_OK); // Note: we want to access the Java Comparator instance @@ -42,7 +42,8 @@ BaseComparatorJniCallback::BaseComparatorJniCallback( */ JNIEnv* BaseComparatorJniCallback::getJniEnv() const { JNIEnv *env; - jint rs = m_jvm->AttachCurrentThread(reinterpret_cast(&env), NULL); + jint rs __attribute__((unused)) = + m_jvm->AttachCurrentThread(reinterpret_cast(&env), NULL); assert(rs == JNI_OK); return env; } diff --git a/java/rocksjni/loggerjnicallback.cc b/java/rocksjni/loggerjnicallback.cc index 094049aadb09f23d3d007e69abb56cb43e6734d6..46bef2868481518edaf13c8d6851e514ff8c1df1 100644 --- a/java/rocksjni/loggerjnicallback.cc +++ b/java/rocksjni/loggerjnicallback.cc @@ -30,7 +30,8 @@ LoggerJniCallback::LoggerJniCallback( */ JNIEnv* LoggerJniCallback::getJniEnv() const { JNIEnv *env; - jint rs = m_jvm->AttachCurrentThread(reinterpret_cast(&env), NULL); + jint rs __attribute__((unused)) = + m_jvm->AttachCurrentThread(reinterpret_cast(&env), NULL); assert(rs == JNI_OK); return env; }