Enable -Wall -Wextra for libcore and cleanup all but one warning

Change-Id: Ied76662c470ba878cec61189acf29f5cbbd4ccd4
diff --git a/NativeCode.mk b/NativeCode.mk
index 41ca7cb..d448877 100644
--- a/NativeCode.mk
+++ b/NativeCode.mk
@@ -85,6 +85,8 @@
 
 include $(CLEAR_VARS)
 
+LOCAL_CFLAGS += -Wall -Wextra
+
 ifeq ($(TARGET_ARCH),arm)
 # Ignore "note: the mangling of 'va_list' has changed in GCC 4.4"
 LOCAL_CFLAGS += -Wno-psabi
diff --git a/dalvik/src/main/native/dalvik_system_TouchDex.cpp b/dalvik/src/main/native/dalvik_system_TouchDex.cpp
index b2614c9..719ac3c 100644
--- a/dalvik/src/main/native/dalvik_system_TouchDex.cpp
+++ b/dalvik/src/main/native/dalvik_system_TouchDex.cpp
@@ -52,7 +52,7 @@
  * private static int trampoline(String dexFiles, String bcp)
  */
 static jint dalvik_system_TouchDex_trampoline(JNIEnv* env,
-    jclass clazz, jstring dexFilesStr, jstring bcpStr)
+    jclass, jstring dexFilesStr, jstring bcpStr)
 {
 #ifndef HAVE_ANDROID_OS
     /* don't do this on simulator -- gdb goes "funny" in goobuntu */
@@ -69,7 +69,6 @@
     static const char* kClassName = "dalvik.system.TouchDex";
     static const char* kExecMode = "-Xint";
     static const int argc = 7;
-    char* bcpArg;
     const char* argv[argc+1];
     const char* kVerifyArg;
     const char* kDexOptArg;
diff --git a/dalvik/src/main/native/org_apache_harmony_dalvik_NativeTestTarget.c b/dalvik/src/main/native/org_apache_harmony_dalvik_NativeTestTarget.c
index 9aa0a8e..8cef72e 100644
--- a/dalvik/src/main/native/org_apache_harmony_dalvik_NativeTestTarget.c
+++ b/dalvik/src/main/native/org_apache_harmony_dalvik_NativeTestTarget.c
@@ -21,7 +21,7 @@
  *
  * For benchmarks, a do-nothing JNI method with no arguments.
  */
-static void emptyJniStaticMethod0(JNIEnv* env, jclass clazz)
+static void emptyJniStaticMethod0(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)))
 {
     // This space intentionally left blank.
 }
@@ -32,8 +32,8 @@
  *
  * For benchmarks, a do-nothing JNI method with six arguments.
  */
-static void emptyJniStaticMethod6(JNIEnv* env, jclass clazz,
-    int a, int b, int c, int d, int e, int f)
+static void emptyJniStaticMethod6(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)),
+    int a __attribute__ ((unused)), int b __attribute__ ((unused)), int c __attribute__ ((unused)), int d __attribute__ ((unused)), int e __attribute__ ((unused)), int f __attribute__ ((unused)))
 {
     // This space intentionally left blank.
 }
@@ -44,8 +44,8 @@
  *
  * For benchmarks, a do-nothing JNI method with six arguments.
  */
-static void emptyJniStaticMethod6L(JNIEnv* env, jclass clazz,
-    jobject a, jarray b, jarray c, jobject d, jarray e, jarray f)
+static void emptyJniStaticMethod6L(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)),
+    jobject a __attribute__ ((unused)), jarray b __attribute__ ((unused)), jarray c __attribute__ ((unused)), jobject d __attribute__ ((unused)), jarray e __attribute__ ((unused)), jarray f __attribute__ ((unused)))
 {
     // This space intentionally left blank.
 }
diff --git a/luni/src/main/native/BidiWrapper.cpp b/luni/src/main/native/BidiWrapper.cpp
index 03efa92..3ec51cb 100644
--- a/luni/src/main/native/BidiWrapper.cpp
+++ b/luni/src/main/native/BidiWrapper.cpp
@@ -60,11 +60,11 @@
     return reinterpret_cast<BiDiData*>(static_cast<uintptr_t>(ptr))->uBiDi();
 }
 
-static jlong BidiWrapper_ubidi_open(JNIEnv* env, jclass) {
+static jlong BidiWrapper_ubidi_open(JNIEnv*, jclass) {
     return reinterpret_cast<uintptr_t>(new BiDiData(ubidi_open()));
 }
 
-static void BidiWrapper_ubidi_close(JNIEnv* env, jclass, jlong ptr) {
+static void BidiWrapper_ubidi_close(JNIEnv*, jclass, jlong ptr) {
     delete biDiData(ptr);
 }
 
@@ -97,15 +97,15 @@
     return reinterpret_cast<uintptr_t>(lineData.release());
 }
 
-static jint BidiWrapper_ubidi_getDirection(JNIEnv * env, jclass clazz, jlong ptr) {
+static jint BidiWrapper_ubidi_getDirection(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getDirection(uBiDi(ptr));
 }
 
-static jint BidiWrapper_ubidi_getLength(JNIEnv* env, jclass, jlong ptr) {
+static jint BidiWrapper_ubidi_getLength(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getLength(uBiDi(ptr));
 }
 
-static jbyte BidiWrapper_ubidi_getParaLevel(JNIEnv* env, jclass, jlong ptr) {
+static jbyte BidiWrapper_ubidi_getParaLevel(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getParaLevel(uBiDi(ptr));
 }
 
diff --git a/luni/src/main/native/ICU.cpp b/luni/src/main/native/ICU.cpp
index 4f08513..1945b69 100644
--- a/luni/src/main/native/ICU.cpp
+++ b/luni/src/main/native/ICU.cpp
@@ -358,7 +358,7 @@
     return env->NewString(displayName.getBuffer(), displayName.length());
 }
 
-static bool getDayIntVector(JNIEnv* env, UResourceBundle* gregorian, int* values) {
+static bool getDayIntVector(JNIEnv*, UResourceBundle* gregorian, int* values) {
     // get the First day of week and the minimal days in first week numbers
     UErrorCode status = U_ZERO_ERROR;
     ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "DateTimeElements", NULL, &status));
diff --git a/luni/src/main/native/NativeBreakIterator.cpp b/luni/src/main/native/NativeBreakIterator.cpp
index 0be7630..e2db39a 100644
--- a/luni/src/main/native/NativeBreakIterator.cpp
+++ b/luni/src/main/native/NativeBreakIterator.cpp
@@ -34,7 +34,7 @@
     return reinterpret_cast<uintptr_t>(it);
 }
 
-static jint getCharacterInstanceImpl(JNIEnv* env, jclass clazz, jstring locale) {
+static jint getCharacterInstanceImpl(JNIEnv* env, jclass, jstring locale) {
     return getIterator(env, locale, UBRK_CHARACTER);
 }
 
@@ -54,7 +54,7 @@
     return reinterpret_cast<UBreakIterator*>(static_cast<uintptr_t>(address));
 }
 
-static void closeBreakIteratorImpl(JNIEnv* env, jclass, jint address) {
+static void closeBreakIteratorImpl(JNIEnv*, jclass, jint address) {
     ubrk_close(breakIterator(address));
 }
 
@@ -78,7 +78,7 @@
     return ubrk_isBoundary(breakIterator(address), offset);
 }
 
-static jint nextImpl(JNIEnv* env, jclass, jint address, jint n) {
+static jint nextImpl(JNIEnv*, jclass, jint address, jint n) {
     UBreakIterator* bi = breakIterator(address);
     if (n < 0) {
         while (n++ < -1) {
diff --git a/luni/src/main/native/NativeCollation.cpp b/luni/src/main/native/NativeCollation.cpp
index 9a092e8..ce76786 100644
--- a/luni/src/main/native/NativeCollation.cpp
+++ b/luni/src/main/native/NativeCollation.cpp
@@ -26,11 +26,11 @@
     return reinterpret_cast<UCollationElements*>(static_cast<uintptr_t>(address));
 }
 
-static void closeCollator(JNIEnv* env, jclass, jint address) {
+static void closeCollator(JNIEnv*, jclass, jint address) {
     ucol_close(toCollator(address));
 }
 
-static void closeElements(JNIEnv* env, jclass, jint address) {
+static void closeElements(JNIEnv*, jclass, jint address) {
     ucol_closeElements(toCollationElements(address));
 }
 
@@ -58,7 +58,7 @@
     return static_cast<jint>(reinterpret_cast<uintptr_t>(result));
 }
 
-static jint getMaxExpansion(JNIEnv* env, jclass, jint address, jint order) {
+static jint getMaxExpansion(JNIEnv*, jclass, jint address, jint order) {
     return ucol_getMaxExpansion(toCollationElements(address), order);
 }
 
@@ -75,7 +75,7 @@
     icu4jni_error(env, status);
 }
 
-static jint getOffset(JNIEnv* env, jclass, jint address) {
+static jint getOffset(JNIEnv*, jclass, jint address) {
     return ucol_getOffset(toCollationElements(address));
 }
 
@@ -139,7 +139,7 @@
     return result;
 }
 
-static void reset(JNIEnv* env, jclass, jint address) {
+static void reset(JNIEnv*, jclass, jint address) {
     ucol_reset(toCollationElements(address));
 }
 
diff --git a/luni/src/main/native/NativeConverter.cpp b/luni/src/main/native/NativeConverter.cpp
index 9e962ad..5ef5329 100644
--- a/luni/src/main/native/NativeConverter.cpp
+++ b/luni/src/main/native/NativeConverter.cpp
@@ -48,7 +48,7 @@
     return (jlong) conv;
 }
 
-static void closeConverter(JNIEnv* env, jclass, jlong handle) {
+static void closeConverter(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)(long)handle;
     if (cnv) {
         // BEGIN android-added
@@ -87,7 +87,7 @@
  * @param data buffer to recieve state of the current conversion
  * @param flush boolean that specifies end of source input
  */
-static jint convertCharToByte(JNIEnv *env, jclass, jlong handle,  jcharArray source,  jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) {
+static jint convertCharToByte(JNIEnv* env, jclass, jlong handle,  jcharArray source,  jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) {
 
     UErrorCode errorCode =U_ZERO_ERROR;
     UConverter* cnv = (UConverter*)handle;
@@ -134,7 +134,7 @@
     return errorCode;
 }
 
-static jint encode(JNIEnv *env, jclass, jlong handle, jcharArray source, jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) {
+static jint encode(JNIEnv* env, jclass, jlong handle, jcharArray source, jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) {
    
     UErrorCode ec = UErrorCode(convertCharToByte(env, NULL,handle,source,sourceEnd, target,targetEnd,data,flush));
     UConverter* cnv = (UConverter*)handle;
@@ -171,7 +171,7 @@
  * @param data buffer to recieve state of the current conversion
  * @param flush boolean that specifies end of source input
  */
-static jint convertByteToChar(JNIEnv *env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) {
+static jint convertByteToChar(JNIEnv* env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) {
 
     UErrorCode errorCode =U_ZERO_ERROR;
     UConverter* cnv = (UConverter*)handle;
@@ -219,7 +219,7 @@
     return errorCode;
 }
 
-static jint decode(JNIEnv *env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) {
+static jint decode(JNIEnv* env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) {
 
     jint ec = convertByteToChar(env, NULL,handle,source,sourceEnd, target,targetEnd,data,flush);
 
@@ -244,31 +244,31 @@
     return ec;
 }
 
-static void resetByteToChar(JNIEnv* env, jclass, jlong handle) {
+static void resetByteToChar(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)handle;
     if (cnv) {
         ucnv_resetToUnicode(cnv);
     }
 }
 
-static void resetCharToByte(JNIEnv* env, jclass, jlong handle) {
+static void resetCharToByte(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)handle;
     if (cnv) {
         ucnv_resetFromUnicode(cnv);
     }
 }
 
-static jint getMaxBytesPerChar(JNIEnv *env, jclass, jlong handle) {
+static jint getMaxBytesPerChar(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)handle;
     return (cnv != NULL) ? ucnv_getMaxCharSize(cnv) : -1;
 }
 
-static jint getMinBytesPerChar(JNIEnv *env, jclass, jlong handle) {
+static jint getMinBytesPerChar(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)handle;
     return (cnv != NULL) ? ucnv_getMinCharSize(cnv) : -1;
 }
 
-static jfloat getAveBytesPerChar(JNIEnv *env, jclass, jlong handle) {
+static jfloat getAveBytesPerChar(JNIEnv*, jclass, jlong handle) {
     UConverter* cnv = (UConverter*)handle;
     if (cnv) {
          jfloat max = (jfloat)ucnv_getMaxCharSize(cnv);
@@ -278,7 +278,7 @@
     return -1;
 }
 
-static jint flushByteToChar(JNIEnv *env, jclass,jlong handle, jcharArray target, jint targetEnd, jintArray data) {
+static jint flushByteToChar(JNIEnv* env, jclass,jlong handle, jcharArray target, jint targetEnd, jintArray data) {
 
     UErrorCode errorCode =U_ZERO_ERROR;
     UConverter* cnv = (UConverter*)handle;
@@ -319,7 +319,7 @@
     return errorCode;
 }
 
-static jint flushCharToByte (JNIEnv *env, jclass, jlong handle, jbyteArray target, jint targetEnd, jintArray data) {
+static jint flushCharToByte (JNIEnv* env, jclass, jlong handle, jbyteArray target, jint targetEnd, jintArray data) {
           
     UErrorCode errorCode =U_ZERO_ERROR;
     UConverter* cnv = (UConverter*)handle;
@@ -367,7 +367,7 @@
         --length;
     }
 }
-static jint setSubstitutionBytes(JNIEnv *env, jclass, jlong handle, jbyteArray subChars, jint length) {
+static jint setSubstitutionBytes(JNIEnv* env, jclass, jlong handle, jbyteArray subChars, jint length) {
     UConverter* cnv = (UConverter*) handle;
     UErrorCode errorCode = U_ZERO_ERROR;
     if (cnv) {
@@ -485,7 +485,7 @@
     return;
 }
 
-static jboolean canEncode(JNIEnv *env, jclass, jlong handle, jint codeUnit) {
+static jboolean canEncode(JNIEnv*, jclass, jlong handle, jint codeUnit) {
     
     UErrorCode errorCode =U_ZERO_ERROR;
     UConverter* cnv = (UConverter*)handle;
@@ -519,7 +519,7 @@
  * the registry must be valid aliases. If a supported charset is not listed in the IANA
  * registry then its canonical name must begin with one of the strings "X-" or "x-".
  */
-static jstring getJavaCanonicalName(JNIEnv *env, const char* icuCanonicalName) {
+static jstring getJavaCanonicalName(JNIEnv* env, const char* icuCanonicalName) {
     UErrorCode status = U_ZERO_ERROR;
 
     // Check to see if this is a well-known MIME or IANA name.
@@ -556,7 +556,7 @@
     return env->NewStringUTF(&result[0]);
 }
 
-static jobjectArray getAvailableCharsetNames(JNIEnv *env, jclass) {
+static jobjectArray getAvailableCharsetNames(JNIEnv* env, jclass) {
     int32_t num = ucnv_countAvailable();
     jobjectArray result = env->NewObjectArray(num, env->FindClass("java/lang/String"), NULL);
     for (int i = 0; i < num; ++i) {
@@ -707,7 +707,7 @@
     }
 }
 
-static jint setCallbackEncode(JNIEnv *env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jbyteArray subChars, jint length) {
+static jint setCallbackEncode(JNIEnv* env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jbyteArray subChars, jint length) {
 
     UConverter* conv = (UConverter*)handle;
     UErrorCode errorCode =U_ZERO_ERROR;
@@ -836,7 +836,7 @@
     }      
 }
 
-static jint setCallbackDecode(JNIEnv *env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jcharArray subChars, jint length) {
+static jint setCallbackDecode(JNIEnv* env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jcharArray subChars, jint length) {
     
     UConverter* conv = (UConverter*)handle;
     UErrorCode errorCode =U_ZERO_ERROR;
@@ -886,18 +886,18 @@
     return U_ILLEGAL_ARGUMENT_ERROR;
 }
 
-static jint getMaxCharsPerByte(JNIEnv *env, jclass, jlong handle) {
+static jint getMaxCharsPerByte(JNIEnv*, jclass, jlong) {
     /*
      * currently we know that max number of chars per byte is 2
      */
     return 2;
 }
 
-static jfloat getAveCharsPerByte(JNIEnv *env, jclass, jlong handle) {
+static jfloat getAveCharsPerByte(JNIEnv* env, jclass, jlong handle) {
     return (1 / (jfloat) getMaxBytesPerChar(env, NULL, handle));
 }
 
-static jbyteArray getSubstitutionBytes(JNIEnv *env, jclass, jlong handle) {
+static jbyteArray getSubstitutionBytes(JNIEnv* env, jclass, jlong handle) {
     const UConverter * cnv = (const UConverter *) handle;
     if (cnv) {
         UErrorCode status = U_ZERO_ERROR;
@@ -915,7 +915,7 @@
     return env->NewByteArray(0);
 }
 
-static jboolean contains(JNIEnv* env, jclass, jlong handle1, jlong handle2) {
+static jboolean contains(JNIEnv*, jclass, jlong handle1, jlong handle2) {
     UErrorCode status = U_ZERO_ERROR;
     const UConverter * cnv1 = (const UConverter *) handle1;
     const UConverter * cnv2 = (const UConverter *) handle2;
diff --git a/luni/src/main/native/NativeDecimalFormat.cpp b/luni/src/main/native/NativeDecimalFormat.cpp
index 8f39a39..606f2cc 100644
--- a/luni/src/main/native/NativeDecimalFormat.cpp
+++ b/luni/src/main/native/NativeDecimalFormat.cpp
@@ -77,7 +77,7 @@
     toDecimalFormat(addr)->adoptDecimalFormatSymbols(symbols);
 }
 
-static jint openDecimalFormatImpl(JNIEnv* env, jclass clazz, jstring pattern0,
+static jint openDecimalFormatImpl(JNIEnv* env, jclass, jstring pattern0,
         jstring currencySymbol, jchar decimalSeparator, jchar digit,
         jchar groupingSeparator, jstring infinity,
         jstring internationalCurrencySymbol, jchar minusSign,
@@ -103,11 +103,11 @@
     return static_cast<jint>(reinterpret_cast<uintptr_t>(fmt));
 }
 
-static void closeDecimalFormatImpl(JNIEnv* env, jclass, jint addr) {
+static void closeDecimalFormatImpl(JNIEnv*, jclass, jint addr) {
     delete toDecimalFormat(addr);
 }
 
-static void setRoundingMode(JNIEnv* env, jclass, jint addr, jint mode, jdouble increment) {
+static void setRoundingMode(JNIEnv*, jclass, jint addr, jint mode, jdouble increment) {
     DecimalFormat* fmt = toDecimalFormat(addr);
     fmt->setRoundingMode(static_cast<DecimalFormat::ERoundingMode>(mode));
     fmt->setRoundingIncrement(increment);
@@ -123,7 +123,7 @@
     env->ReleaseStringChars(s, chars);
 }
 
-static void setAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol,
+static void setAttribute(JNIEnv*, jclass, jint addr, jint symbol,
         jint value) {
 
     UNumberFormat *fmt = (UNumberFormat *)(int)addr;
@@ -131,7 +131,7 @@
     unum_setAttribute(fmt, (UNumberFormatAttribute) symbol, value);
 }
 
-static jint getAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol) {
+static jint getAttribute(JNIEnv*, jclass, jint addr, jint symbol) {
 
     UNumberFormat *fmt = (UNumberFormat *)(int)addr;
 
@@ -140,7 +140,7 @@
     return res;
 }
 
-static void setTextAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol,
+static void setTextAttribute(JNIEnv* env, jclass, jint addr, jint symbol,
         jstring text) {
 
     // the errorcode returned by unum_setTextAttribute
@@ -160,7 +160,7 @@
     icu4jni_error(env, status);
 }
 
-static jstring getTextAttribute(JNIEnv *env, jclass clazz, jint addr,
+static jstring getTextAttribute(JNIEnv* env, jclass, jint addr,
         jint symbol) {
 
     uint32_t resultlength, reslenneeded;
@@ -198,7 +198,7 @@
     return res;
 }
 
-static void applyPatternImpl(JNIEnv *env, jclass clazz, jint addr, jboolean localized, jstring pattern0) {
+static void applyPatternImpl(JNIEnv* env, jclass, jint addr, jboolean localized, jstring pattern0) {
     if (pattern0 == NULL) {
         jniThrowNullPointerException(env, NULL);
         return;
@@ -214,7 +214,7 @@
     icu4jni_error(env, status);
 }
 
-static jstring toPatternImpl(JNIEnv *env, jclass, jint addr, jboolean localized) {
+static jstring toPatternImpl(JNIEnv* env, jclass, jint addr, jboolean localized) {
     DecimalFormat* fmt = toDecimalFormat(addr);
     UnicodeString pattern;
     if (localized) {
@@ -226,9 +226,7 @@
 }
 
 template <typename T>
-static jstring format(JNIEnv *env, jint addr, jobject field, jstring fieldType, jobject attributes, T val) {
-    UErrorCode status = U_ZERO_ERROR;
-
+static jstring format(JNIEnv* env, jint addr, jobject field, jstring fieldType, jobject attributes, T val) {
     DecimalFormat::AttributeBuffer attrBuffer;
     attrBuffer.buffer = NULL;
     DecimalFormat::AttributeBuffer* attrBufferPtr = NULL;
@@ -302,7 +300,7 @@
     return format(env, addr, field, fieldType, attributes, doubleValue);
 }
 
-static jstring formatDigitList(JNIEnv *env, jclass clazz, jint addr, jstring value,
+static jstring formatDigitList(JNIEnv* env, jclass, jint addr, jstring value,
         jobject field, jstring fieldType, jobject attributes, jint scale) {
 
     // const char * valueUTF = env->GetStringUTFChars(value, NULL);
@@ -470,7 +468,7 @@
     return resulting;
 }
 
-static jobject parse(JNIEnv *env, jclass clazz, jint addr, jstring text,
+static jobject parse(JNIEnv* env, jclass, jint addr, jstring text,
         jobject position) {
     // TODO: cache these?
     jclass parsePositionClass = env->FindClass("java/text/ParsePosition");
@@ -490,7 +488,6 @@
     jmethodID dblInitMethodID = env->GetMethodID(doubleClass, "<init>", "(D)V");
     jmethodID bigDecimalInitMethodID = env->GetMethodID(bigDecimalClass, "<init>", "(Ljava/math/BigInteger;I)V");
     jmethodID bigIntegerInitMethodID = env->GetMethodID(bigIntegerClass, "<init>", "(Ljava/lang/String;)V");
-    jmethodID doubleValueMethodID = env->GetMethodID(bigDecimalClass, "doubleValue", "()D");
 
     // make sure the ParsePosition is valid. Actually icu4c would parse a number
     // correctly even if the parsePosition is set to -1, but since the RI fails
@@ -523,7 +520,6 @@
     }
 
     Formattable::Type numType = res.getType();
-    UErrorCode fmtStatus;
 
     double resultDouble;
     long resultLong;
@@ -579,7 +575,7 @@
     }
 }
 
-static jint cloneDecimalFormatImpl(JNIEnv *env, jclass, jint addr) {
+static jint cloneDecimalFormatImpl(JNIEnv*, jclass, jint addr) {
     DecimalFormat* fmt = toDecimalFormat(addr);
     return static_cast<jint>(reinterpret_cast<uintptr_t>(fmt->clone()));
 }
diff --git a/luni/src/main/native/NativeRegEx.cpp b/luni/src/main/native/NativeRegEx.cpp
index 511f1e4..513dc41 100644
--- a/luni/src/main/native/NativeRegEx.cpp
+++ b/luni/src/main/native/NativeRegEx.cpp
@@ -58,7 +58,7 @@
     jniThrowRuntimeException(env, u_errorName(status));
 }
 
-static void _close(JNIEnv* env, jclass clazz, RegExData* data)
+static void _close(JNIEnv*, jclass, RegExData* data)
 {
     if (data->regex != NULL) {
         uregex_close(data->regex);
@@ -81,7 +81,6 @@
     UParseError error;
     error.offset = -1;
 
-    jchar const * patternRaw;
     int patternLen = env->GetStringLength(pattern);
     if (patternLen == 0) {
         data->regex = uregex_open(&EMPTY_STRING, -1, flags, &error, &status);
@@ -101,7 +100,7 @@
     return data;
 }
 
-static RegExData* _clone(JNIEnv* env, jclass clazz, RegExData* data)
+static RegExData* _clone(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
 
@@ -116,7 +115,7 @@
     return result;
 }
 
-static void setText(JNIEnv* env, jclass clazz, RegExData* data, jstring text)
+static void setText(JNIEnv* env, jclass, RegExData* data, jstring text)
 {
     UErrorCode status = U_ZERO_ERROR;
 
@@ -146,7 +145,7 @@
     }
 }
 
-static jboolean matches(JNIEnv* env, jclass clazz, RegExData* data,
+static jboolean matches(JNIEnv* env, jclass, RegExData* data,
                         jint startIndex)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -159,7 +158,7 @@
     return result;
 }
 
-static jboolean lookingAt(JNIEnv* env, jclass clazz, RegExData* data,
+static jboolean lookingAt(JNIEnv* env, jclass, RegExData* data,
                           jint startIndex)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -172,7 +171,7 @@
     return result;
 }
 
-static jboolean find(JNIEnv* env, jclass clazz, RegExData* data,
+static jboolean find(JNIEnv* env, jclass, RegExData* data,
                      jint startIndex)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -185,7 +184,7 @@
     return result;
 }
 
-static jboolean findNext(JNIEnv* env, jclass clazz, RegExData* data)
+static jboolean findNext(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
 
@@ -197,7 +196,7 @@
     return result;
 }
 
-static jint groupCount(JNIEnv* env, jclass clazz, RegExData* data)
+static jint groupCount(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
 
@@ -209,7 +208,7 @@
     return result;
 }
 
-static void startEnd(JNIEnv* env, jclass clazz, RegExData* data,
+static void startEnd(JNIEnv* env, jclass, RegExData* data,
                      jintArray offsets)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -229,7 +228,7 @@
     }
 }
 
-static void setRegion(JNIEnv* env, jclass clazz, RegExData* data, jint start,
+static void setRegion(JNIEnv* env, jclass, RegExData* data, jint start,
                       jint end)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -239,7 +238,7 @@
     }
 }
 
-static jint regionStart(JNIEnv* env, jclass clazz, RegExData* data)
+static jint regionStart(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     int result = uregex_regionStart(data->regex, &status);
@@ -249,7 +248,7 @@
     return result;
 }
 
-static jint regionEnd(JNIEnv* env, jclass clazz, RegExData* data)
+static jint regionEnd(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     int result = uregex_regionEnd(data->regex, &status);
@@ -259,7 +258,7 @@
     return result;
 }
 
-static void useTransparentBounds(JNIEnv* env, jclass clazz, RegExData* data,
+static void useTransparentBounds(JNIEnv* env, jclass, RegExData* data,
                                  jboolean value)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -269,7 +268,7 @@
     }
 }
 
-static jboolean hasTransparentBounds(JNIEnv* env, jclass clazz, RegExData* data)
+static jboolean hasTransparentBounds(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     jboolean result = uregex_hasTransparentBounds(data->regex, &status);
@@ -279,7 +278,7 @@
     return result;
 }
 
-static void useAnchoringBounds(JNIEnv* env, jclass clazz, RegExData* data,
+static void useAnchoringBounds(JNIEnv* env, jclass, RegExData* data,
                                jboolean value)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -289,7 +288,7 @@
     }
 }
 
-static jboolean hasAnchoringBounds(JNIEnv* env, jclass clazz, RegExData* data)
+static jboolean hasAnchoringBounds(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     jboolean result = uregex_hasAnchoringBounds(data->regex, &status);
@@ -299,7 +298,7 @@
     return result;
 }
 
-static jboolean hitEnd(JNIEnv* env, jclass clazz, RegExData* data)
+static jboolean hitEnd(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     jboolean result = uregex_hitEnd(data->regex, &status);
@@ -309,7 +308,7 @@
     return result;
 }
 
-static jboolean requireEnd(JNIEnv* env, jclass clazz, RegExData* data)
+static jboolean requireEnd(JNIEnv* env, jclass, RegExData* data)
 {
     UErrorCode status = U_ZERO_ERROR;
     jboolean result = uregex_requireEnd(data->regex, &status);
@@ -319,7 +318,7 @@
     return result;
 }
 
-static void reset(JNIEnv* env, jclass clazz, RegExData* data, jint position)
+static void reset(JNIEnv* env, jclass, RegExData* data, jint position)
 {
     UErrorCode status = U_ZERO_ERROR;
     uregex_reset(data->regex, position, &status);
diff --git a/luni/src/main/native/commonDblParce.c b/luni/src/main/native/commonDblParce.c
index 5d85645..74debb5 100644
--- a/luni/src/main/native/commonDblParce.c
+++ b/luni/src/main/native/commonDblParce.c
@@ -135,10 +135,8 @@
 /* *********************************************************** */
 
 /* ************** private function declarations ************** */
-static U_64 dblparse_shiftRight64 (U_64 * lp, volatile int mbe);
- 
-static jdouble createDouble1   (JNIEnv * env, U_64 * f, IDATA length, jint e);
-static jdouble doubleAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e,
+static jdouble createDouble1   (JNIEnv* env, U_64 * f, IDATA length, jint e);
+static jdouble doubleAlgorithm (JNIEnv* env, U_64 * f, IDATA length, jint e,
                                 jdouble z);
 /* *********************************************************** */
 
@@ -148,7 +146,7 @@
 #define sizeOfTenToTheE(e) (((e) / 19) + 1)
 
 jdouble
-createDouble (JNIEnv * env, const char *s, jint e)
+createDouble (JNIEnv* env, const char *s, jint e)
 {
   /* assumes s is a null terminated string with at least one
    * character in it */
@@ -253,7 +251,7 @@
 }
 
 jdouble
-createDouble1 (JNIEnv * env, U_64 * f, IDATA length, jint e)
+createDouble1 (JNIEnv* env, U_64 * f, IDATA length, jint e)
 {
   IDATA numBits;
   jdouble result;
@@ -320,84 +318,6 @@
   return doubleAlgorithm (env, f, length, e, result);
 }
 
-static U_64
-dblparse_shiftRight64 (U_64 * lp, volatile int mbe)
-{
-  U_64 b1Value = 0;
-  U_32 hi      = HIGH_U32_FROM_LONG64_PTR (lp);
-  U_32 lo      = LOW_U32_FROM_LONG64_PTR (lp);
-  int srAmt;
-
-  if (mbe == 0)
-    return 0;
-  if (mbe >= 128)
-    {
-      HIGH_U32_FROM_LONG64_PTR (lp) = 0;
-      LOW_U32_FROM_LONG64_PTR  (lp) = 0;
-      return 0;
-    }
-
-  /* Certain platforms do not handle de-referencing a 64-bit value
-   * from a pointer on the stack correctly (e.g. MVL-hh/XScale)
-   * because the pointer may not be properly aligned, so we'll have
-   * to handle two 32-bit chunks. */
-  if (mbe < 32)
-    {
-      LOW_U32_FROM_LONG64      (b1Value) =  0;
-      HIGH_U32_FROM_LONG64     (b1Value) =  lo  << (32 - mbe);
-      LOW_U32_FROM_LONG64_PTR  (lp)      = (hi << (32 - mbe)) | (lo >> mbe);
-      HIGH_U32_FROM_LONG64_PTR (lp)      =  hi  >> mbe;
-    }
-  else if (mbe == 32)
-    {
-      LOW_U32_FROM_LONG64      (b1Value) = 0;
-      HIGH_U32_FROM_LONG64     (b1Value) = lo;
-      LOW_U32_FROM_LONG64_PTR  (lp)      = hi;
-      HIGH_U32_FROM_LONG64_PTR (lp)      = 0;
-    }
-  else if (mbe < 64)
-    {
-      srAmt = mbe - 32;
-      LOW_U32_FROM_LONG64      (b1Value) =  lo << (32 - srAmt);
-      HIGH_U32_FROM_LONG64     (b1Value) = (hi << (32 - srAmt)) | (lo >> srAmt);
-      LOW_U32_FROM_LONG64_PTR  (lp)      =  hi >> srAmt;
-      HIGH_U32_FROM_LONG64_PTR (lp)      =  0;
-    }
-  else if (mbe == 64)
-    {
-      LOW_U32_FROM_LONG64      (b1Value) = lo;
-      HIGH_U32_FROM_LONG64     (b1Value) = hi;
-      LOW_U32_FROM_LONG64_PTR  (lp)      = 0;
-      HIGH_U32_FROM_LONG64_PTR (lp)      = 0;
-    }
-  else if (mbe < 96)
-    {
-      srAmt = mbe - 64;
-      b1Value = *lp;
-      HIGH_U32_FROM_LONG64_PTR (lp)        = 0;
-      LOW_U32_FROM_LONG64_PTR  (lp)        = 0;
-      LOW_U32_FROM_LONG64      (b1Value) >>= srAmt;
-      LOW_U32_FROM_LONG64      (b1Value)  |= (hi << (32 - srAmt));
-      HIGH_U32_FROM_LONG64     (b1Value) >>= srAmt;
-    }
-  else if (mbe == 96)
-    {
-      LOW_U32_FROM_LONG64      (b1Value) = hi;
-      HIGH_U32_FROM_LONG64     (b1Value) = 0;
-      HIGH_U32_FROM_LONG64_PTR (lp)      = 0;
-      LOW_U32_FROM_LONG64_PTR  (lp)      = 0;
-    }
-  else
-    {
-      LOW_U32_FROM_LONG64      (b1Value) = hi >> (mbe - 96);
-      HIGH_U32_FROM_LONG64     (b1Value) = 0;
-      HIGH_U32_FROM_LONG64_PTR (lp)      = 0;
-      LOW_U32_FROM_LONG64_PTR  (lp)      = 0;
-    }
-
-  return b1Value;
-}
-
 #if defined(WIN32)
 /* disable global optimizations on the microsoft compiler for the
  * doubleAlgorithm function otherwise it won't compile */
@@ -423,7 +343,7 @@
  * then return the original approximation.
  */
 static jdouble
-doubleAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e, jdouble z)
+doubleAlgorithm (JNIEnv* env __attribute__ ((unused)), U_64 * f, IDATA length, jint e, jdouble z)
 {
   U_64 m;
   IDATA k, comparison, comparison2;
diff --git a/luni/src/main/native/ifaddrs-android.h b/luni/src/main/native/ifaddrs-android.h
index b66bf69..f2fa98f 100644
--- a/luni/src/main/native/ifaddrs-android.h
+++ b/luni/src/main/native/ifaddrs-android.h
@@ -186,7 +186,7 @@
     ssize_t bytesRead;
     while ((bytesRead  = recvNetlinkMessage(fd.get(), &buf[0], buf.size())) > 0) {
         nlmsghdr* hdr = reinterpret_cast<nlmsghdr*>(&buf[0]);
-        for (; NLMSG_OK(hdr, bytesRead); hdr = NLMSG_NEXT(hdr, bytesRead)) {
+        for (; NLMSG_OK(hdr, (size_t)bytesRead); hdr = NLMSG_NEXT(hdr, bytesRead)) {
             switch (hdr->nlmsg_type) {
             case NLMSG_DONE:
                 return 0;
diff --git a/luni/src/main/native/java_io_Console.cpp b/luni/src/main/native/java_io_Console.cpp
index fdaafaf..f6c69e7 100644
--- a/luni/src/main/native/java_io_Console.cpp
+++ b/luni/src/main/native/java_io_Console.cpp
@@ -21,7 +21,7 @@
 #include <termios.h>
 #include <unistd.h>
 
-static jboolean java_io_Console_isatty(JNIEnv* env, jclass, jint fd) {
+static jboolean java_io_Console_isatty(JNIEnv*, jclass, jint fd) {
     return TEMP_FAILURE_RETRY(isatty(fd));
 }
 
diff --git a/luni/src/main/native/java_io_File.cpp b/luni/src/main/native/java_io_File.cpp
index dc25057..1d5ec51 100644
--- a/luni/src/main/native/java_io_File.cpp
+++ b/luni/src/main/native/java_io_File.cpp
@@ -115,7 +115,7 @@
     return (access(&path[0], R_OK) == 0);
 }
 
-static jboolean java_io_File_canWriteImpl(JNIEnv* env, jobject recv, jbyteArray pathBytes) {
+static jboolean java_io_File_canWriteImpl(JNIEnv* env, jobject, jbyteArray pathBytes) {
     ScopedByteArray path(env, pathBytes);
     return (access(&path[0], W_OK) == 0);
 }
diff --git a/luni/src/main/native/java_io_ObjectInputStream.c b/luni/src/main/native/java_io_ObjectInputStream.c
index 0aa56b0..1f47742 100644
--- a/luni/src/main/native/java_io_ObjectInputStream.c
+++ b/luni/src/main/native/java_io_ObjectInputStream.c
@@ -17,7 +17,7 @@
 
 #include "JNIHelp.h"
 
-static void java_setFieldBool (JNIEnv * env, jclass clazz, 
+static void java_setFieldBool (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -40,7 +40,7 @@
     }
 }
 
-static void java_setFieldChar (JNIEnv * env, jclass clazz, 
+static void java_setFieldChar (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -63,7 +63,7 @@
     }
 }
 
-static void java_setFieldInt (JNIEnv * env, jclass clazz, 
+static void java_setFieldInt (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -86,7 +86,7 @@
     }
 }
 
-static void java_setFieldFloat (JNIEnv * env, jclass clazz, 
+static void java_setFieldFloat (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -109,7 +109,7 @@
     }
 }
 
-static void java_setFieldDouble (JNIEnv * env, jclass clazz, 
+static void java_setFieldDouble (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -133,7 +133,7 @@
 
 }
 
-static void java_setFieldShort (JNIEnv * env, jclass clazz, 
+static void java_setFieldShort (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jobject targetObject, 
                                          jclass declaringClass,
                                          jstring fieldName, 
@@ -157,7 +157,7 @@
 
 }
 
-static void java_setFieldLong (JNIEnv * env, jclass clazz,  
+static void java_setFieldLong (JNIEnv* env, jclass clazz __attribute__ ((unused)),  
                                          jobject targetObject,  
                                          jclass declaringClass, 
                                          jstring fieldName,  
@@ -180,7 +180,7 @@
     }
 }
 
-static jobject java_newInstance (JNIEnv * env, jclass clazz, 
+static jobject java_newInstance (JNIEnv* env, jclass clazz __attribute__ ((unused)), 
                                          jclass instantiationClass, 
                                          jclass constructorClass) {
     jmethodID mid =
@@ -196,7 +196,7 @@
 
 }
 
-static void java_setFieldByte (JNIEnv * env, jclass clazz,  
+static void java_setFieldByte (JNIEnv* env, jclass clazz __attribute__ ((unused)),  
                                          jobject targetObject,  
                                          jclass declaringClass, 
                                          jstring fieldName,  
@@ -216,7 +216,7 @@
     }
 }
 
-static void java_setFieldObj (JNIEnv * env, jclass clazz,
+static void java_setFieldObj (JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                             jobject targetObject,
                                             jclass declaringClass,
                                             jstring fieldName,
diff --git a/luni/src/main/native/java_io_ObjectOutputStream.c b/luni/src/main/native/java_io_ObjectOutputStream.c
index d6432c7..9294f16 100644
--- a/luni/src/main/native/java_io_ObjectOutputStream.c
+++ b/luni/src/main/native/java_io_ObjectOutputStream.c
@@ -17,7 +17,7 @@
 
 #include "JNIHelp.h"
 
-static jlong java_getFieldLong(JNIEnv * env, jclass clazz,
+static jlong java_getFieldLong(JNIEnv * env, jclass clazz __attribute__ ((unused)),
                                               jobject targetObject,
                                               jclass declaringClass,
                                               jstring fieldName) {
@@ -37,7 +37,7 @@
     }
 }
 
-static jshort java_getFieldShort(JNIEnv * env, jclass clazz,
+static jshort java_getFieldShort(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                                jobject targetObject,
                                                jclass declaringClass,
                                                jstring fieldName) {
@@ -57,7 +57,7 @@
     }
 }
 
-static jdouble java_getFieldDouble(JNIEnv * env, jclass clazz,
+static jdouble java_getFieldDouble(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                                 jobject targetObject,
                                                 jclass declaringClass,
                                                 jstring fieldName) {
@@ -77,7 +77,7 @@
     }
 }
 
-static jboolean java_getFieldBool(JNIEnv * env, jclass clazz,
+static jboolean java_getFieldBool(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                               jobject targetObject,
                                               jclass declaringClass,
                                               jstring fieldName) {
@@ -97,7 +97,7 @@
     }
 }
 
-static jbyte java_getFieldByte(JNIEnv * env, jclass clazz,
+static jbyte java_getFieldByte(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                               jobject targetObject,
                                               jclass declaringClass,
                                               jstring fieldName) {
@@ -117,7 +117,7 @@
     }
 }
 
-static jfloat java_getFieldFloat(JNIEnv * env, jclass clazz,
+static jfloat java_getFieldFloat(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                                jobject targetObject,
                                                jclass declaringClass,
                                                jstring fieldName) {
@@ -139,7 +139,7 @@
 
 }
 
-static jchar java_getFieldChar(JNIEnv * env, jclass clazz,
+static jchar java_getFieldChar(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                               jobject targetObject,
                                               jclass declaringClass,
                                               jstring fieldName) {
@@ -159,7 +159,7 @@
     }
 }
 
-static jobject java_getFieldObj(JNIEnv * env, jclass clazz,
+static jobject java_getFieldObj(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                              jobject targetObject,
                                              jclass declaringClass,
                                              jstring fieldName,
@@ -184,7 +184,7 @@
     }
 }
 
-static jint java_getFieldInt(JNIEnv * env, jclass clazz,
+static jint java_getFieldInt(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                              jobject targetObject,
                                              jclass declaringClass,
                                              jstring fieldName) {
diff --git a/luni/src/main/native/java_io_ObjectStreamClass.c b/luni/src/main/native/java_io_ObjectStreamClass.c
index 935ff37..fb290ed 100644
--- a/luni/src/main/native/java_io_ObjectStreamClass.c
+++ b/luni/src/main/native/java_io_ObjectStreamClass.c
@@ -17,7 +17,7 @@
 
 #include "JNIHelp.h"
 
-static jobject java_io_osc_getFieldSignature(JNIEnv * env, jclass clazz,
+static jobject java_io_osc_getFieldSignature(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                                   jobject reflectField) {
     jclass lookupClass;
     jmethodID mid;
@@ -40,7 +40,7 @@
             fieldClass, mid);
 }
 
-static jobject java_io_osc_getMethodSignature(JNIEnv * env, jclass clazz,
+static jobject java_io_osc_getMethodSignature(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                                    jobject reflectMethod)
 {
     jclass lookupClass;
@@ -62,8 +62,8 @@
             methodClass, mid);
 }
 
-static jobject java_io_osc_getConstructorSignature(JNIEnv * env,
-                                                        jclass clazz,
+static jobject java_io_osc_getConstructorSignature(JNIEnv* env,
+                                                        jclass clazz __attribute__ ((unused)),
                                                         jobject
                                                         reflectConstructor)
 {
@@ -86,7 +86,7 @@
                                              constructorClass, mid);
 }
 
-static jboolean java_io_osc_hasClinit(JNIEnv * env, jclass clazz,
+static jboolean java_io_osc_hasClinit(JNIEnv* env, jclass clazz __attribute__ ((unused)),
                                           jobject targetClass) {
     jmethodID mid = (*env)->GetStaticMethodID(env, targetClass, 
             "<clinit>", "()V");
@@ -104,7 +104,7 @@
     }
 }
 
-static void java_io_osc_oneTimeInitialization(JNIEnv * env, jclass clazz) {
+static void java_io_osc_oneTimeInitialization(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused))) {
   // dummy to stay compatible to harmony
 }
 
diff --git a/luni/src/main/native/java_lang_Double.c b/luni/src/main/native/java_lang_Double.c
index 9cc0869..6e4041f 100644
--- a/luni/src/main/native/java_lang_Double.c
+++ b/luni/src/main/native/java_lang_Double.c
@@ -21,7 +21,7 @@
 /*
  * public static native long doubleToLongBits(double value)
  */
-static jlong doubleToLongBits(JNIEnv* env, jclass clazz, jdouble val)
+static jlong doubleToLongBits(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble val)
 {
     Double   d;
 
@@ -39,7 +39,7 @@
 /*
  * public static native long doubleToRawLongBits(double value)
  */
-static jlong doubleToRawLongBits(JNIEnv* env, jclass clazz, jdouble val)
+static jlong doubleToRawLongBits(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble val)
 {
     Double   d;
 
@@ -51,7 +51,7 @@
 /*
  * public static native double longBitsToDouble(long bits)
  */
-static jdouble longBitsToDouble(JNIEnv* env, jclass clazz, jlong val)
+static jdouble longBitsToDouble(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jlong val)
 {
     Double   d;
 
diff --git a/luni/src/main/native/java_lang_Float.c b/luni/src/main/native/java_lang_Float.c
index 6426495..67b6b5d 100644
--- a/luni/src/main/native/java_lang_Float.c
+++ b/luni/src/main/native/java_lang_Float.c
@@ -29,7 +29,7 @@
 /*
  * public static native int floatToIntBits(float value)
  */
-static jint floatToIntBits(JNIEnv* env, jclass clazz, jfloat val)
+static jint floatToIntBits(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jfloat val)
 {
     Float   f;
 
@@ -47,7 +47,7 @@
 /*
  * public static native int floatToRawBits(float value)
  */
-static jint floatToRawBits(JNIEnv* env, jclass clazz, jfloat val)
+static jint floatToRawBits(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jfloat val)
 {
     Float   f;
 
@@ -59,7 +59,7 @@
 /*
  * public static native float intBitsToFloat(int bits)
  */
-static jfloat intBitsToFloat(JNIEnv* env, jclass clazz, jint val)
+static jfloat intBitsToFloat(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jint val)
 {
     Float   f;
 
diff --git a/luni/src/main/native/java_lang_Math.c b/luni/src/main/native/java_lang_Math.c
index 2092c2d..ae13892 100644
--- a/luni/src/main/native/java_lang_Math.c
+++ b/luni/src/main/native/java_lang_Math.c
@@ -10,161 +10,161 @@
 #include <math.h>
 
 /* native public static double sin(double a); */
-static jdouble jsin(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsin(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return sin(a);
 }
 
 /* native public static double cos(double a); */
-static jdouble jcos(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcos(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return cos(a);
 }
 
 /* native public static double tan(double a); */
-static jdouble jtan(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jtan(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return tan(a);
 }
 
 /* native public static double asin(double a); */
-static jdouble jasin(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jasin(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return asin(a);
 }
 
 /* native public static double acos(double a); */
-static jdouble jacos(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jacos(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return acos(a);
 }
 
 /* native public static double atan(double a); */
-static jdouble jatan(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jatan(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return atan(a);
 }
 
 /* native public static double exp(double a); */
-static jdouble jexp(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jexp(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return exp(a);
 }
 
 /* native public static double log(double a); */
-static jdouble jlog(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return log(a);
 }
 
 /* native public static double sqrt(double a); */
-static jdouble jsqrt(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsqrt(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return sqrt(a);
 }
 
 /* native public static double IEEEremainder(double a, double b); */
-static jdouble jieee_remainder(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jieee_remainder(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return remainder(a, b);
 }
 
 /* native public static double floor(double a); */
-static jdouble jfloor(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jfloor(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return floor(a);
 }
 
 /* native public static double ceil(double a); */
-static jdouble jceil(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jceil(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ceil(a);
 }
 
 /* native public static double rint(double a); */
-static jdouble jrint(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jrint(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return rint(a);
 }
 
 /* native public static double atan2(double a, double b); */
-static jdouble jatan2(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jatan2(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return atan2(a, b);
 }
 
 /* native public static double pow(double a, double b); */
-static jdouble jpow(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jpow(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return pow(a, b);
 }
 
 /* native public static double sinh(double a); */
-static jdouble jsinh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsinh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return sinh(a);
 }
 
 /* native public static double tanh(double a); */
-static jdouble jtanh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jtanh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return tanh(a);
 }
 
 /* native public static double cosh(double a); */
-static jdouble jcosh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcosh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return cosh(a);
 }
 
 /* native public static double log10(double a); */
-static jdouble jlog10(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog10(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return log10(a);
 }
 
 /* native public static double cbrt(double a); */
-static jdouble jcbrt(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcbrt(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return cbrt(a);
 }
 
 /* native public static double expm1(double a); */
-static jdouble jexpm1(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jexpm1(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return expm1(a);
 }
 
 /* native public static double hypot(double a, double b); */
-static jdouble jhypot(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jhypot(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return hypot(a, b);
 }
 
 /* native public static double log1p(double a); */
-static jdouble jlog1p(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog1p(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return log1p(a);
 }
 
 /* native public static double nextafter(double a, double b); */
-static jdouble jnextafter(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jnextafter(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return nextafter(a, b);
 }
 
 /* native public static float nextafterf(float a, float b); */
-static jfloat jnextafterf(JNIEnv* env, jclass clazz, jfloat a, jfloat b)
+static jfloat jnextafterf(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jfloat a, jfloat b)
 {
     return nextafterf(a, b);
 }
 
-static jdouble copySign(JNIEnv* env, jclass clazz, jdouble a, jdouble b) {
+static jdouble copySign(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b) {
     // Our StrictMath.copySign delegates to Math.copySign, so we need to treat NaN as positive.
     return copysign(a, isnan(b) ? 1.0 : b);
 }
 
-static jfloat copySign_f(JNIEnv* env, jclass clazz, jfloat a, jfloat b) {
+static jfloat copySign_f(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jfloat a, jfloat b) {
     // Our StrictMath.copySign delegates to Math.copySign, so we need to treat NaN as positive.
     return copysignf(a, isnan(b) ? 1.0 : b);
 }
diff --git a/luni/src/main/native/java_lang_ProcessManager.cpp b/luni/src/main/native/java_lang_ProcessManager.cpp
index 666a8c7..c113c0f 100644
--- a/luni/src/main/native/java_lang_ProcessManager.cpp
+++ b/luni/src/main/native/java_lang_ProcessManager.cpp
@@ -61,7 +61,7 @@
 /**
  * Kills process with the given ID.
  */
-static void java_lang_ProcessManager_kill(JNIEnv* env, jclass clazz, jint pid) {
+static void java_lang_ProcessManager_kill(JNIEnv* env, jclass, jint pid) {
     int result = kill((pid_t) pid, SIGKILL);
     if (result == -1) {
         jniThrowIOException(env, errno);
@@ -335,7 +335,7 @@
  * Converts Java String[] to char** and delegates to executeProcess().
  */
 static pid_t java_lang_ProcessManager_exec(
-        JNIEnv* env, jclass clazz, jobjectArray javaCommands,
+        JNIEnv* env, jclass, jobjectArray javaCommands,
         jobjectArray javaEnvironment, jstring javaWorkingDirectory,
         jobject inDescriptor, jobject outDescriptor, jobject errDescriptor,
         jboolean redirectErrorStream) {
diff --git a/luni/src/main/native/java_lang_StrictMath.c b/luni/src/main/native/java_lang_StrictMath.c
index 2c52f36..27773f8 100644
--- a/luni/src/main/native/java_lang_StrictMath.c
+++ b/luni/src/main/native/java_lang_StrictMath.c
@@ -19,151 +19,151 @@
 _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
 
 /* native public static double sin(double a); */
-static jdouble jsin(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsin(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_sin(a);
 }
 
 /* native public static double cos(double a); */
-static jdouble jcos(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcos(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_cos(a);
 }
 
 /* native public static double tan(double a); */
-static jdouble jtan(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jtan(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_tan(a);
 }
 
 /* native public static double asin(double a); */
-static jdouble jasin(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jasin(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_asin(a);
 }
 
 /* native public static double acos(double a); */
-static jdouble jacos(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jacos(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_acos(a);
 }
 
 /* native public static double atan(double a); */
-static jdouble jatan(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jatan(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_atan(a);
 }
 
 /* native public static double exp(double a); */
-static jdouble jexp(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jexp(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_exp(a);
 }
 
 /* native public static double log(double a); */
-static jdouble jlog(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_log(a);
 }
 
 /* native public static double sqrt(double a); */
-static jdouble jsqrt2(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsqrt2(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_sqrt(a);
 }
 
 /* native public static double IEEEremainder(double a, double b); */
-static jdouble jieee_remainder(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jieee_remainder(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return ieee_remainder(a, b);
 }
 
 /* native public static double floor(double a); */
-static jdouble jfloor(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jfloor(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_floor(a);
 }
 
 /* native public static double ceil(double a); */
-static jdouble jceil(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jceil(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_ceil(a);
 }
 
 /* native public static double rint(double a); */
-static jdouble jrint(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jrint(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_rint(a);
 }
 
 /* native public static double atan2(double a, double b); */
-static jdouble jatan2(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jatan2(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return ieee_atan2(a, b);
 }
 
 /* native public static double pow(double a, double b); */
-static jdouble jpow(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jpow(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return ieee_pow(a,b);
 }
 
 /* native public static double sinh(double a); */
-static jdouble jsinh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jsinh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_sinh(a);
 }
 
 /* native public static double tanh(double a); */
-static jdouble jtanh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jtanh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_tanh(a);
 }
 
 /* native public static double cosh(double a); */
-static jdouble jcosh(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcosh(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_cosh(a);
 }
 
 /* native public static double log10(double a); */
-static jdouble jlog10(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog10(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_log10(a);
 }
 
 /* native public static double cbrt(double a); */
-static jdouble jcbrt(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jcbrt(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_cbrt(a);
 }
 
 /* native public static double expm1(double a); */
-static jdouble jexpm1(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jexpm1(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_expm1(a);
 }
 
 /* native public static double hypot(double a, double b); */
-static jdouble jhypot(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jhypot(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return ieee_hypot(a, b);
 }
 
 /* native public static double log1p(double a); */
-static jdouble jlog1p(JNIEnv* env, jclass clazz, jdouble a)
+static jdouble jlog1p(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a)
 {
     return ieee_log1p(a);
 }
 
 /* native public static double nextafter(double a, double b); */
-static jdouble jnextafter(JNIEnv* env, jclass clazz, jdouble a, jdouble b)
+static jdouble jnextafter(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jdouble a, jdouble b)
 {
     return ieee_nextafter(a, b);
 }
 
 /* native public static float nextafterf(float a, float b); */
-static jfloat jnextafterf(JNIEnv* env, jclass clazz, jfloat arg1, jfloat arg2)
+static jfloat jnextafterf(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), jfloat arg1, jfloat arg2)
 {
     jint hx = *(jint*)&arg1;
     jint hy = *(jint*)&arg2;
diff --git a/luni/src/main/native/java_net_InetAddress.cpp b/luni/src/main/native/java_net_InetAddress.cpp
index 2fc575ae..0bfe895de 100644
--- a/luni/src/main/native/java_net_InetAddress.cpp
+++ b/luni/src/main/native/java_net_InetAddress.cpp
@@ -34,7 +34,7 @@
 
 static jclass byteArrayClass = NULL;
 
-static jstring InetAddress_gethostname(JNIEnv* env, jobject obj)
+static jstring InetAddress_gethostname(JNIEnv* env, jclass)
 {
     char name[256];
     int r = gethostname(name, 256);
@@ -59,7 +59,7 @@
     }
 }
 #else
-static inline void logIpString(struct addrinfo* ai, const char* name)
+static inline void logIpString(struct addrinfo*, const char*)
 {
 }
 #endif
@@ -150,7 +150,7 @@
     return addressArray;
 }
 
-jobjectArray InetAddress_getaddrinfo(JNIEnv* env, jobject obj, jstring javaName) {
+jobjectArray InetAddress_getaddrinfo(JNIEnv* env, jclass, jstring javaName) {
     if (javaName == NULL) {
         jniThrowNullPointerException(env, NULL);
         return NULL;
@@ -170,7 +170,7 @@
  * @return the hostname.
  * @throws UnknownHostException: the IP address has no associated hostname.
  */
-static jstring InetAddress_getnameinfo(JNIEnv* env, jobject obj,
+static jstring InetAddress_getnameinfo(JNIEnv* env, jclass,
                                          jbyteArray javaAddress)
 {
     if (javaAddress == NULL) {
diff --git a/luni/src/main/native/java_util_zip_Adler32.cpp b/luni/src/main/native/java_util_zip_Adler32.cpp
index 254a3fd..3dc1802 100644
--- a/luni/src/main/native/java_util_zip_Adler32.cpp
+++ b/luni/src/main/native/java_util_zip_Adler32.cpp
@@ -30,7 +30,7 @@
     return result;
 }
 
-static jlong Adler32_updateByteImpl(JNIEnv* env, jobject, jint val, jlong crc) {
+static jlong Adler32_updateByteImpl(JNIEnv*, jobject, jint val, jlong crc) {
     Bytef bytefVal = val;
     return adler32((uLong) crc, (Bytef *) (&bytefVal), 1);
 }
diff --git a/luni/src/main/native/java_util_zip_CRC32.cpp b/luni/src/main/native/java_util_zip_CRC32.cpp
index c9c604b..7b1bd29 100644
--- a/luni/src/main/native/java_util_zip_CRC32.cpp
+++ b/luni/src/main/native/java_util_zip_CRC32.cpp
@@ -30,7 +30,7 @@
     return result;
 }
 
-static jlong CRC32_updateByteImpl(JNIEnv* env, jobject recv, jbyte val, jlong crc) {
+static jlong CRC32_updateByteImpl(JNIEnv*, jobject, jbyte val, jlong crc) {
     return crc32((uLong) crc, (Bytef *) (&val), 1);
 }
 
diff --git a/luni/src/main/native/java_util_zip_Deflater.cpp b/luni/src/main/native/java_util_zip_Deflater.cpp
index 46ae001..d0bd53a 100644
--- a/luni/src/main/native/java_util_zip_Deflater.cpp
+++ b/luni/src/main/native/java_util_zip_Deflater.cpp
@@ -26,15 +26,15 @@
     toNativeZipStream(handle)->setDictionary(env, dict, off, len, false);
 }
 
-static jlong Deflater_getTotalInImpl(JNIEnv* env, jobject, jlong handle) {
+static jlong Deflater_getTotalInImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.total_in;
 }
 
-static jlong Deflater_getTotalOutImpl(JNIEnv* env, jobject, jlong handle) {
+static jlong Deflater_getTotalOutImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.total_out;
 }
 
-static jint Deflater_getAdlerImpl(JNIEnv* env, jobject, jlong handle) {
+static jint Deflater_getAdlerImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.adler;
 }
 
@@ -100,7 +100,7 @@
     return stream->stream.total_out - sout;
 }
 
-static void Deflater_endImpl(JNIEnv* env, jobject, jlong handle) {
+static void Deflater_endImpl(JNIEnv*, jobject, jlong handle) {
     NativeZipStream* stream = toNativeZipStream(handle);
     deflateEnd(&stream->stream);
     delete stream;
diff --git a/luni/src/main/native/java_util_zip_Inflater.cpp b/luni/src/main/native/java_util_zip_Inflater.cpp
index 77e9aa3..a488eee 100644
--- a/luni/src/main/native/java_util_zip_Inflater.cpp
+++ b/luni/src/main/native/java_util_zip_Inflater.cpp
@@ -110,11 +110,11 @@
     return stream->stream.total_out - sout;
 }
 
-static jint Inflater_getAdlerImpl(JNIEnv* env, jobject, jlong handle) {
+static jint Inflater_getAdlerImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.adler;
 }
 
-static void Inflater_endImpl(JNIEnv* env, jobject, jlong handle) {
+static void Inflater_endImpl(JNIEnv*, jobject, jlong handle) {
     NativeZipStream* stream = toNativeZipStream(handle);
     inflateEnd(&stream->stream);
     delete stream;
@@ -131,11 +131,11 @@
     }
 }
 
-static jlong Inflater_getTotalOutImpl(JNIEnv* env, jobject, jlong handle) {
+static jlong Inflater_getTotalOutImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.total_out;
 }
 
-static jlong Inflater_getTotalInImpl(JNIEnv* env, jobject, jlong handle) {
+static jlong Inflater_getTotalInImpl(JNIEnv*, jobject, jlong handle) {
     return toNativeZipStream(handle)->stream.total_in;
 }
 
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp
index af82efc..6afb453 100644
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp
+++ b/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp
@@ -191,7 +191,7 @@
  * Returns the granularity of the starting address for virtual memory allocation.
  * (It's the same as the page size.)
  */
-static jint harmony_io_getAllocGranularity(JNIEnv* env, jobject) {
+static jint harmony_io_getAllocGranularity(JNIEnv*, jobject) {
     static int allocGranularity = getpagesize();
     return allocGranularity;
 }
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp
index d1dafdb..8c8a864 100644
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp
+++ b/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp
@@ -43,7 +43,7 @@
  * Method:    littleEndian
  * Signature: ()Z
  */
-static jboolean harmony_nio_littleEndian(JNIEnv *_env, jclass _this) {
+static jboolean harmony_nio_littleEndian(JNIEnv*, jclass) {
     long l = 0x01020304;
     unsigned char* c = (unsigned char*)&l;
     return (*c == 0x04) ? JNI_TRUE : JNI_FALSE;
@@ -54,7 +54,7 @@
  * Method:    getPointerSizeImpl
  * Signature: ()I
  */
-static jint harmony_nio_getPointerSizeImpl(JNIEnv *_env, jclass _this) {
+static jint harmony_nio_getPointerSizeImpl(JNIEnv*, jclass) {
     return sizeof(void *);
 }
 
@@ -63,7 +63,7 @@
  * Method:    mallocImpl
  * Signature: (I)I
  */
-static jint harmony_nio_mallocImpl(JNIEnv *_env, jobject _this, jint size) {
+static jint harmony_nio_mallocImpl(JNIEnv* _env, jobject, jint size) {
     jboolean allowed = _env->CallBooleanMethod(gIDCache.runtimeInstance,
         gIDCache.method_trackExternalAllocation, (jlong) size);
     if (!allowed) {
@@ -93,7 +93,7 @@
  * Method:    freeImpl
  * Signature: (I)V
  */
-static void harmony_nio_freeImpl(JNIEnv *_env, jobject _this, jint pointer) {
+static void harmony_nio_freeImpl(JNIEnv* _env, jobject, jint pointer) {
     jlong* adjptr = (jlong*) pointer;
     jint size = *--adjptr;
     LOGV("OSMemory free %d\n", size);
@@ -107,7 +107,7 @@
  * Method:    memset
  * Signature: (IBJ)V
  */
-static void harmony_nio_memset(JNIEnv *_env, jobject _this, jint address, 
+static void harmony_nio_memset(JNIEnv*, jobject, jint address, 
         jbyte value, jlong length) {
     memset ((void *) ((jint) address), (jbyte) value, (jlong) length);
 }
@@ -117,7 +117,7 @@
  * Method:    memmove
  * Signature: (IIJ)V
  */
-static void harmony_nio_memmove(JNIEnv *_env, jobject _this, jint destAddress, 
+static void harmony_nio_memmove(JNIEnv*, jobject, jint destAddress, 
         jint srcAddress, jlong length) {
     memmove ((void *) ((jint) destAddress), (const void *) ((jint) srcAddress), 
         (jlong) length);
@@ -128,7 +128,7 @@
  * Method:    getByteImpl
  * Signature: (I)B
  */
-static jbyte harmony_nio_getByteImpl(JNIEnv *_env, jobject _this, 
+static jbyte harmony_nio_getByteImpl(JNIEnv*, jobject, 
         jint pointer) {
     jbyte returnValue = *((jbyte *)pointer);
     return returnValue;
@@ -139,7 +139,7 @@
  * Method:    getBytesImpl
  * Signature: (I[BII)V
  */
-static void harmony_nio_getBytesImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_getBytesImpl(JNIEnv* _env, jobject, jint pointer, 
         jbyteArray dst, jint offset, jint length) {
     jbyte* src = reinterpret_cast<jbyte*>(static_cast<uintptr_t>(pointer));
     _env->SetByteArrayRegion(dst, offset, length, src);
@@ -150,7 +150,7 @@
  * Method:    putByteImpl
  * Signature: (IB)V
  */
-static void harmony_nio_putByteImpl(JNIEnv *_env, jobject _this, jint pointer,
+static void harmony_nio_putByteImpl(JNIEnv*, jobject, jint pointer,
         jbyte val) {
     *((jbyte *)pointer) = val;
 }
@@ -160,7 +160,7 @@
  * Method:    putBytesImpl
  * Signature: (I[BII)V
  */
-static void harmony_nio_putBytesImpl(JNIEnv *_env, jobject _this,
+static void harmony_nio_putBytesImpl(JNIEnv* _env, jobject,
         jint pointer, jbyteArray src, jint offset, jint length) {
     jbyte* dst = reinterpret_cast<jbyte*>(static_cast<uintptr_t>(pointer));
     _env->GetByteArrayRegion(src, offset, length, dst);
@@ -199,7 +199,7 @@
  * Method:    setShortArrayImpl
  * Signature: (I[SIIZ)V
  */
-static void harmony_nio_setShortArrayImpl(JNIEnv *_env, jobject _this,
+static void harmony_nio_setShortArrayImpl(JNIEnv* _env, jobject,
        jint pointer, jshortArray src, jint offset, jint length, jboolean swap) {
     jshort* dst = reinterpret_cast<jshort*>(static_cast<uintptr_t>(pointer));
     _env->GetShortArrayRegion(src, offset, length, dst);
@@ -213,7 +213,7 @@
  * Method:    setIntArrayImpl
  * Signature: (I[IIIZ)V
  */
-static void harmony_nio_setIntArrayImpl(JNIEnv *_env, jobject _this,
+static void harmony_nio_setIntArrayImpl(JNIEnv* _env, jobject,
        jint pointer, jintArray src, jint offset, jint length, jboolean swap) {
     jint* dst = reinterpret_cast<jint*>(static_cast<uintptr_t>(pointer));
     _env->GetIntArrayRegion(src, offset, length, dst);
@@ -227,7 +227,7 @@
  * Method:    getShortImpl
  * Signature: (I)S
  */
-static jshort harmony_nio_getShortImpl(JNIEnv *_env, jobject _this, 
+static jshort harmony_nio_getShortImpl(JNIEnv*, jobject, 
         jint pointer) {
     if ((pointer & 0x1) == 0) {
         jshort returnValue = *((jshort *)pointer);
@@ -248,7 +248,7 @@
  * Method:    petShortImpl
  * Signature: (IS)V
  */
-static void harmony_nio_putShortImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_putShortImpl(JNIEnv*, jobject, jint pointer, 
         jshort value) {
     if ((pointer & 0x1) == 0) {
         *((jshort *)pointer) = value;
@@ -266,7 +266,7 @@
  * Method:    getIntImpl
  * Signature: (I)I
  */
-static jint harmony_nio_getIntImpl(JNIEnv *_env, jobject _this, jint pointer) {
+static jint harmony_nio_getIntImpl(JNIEnv*, jobject, jint pointer) {
     if ((pointer & 0x3) == 0) {
         jint returnValue = *((jint *)pointer);
         return returnValue;
@@ -288,7 +288,7 @@
  * Method:    putIntImpl
  * Signature: (II)V
  */
-static void harmony_nio_putIntImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_putIntImpl(JNIEnv*, jobject, jint pointer, 
         jint value) {
     if ((pointer & 0x3) == 0) {
         *((jint *)pointer) = value;
@@ -308,7 +308,7 @@
  * Method:    getLongImpl
  * Signature: (I)Ljava/lang/Long;
  */
-static jlong harmony_nio_getLongImpl(JNIEnv *_env, jobject _this, 
+static jlong harmony_nio_getLongImpl(JNIEnv*, jobject, 
         jint pointer) {
     if ((pointer & 0x7) == 0) {
         jlong returnValue = *((jlong *)pointer);
@@ -326,7 +326,7 @@
  * Method:    putLongImpl
  * Signature: (IJ)V
  */
-static void harmony_nio_putLongImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_putLongImpl(JNIEnv*, jobject, jint pointer, 
         jlong value) {
     if ((pointer & 0x7) == 0) {
         *((jlong *)pointer) = value;
@@ -341,7 +341,7 @@
  * Method:    getFloatImpl
  * Signature: (I)F
  */
-static jfloat harmony_nio_getFloatImpl(JNIEnv *_env, jobject _this, 
+static jfloat harmony_nio_getFloatImpl(JNIEnv*, jobject, 
         jint pointer) {
     if ((pointer & 0x3) == 0) {
         jfloat returnValue = *((jfloat *)pointer);
@@ -359,7 +359,7 @@
  * Method:    setFloatImpl
  * Signature: (IF)V
  */
-static void harmony_nio_putFloatImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_putFloatImpl(JNIEnv*, jobject, jint pointer, 
         jfloat value) {
     if ((pointer & 0x3) == 0) {
         *((jfloat *)pointer) = value;
@@ -374,7 +374,7 @@
  * Method:    getDoubleImpl
  * Signature: (I)D
  */
-static jdouble harmony_nio_getDoubleImpl(JNIEnv *_env, jobject _this, 
+static jdouble harmony_nio_getDoubleImpl(JNIEnv*, jobject, 
         jint pointer) {
     if ((pointer & 0x7) == 0) {
         jdouble returnValue = *((jdouble *)pointer);
@@ -392,7 +392,7 @@
  * Method:    putDoubleImpl
  * Signature: (ID)V
  */
-static void harmony_nio_putDoubleImpl(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_putDoubleImpl(JNIEnv*, jobject, jint pointer, 
         jdouble value) {
     if ((pointer & 0x7) == 0) {
         *((jdouble *)pointer) = value;
@@ -407,7 +407,7 @@
  * Method:    getAddress
  * Signature: (I)I
  */
-static jint harmony_nio_getAddress(JNIEnv *_env, jobject _this, jint pointer) {
+static jint harmony_nio_getAddress(JNIEnv*, jobject, jint pointer) {
     return (jint) * (int *) pointer;
 }
 
@@ -416,7 +416,7 @@
  * Method:    setAddress
  * Signature: (II)V
  */
-static void harmony_nio_setAddress(JNIEnv *_env, jobject _this, jint pointer, 
+static void harmony_nio_setAddress(JNIEnv*, jobject, jint pointer, 
         jint value) {
     *(int *) pointer = (int) value;
 }
@@ -460,7 +460,7 @@
  * Method:    unmapImpl
  * Signature: (IJ)V
  */
-static void harmony_nio_unmapImpl(JNIEnv *_env, jobject _this, jint address, 
+static void harmony_nio_unmapImpl(JNIEnv*, jobject, jint address, 
         jlong size) {
     munmap((void *)address, (size_t)size);
 }
@@ -470,7 +470,7 @@
  * Method:    loadImpl
  * Signature: (IJ)I
  */
-static jint harmony_nio_loadImpl(JNIEnv *_env, jobject _this, jint address, 
+static jint harmony_nio_loadImpl(JNIEnv*, jobject, jint address, 
         jlong size) {
 
     if(mlock((void *)address, (size_t)size)!=-1) {
@@ -493,7 +493,7 @@
  * Method:    isLoadedImpl
  * Signature: (IJ)Z
  */
-static jboolean harmony_nio_isLoadedImpl(JNIEnv *_env, jobject _this, 
+static jboolean harmony_nio_isLoadedImpl(JNIEnv*, jobject, 
         jint address, jlong size) {
 
     static int page_size = getpagesize();
@@ -530,8 +530,7 @@
  * Method:    flushImpl
  * Signature: (IJ)I
  */
-static jint harmony_nio_flushImpl(JNIEnv *_env, jobject _this, jint address, 
-        jlong size) {
+static jint harmony_nio_flushImpl(JNIEnv *, jobject, jint address, jlong size) {
     return msync((void *)address, size, MS_SYNC);
 }
 
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
index 7ef36f0..afad49d 100644
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
+++ b/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
@@ -1115,7 +1115,7 @@
     return bytesReceived;
 }
 
-static jint osNetworkSystem_readSocketImpl(JNIEnv* env, jclass clazz,
+static jint osNetworkSystem_readSocketImpl(JNIEnv* env, jclass,
         jobject fileDescriptor, jbyteArray byteArray, jint offset, jint count,
         jint timeout) {
     // LOGD("ENTER readSocketImpl");
@@ -1242,7 +1242,6 @@
     int remainingTimeout = timeout;
     int passedTimeout = 0;
     int finishTime = 0;
-    int blocking = 0;
     bool hasTimeout = timeout > 0;
 
     /* if a timeout was specified calculate the finish time value */
diff --git a/luni/src/main/native/org_apache_harmony_luni_util_fltparse.c b/luni/src/main/native/org_apache_harmony_luni_util_fltparse.c
index daef934..2e7f1c1 100644
--- a/luni/src/main/native/org_apache_harmony_luni_util_fltparse.c
+++ b/luni/src/main/native/org_apache_harmony_luni_util_fltparse.c
@@ -40,18 +40,18 @@
 #define DEFAULT_WIDTH MAX_ACCURACY_WIDTH
 
 JNIEXPORT jfloat JNICALL
-Java_org_apache_harmony_luni_util_FloatingPointParser_parseFltImpl (JNIEnv * env,
+Java_org_apache_harmony_luni_util_FloatingPointParser_parseFltImpl (JNIEnv* env,
                                                         jclass clazz,
                                                         jstring s, jint e);
 JNIEXPORT jdouble JNICALL
-Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv * env,
+Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv* env,
                                                         jclass clazz,
                                                         jstring s, jint e);
 
-jfloat createFloat1 (JNIEnv * env, U_64 * f, IDATA length, jint e);
-jfloat floatAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e,
+jfloat createFloat1 (JNIEnv* env, U_64 * f, IDATA length, jint e);
+jfloat floatAlgorithm (JNIEnv* env, U_64 * f, IDATA length, jint e,
                        jfloat z);
-jfloat createFloat (JNIEnv * env, const char *s, jint e);
+jfloat createFloat (JNIEnv* env, const char *s, jint e);
 
 static const U_32 tens[] = {
   0x3f800000,
@@ -121,7 +121,7 @@
 #define release(r) if ((r)) free((r));
 
 jfloat
-createFloat (JNIEnv * env, const char *s, jint e)
+createFloat (JNIEnv* env, const char *s, jint e)
 {
   /* assumes s is a null terminated string with at least one
    * character in it */
@@ -222,7 +222,7 @@
 }
 
 jfloat
-createFloat1 (JNIEnv * env, U_64 * f, IDATA length, jint e)
+createFloat1 (JNIEnv* env, U_64 * f, IDATA length, jint e)
 {
   IDATA numBits;
   jdouble dresult;
@@ -351,7 +351,7 @@
  * then return the original approximation.
  */
 jfloat
-floatAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e, jfloat z)
+floatAlgorithm (JNIEnv* env __attribute__ ((unused)), U_64 * f, IDATA length, jint e, jfloat z)
 {
   U_64 m;
   IDATA k, comparison, comparison2;
@@ -538,8 +538,8 @@
 #endif
 
 JNIEXPORT jfloat JNICALL
-Java_org_apache_harmony_luni_util_FloatingPointParser_parseFltImpl (JNIEnv * env,
-                                                        jclass clazz,
+Java_org_apache_harmony_luni_util_FloatingPointParser_parseFltImpl (JNIEnv* env,
+                                                        jclass clazz __attribute__ ((unused)),
                                                         jstring s, jint e)
 {
   jfloat flt;
@@ -564,8 +564,8 @@
 }
 
 JNIEXPORT jdouble JNICALL
-Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv * env,
-                                                        jclass clazz,
+Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv* env,
+                                                        jclass clazz __attribute__ ((unused)),
                                                         jstring s, jint e)
 {
   jdouble dbl;
diff --git a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
index c684708..78c29f9 100644
--- a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
+++ b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
@@ -780,8 +780,6 @@
 
 /**
  * Called by Expat at the beginning of a DOCTYPE section.
- *
- * @param data parsing context
  */
 static void startDtd(void* data, const char* name,
         const char* systemId, const char* publicId, int hasInternalSubset) {
@@ -858,7 +856,7 @@
  * @param javaContext that was provided to handleExternalEntity
  * @returns the pointer to the C Expat entity parser
  */
-static jint createEntityParser(JNIEnv* env, jobject object, jint parentParser,
+static jint createEntityParser(JNIEnv* env, jobject, jint parentParser,
         jstring javaEncoding, jstring javaContext) {
     const char* encoding = env->GetStringUTFChars(javaEncoding, NULL);
     if (encoding == NULL) {
@@ -889,7 +887,7 @@
  * ourselves.
  */
 static int handleExternalEntity(XML_Parser parser, const char* context,
-        const char* ignored, const char* systemId, const char* publicId) {
+        const char*, const char* systemId, const char* publicId) {
     ParsingContext* parsingContext = (ParsingContext*) XML_GetUserData(parser);
     jobject javaParser = parsingContext->object;
     JNIEnv* env = parsingContext->env;
@@ -1161,7 +1159,7 @@
  * @param object the Java ExpatParser instance
  * @param i pointer to the C expat parser
  */
-static void releaseParser(JNIEnv* env, jobject object, jint i) {
+static void releaseParser(JNIEnv*, jobject, jint i) {
     XML_Parser parser = (XML_Parser) i;
     XML_ParserFree(parser);
 }
@@ -1172,7 +1170,7 @@
  * @param object the Java ExpatParser instance
  * @param i pointer to the C expat parser
  */
-static void release(JNIEnv* env, jobject object, jint i) {
+static void release(JNIEnv* env, jobject, jint i) {
     XML_Parser parser = (XML_Parser) i;
 
     ParsingContext* context = (ParsingContext*) XML_GetUserData(parser);
@@ -1188,7 +1186,7 @@
  * @param pointer to the C expat parser
  * @returns current line number
  */
-static int line(JNIEnv* env, jobject clazz, jint pointer) {
+static int line(JNIEnv*, jobject, jint pointer) {
     XML_Parser parser = (XML_Parser) pointer;
     return XML_GetCurrentLineNumber(parser);
 }
@@ -1200,7 +1198,7 @@
  * @param pointer to the C expat parser
  * @returns current column number
  */
-static int column(JNIEnv* env, jobject clazz, jint pointer) {
+static int column(JNIEnv*, jobject, jint pointer) {
     XML_Parser parser = (XML_Parser) pointer;
     return XML_GetCurrentColumnNumber(parser);
 }
@@ -1214,7 +1212,7 @@
  * @param index of the attribute
  * @returns interned Java string containing attribute's URI
  */
-static jstring getAttributeURI(JNIEnv* env, jobject clazz, jint pointer,
+static jstring getAttributeURI(JNIEnv* env, jobject, jint pointer,
         jint attributePointer, jint index) {
     XML_Parser parser = (XML_Parser) pointer;
     ParsingContext* context = (ParsingContext*) XML_GetUserData(parser);
@@ -1230,7 +1228,7 @@
  * @param index of the attribute
  * @returns interned Java string containing attribute's local name
  */
-static jstring getAttributeLocalName(JNIEnv* env, jobject clazz, jint pointer,
+static jstring getAttributeLocalName(JNIEnv* env, jobject, jint pointer,
         jint attributePointer, jint index) {
     XML_Parser parser = (XML_Parser) pointer;
     ParsingContext* context = (ParsingContext*) XML_GetUserData(parser);
@@ -1246,7 +1244,7 @@
  * @param index of the attribute
  * @returns interned Java string containing attribute's local name
  */
-static jstring getAttributeQName(JNIEnv* env, jobject clazz, jint pointer,
+static jstring getAttributeQName(JNIEnv* env, jobject, jint pointer,
         jint attributePointer, jint index) {
     XML_Parser parser = (XML_Parser) pointer;
     ParsingContext* context = (ParsingContext*) XML_GetUserData(parser);
@@ -1261,7 +1259,7 @@
  * @param index of the attribute
  * @returns Java string containing attribute's value
  */
-static jstring getAttributeValueByIndex(JNIEnv* env, jobject clazz,
+static jstring getAttributeValueByIndex(JNIEnv* env, jobject,
         jint attributePointer, jint index) {
     const char** attributes = (const char**) attributePointer;
     const char* value = attributes[(index << 1) + 1];
@@ -1276,7 +1274,7 @@
  * @returns index of attribute with the given uri and local name or -1 if not
  *  found
  */
-static jint getAttributeIndexForQName(JNIEnv* env, jobject clazz,
+static jint getAttributeIndexForQName(JNIEnv* env, jobject,
         jint attributePointer, jstring qName) {
     const char** attributes = (const char**) attributePointer;
 
@@ -1306,7 +1304,7 @@
  * @returns index of attribute with the given uri and local name or -1 if not
  *  found
  */
-static jint getAttributeIndex(JNIEnv* env, jobject clazz,
+static jint getAttributeIndex(JNIEnv* env, jobject,
         jint attributePointer, jstring uri, jstring localName) {
     const char** attributes = (const char**) attributePointer;
 
@@ -1413,7 +1411,7 @@
  * @param pointer to char** to clone
  * @param count number of attributes
  */
-static jint cloneAttributes(JNIEnv* env, jobject clazz,
+static jint cloneAttributes(JNIEnv*, jobject,
         jint pointer, jint count) {
     return (int) cloneStrings((const char**) pointer, count << 1);
 }
@@ -1421,7 +1419,7 @@
 /**
  * Frees cloned attributes.
  */
-static void freeAttributes(JNIEnv* env, jobject clazz, jint pointer) {
+static void freeAttributes(JNIEnv*, jobject, jint pointer) {
     free((void*) pointer);
 }
 
diff --git a/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
index 16ff6df..2c8a02a 100644
--- a/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
+++ b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
@@ -72,7 +72,7 @@
  *
  * @return 1 if an exception was thrown, 0 if not.
  */
-static int throwExceptionIfNecessary(JNIEnv* env, const char* location) {
+static int throwExceptionIfNecessary(JNIEnv* env, const char* /*location*/) {
     int error = ERR_get_error();
     int result = 0;
 
@@ -112,12 +112,10 @@
  * SSL errors. This will also log the errors.
  *
  * @param env the JNI environment
- * @param sslReturnCode return code from failing SSL function
  * @param sslErrorCode error code returned from SSL_get_error()
  * @param message null-ok; general error message
  */
-static void throwSSLExceptionWithSslErrors(JNIEnv* env, int sslReturnCode,
-        int sslErrorCode, const char* message) {
+static void throwSSLExceptionWithSslErrors(JNIEnv* env, int sslErrorCode, const char* message) {
     const char* messageStr = NULL;
     char* str;
     int ret;
@@ -279,7 +277,7 @@
 
 static MUTEX_TYPE *mutex_buf = NULL;
 
-static void locking_function(int mode, int n, const char * file, int line) {
+static void locking_function(int mode, int n, const char*, int) {
     if (mode & CRYPTO_LOCK) {
         MUTEX_LOCK(mutex_buf[n]);
     } else {
@@ -334,7 +332,7 @@
  * Initialization phase for every OpenSSL job: Loads the Error strings, the
  * crypto algorithms and reset the OpenSSL library
  */
-static void NativeCrypto_clinit(JNIEnv* env, jclass)
+static void NativeCrypto_clinit(JNIEnv*, jclass)
 {
     SSL_load_error_strings();
     ERR_load_crypto_strings();
@@ -346,7 +344,7 @@
 /**
  * public static native int EVP_PKEY_new_DSA(byte[] p, byte[] q, byte[] g, byte[] pub_key, byte[] priv_key);
  */
-static EVP_PKEY* NativeCrypto_EVP_PKEY_new_DSA(JNIEnv* env, jclass clazz, jbyteArray p, jbyteArray q, jbyteArray g, jbyteArray pub_key, jbyteArray priv_key) {
+static EVP_PKEY* NativeCrypto_EVP_PKEY_new_DSA(JNIEnv* env, jclass, jbyteArray p, jbyteArray q, jbyteArray g, jbyteArray pub_key, jbyteArray priv_key) {
     // LOGD("Entering EVP_PKEY_new_DSA()");
 
     DSA* dsa = DSA_new();
@@ -383,7 +381,7 @@
 /**
  * private static native int EVP_PKEY_new_RSA(byte[] n, byte[] e, byte[] d, byte[] p, byte[] q);
  */
-static EVP_PKEY* NativeCrypto_EVP_PKEY_new_RSA(JNIEnv* env, jclass clazz, jbyteArray n, jbyteArray e, jbyteArray d, jbyteArray p, jbyteArray q) {
+static EVP_PKEY* NativeCrypto_EVP_PKEY_new_RSA(JNIEnv* env, jclass, jbyteArray n, jbyteArray e, jbyteArray d, jbyteArray p, jbyteArray q) {
     // LOGD("Entering EVP_PKEY_new_RSA()");
 
     RSA* rsa = RSA_new();
@@ -430,7 +428,7 @@
 /**
  * private static native void EVP_PKEY_free(int pkey);
  */
-static void NativeCrypto_EVP_PKEY_free(JNIEnv* env, jclass clazz, EVP_PKEY* pkey) {
+static void NativeCrypto_EVP_PKEY_free(JNIEnv*, jclass, EVP_PKEY* pkey) {
     // LOGD("Entering EVP_PKEY_free()");
 
     if (pkey != NULL) {
@@ -441,7 +439,7 @@
 /*
  * public static native int EVP_new()
  */
-static jint NativeCrypto_EVP_new(JNIEnv* env, jclass clazz) {
+static jint NativeCrypto_EVP_new(JNIEnv*, jclass) {
     // LOGI("NativeCrypto_EVP_DigestNew");
 
     return (jint)EVP_MD_CTX_create();
@@ -450,7 +448,7 @@
 /*
  * public static native void EVP_free(int)
  */
-static void NativeCrypto_EVP_free(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx) {
+static void NativeCrypto_EVP_free(JNIEnv*, jclass, EVP_MD_CTX* ctx) {
     // LOGI("NativeCrypto_EVP_DigestFree");
 
     if (ctx != NULL) {
@@ -461,7 +459,7 @@
 /*
  * public static native int EVP_DigestFinal(int, byte[], int)
  */
-static jint NativeCrypto_EVP_DigestFinal(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jbyteArray hash, jint offset) {
+static jint NativeCrypto_EVP_DigestFinal(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jbyteArray hash, jint offset) {
     // LOGI("NativeCrypto_EVP_DigestFinal%x, %x, %d, %d", ctx, hash, offset);
 
     if (ctx == NULL || hash == NULL) {
@@ -483,7 +481,7 @@
 /*
  * public static native void EVP_DigestInit(int, java.lang.String)
  */
-static void NativeCrypto_EVP_DigestInit(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jstring algorithm) {
+static void NativeCrypto_EVP_DigestInit(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jstring algorithm) {
     // LOGI("NativeCrypto_EVP_DigestInit");
 
     if (ctx == NULL || algorithm == NULL) {
@@ -508,7 +506,7 @@
 /*
  * public static native void EVP_DigestSize(int)
  */
-static jint NativeCrypto_EVP_DigestSize(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx) {
+static jint NativeCrypto_EVP_DigestSize(JNIEnv* env, jclass, EVP_MD_CTX* ctx) {
     // LOGI("NativeCrypto_EVP_DigestSize");
 
     if (ctx == NULL) {
@@ -526,7 +524,7 @@
 /*
  * public static native void EVP_DigestBlockSize(int)
  */
-static jint NativeCrypto_EVP_DigestBlockSize(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx) {
+static jint NativeCrypto_EVP_DigestBlockSize(JNIEnv* env, jclass, EVP_MD_CTX* ctx) {
     // LOGI("NativeCrypto_EVP_DigestBlockSize");
 
     if (ctx == NULL) {
@@ -544,7 +542,7 @@
 /*
  * public static native void EVP_DigestUpdate(int, byte[], int, int)
  */
-static void NativeCrypto_EVP_DigestUpdate(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length) {
+static void NativeCrypto_EVP_DigestUpdate(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length) {
     // LOGI("NativeCrypto_EVP_DigestUpdate %x, %x, %d, %d", ctx, buffer, offset, length);
 
     if (ctx == NULL || buffer == NULL) {
@@ -561,7 +559,7 @@
 /*
  * public static native void EVP_VerifyInit(int, java.lang.String)
  */
-static void NativeCrypto_EVP_VerifyInit(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jstring algorithm) {
+static void NativeCrypto_EVP_VerifyInit(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jstring algorithm) {
     // LOGI("NativeCrypto_EVP_VerifyInit");
 
     if (ctx == NULL || algorithm == NULL) {
@@ -586,7 +584,7 @@
 /*
  * public static native void EVP_VerifyUpdate(int, byte[], int, int)
  */
-static void NativeCrypto_EVP_VerifyUpdate(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length) {
+static void NativeCrypto_EVP_VerifyUpdate(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length) {
     // LOGI("NativeCrypto_EVP_VerifyUpdate %x, %x, %d, %d", ctx, buffer, offset, length);
 
     if (ctx == NULL || buffer == NULL) {
@@ -603,7 +601,7 @@
 /*
  * public static native void EVP_VerifyFinal(int, byte[], int, int, int)
  */
-static int NativeCrypto_EVP_VerifyFinal(JNIEnv* env, jclass clazz, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length, EVP_PKEY* pkey) {
+static int NativeCrypto_EVP_VerifyFinal(JNIEnv* env, jclass, EVP_MD_CTX* ctx, jbyteArray buffer, jint offset, jint length, EVP_PKEY* pkey) {
     // LOGI("NativeCrypto_EVP_VerifyFinal %x, %x, %d, %d %x", ctx, buffer, offset, length, pkey);
 
     if (ctx == NULL || buffer == NULL || pkey == NULL) {
@@ -696,7 +694,7 @@
 /**
  * Verifies an RSA signature.
  */
-static int NativeCrypto_verifysignature(JNIEnv* env, jclass clazz,
+static int NativeCrypto_verifysignature(JNIEnv* env, jclass,
         jbyteArray msg, jbyteArray sig, jstring algorithm, jbyteArray mod, jbyteArray exp) {
 
     JNI_TRACE("NativeCrypto_verifysignature msg=%p sig=%p algorithm=%p mod=%p exp%p",
@@ -723,7 +721,7 @@
     jint expLength = env->GetArrayLength(exp);
 
     ScopedUtfChars algorithmChars(env, algorithm);
-    JNI_TRACE("NativeCrypto_verifysignature algorithmChars=%s", algorithmChars);
+    JNI_TRACE("NativeCrypto_verifysignature algorithmChars=%s", algorithmChars.c_str());
 
     RSA* rsa = rsaCreateKey((unsigned char*) modBytes.bytes(), modLength, (unsigned char*) expBytes.bytes(), expLength);
     if (rsa != NULL) {
@@ -764,6 +762,7 @@
     }
 }
 
+#ifdef WITH_JNI_TRACE
 /**
  * Convert content type constant to string.
  */
@@ -788,7 +787,9 @@
         }
     }
 }
+#endif
 
+#ifdef WITH_JNI_TRACE
 /**
  * Simple logging call back to show hand shake messages
  */
@@ -803,11 +804,13 @@
            len,
            arg);
 }
+#endif
 
+#ifdef WITH_JNI_TRACE
 /**
  * Based on example logging call back from SSL_CTX_set_info_callback man page
  */
-static void info_callback_LOG(const SSL *s, int where, int ret)
+static void info_callback_LOG(const SSL* s __attribute__ ((unused)), int where, int ret)
 {
     int w = where & ~SSL_ST_MASK;
     const char* str;
@@ -855,6 +858,7 @@
                   s, str, where, SSL_state_string(s), SSL_state_string_long(s));
     }
 }
+#endif
 
 /**
  * Returns an array containing all the X509 certificate's bytes.
@@ -869,7 +873,7 @@
 
     int count = sk_X509_num(chain);
     if (count <= 0) {
-        NULL;
+        return NULL;
     }
 
     jobjectArray joa = env->NewObjectArray(count, env->FindClass("[B"), NULL);
@@ -1212,7 +1216,7 @@
 /**
  * Verify the X509 certificate via SSL_CTX_set_cert_verify_callback
  */
-static int cert_verify_callback(X509_STORE_CTX* x509_store_ctx, void* arg)
+static int cert_verify_callback(X509_STORE_CTX* x509_store_ctx, void* arg __attribute__ ((unused)))
 {
     /* Get the correct index to the SSLobject stored into X509_STORE_CTX. */
     SSL* ssl = (SSL*)X509_STORE_CTX_get_ex_data(x509_store_ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
@@ -1260,7 +1264,7 @@
  * for SSL_MODE_HANDSHAKE_CUTTHROUGH support, since SSL_do_handshake
  * returns before the handshake is completed in this case.
  */
-static void info_callback(const SSL *ssl, int where, int ret) {
+static void info_callback(const SSL *ssl, int where, int ret __attribute__ ((unused))) {
     JNI_TRACE("ssl=%p info_callback where=0x%x ret=%d", ssl, where, ret);
 #ifdef WITH_JNI_TRACE
     info_callback_LOG(ssl, where, ret);
@@ -1296,7 +1300,7 @@
 /*
  * public static native int SSL_CTX_new();
  */
-static int NativeCrypto_SSL_CTX_new(JNIEnv* env, jclass clazz) {
+static int NativeCrypto_SSL_CTX_new(JNIEnv* env, jclass) {
     SSL_CTX* sslCtx = SSL_CTX_new(SSLv23_method());
     if (sslCtx == NULL) {
         jniThrowRuntimeException(env, "SSL_CTX_new");
@@ -1412,11 +1416,11 @@
  *                                  CertificateChainVerifier ccv) throws SSLException;
  */
 static jint NativeCrypto_SSL_new(JNIEnv* env, jclass,
-                                 jint ssl_ctx_address, jstring privatekey, jstring certificates, jbyteArray seed, jobject ccv)
+                                 jint ssl_ctx_address, jstring privatekey, jstring certificates, jbyteArray seed)
 {
     SSL_CTX* ssl_ctx = to_SSL_CTX(ssl_ctx_address);
-    JNI_TRACE("ssl_ctx=%p NativeCrypto_SSL_new privatekey=%p certificates=%p seed=%p ccv=%p",
-             ssl_ctx, privatekey, certificates, seed, ccv);
+    JNI_TRACE("ssl_ctx=%p NativeCrypto_SSL_new privatekey=%p certificates=%p seed=%p",
+             ssl_ctx, privatekey, certificates, seed);
     if (ssl_ctx == NULL) {
         jniThrowNullPointerException(env, "SSL_CTX is null");
         JNI_TRACE("ssl_ctx=%p NativeCrypto_SSL_new => NULL", ssl_ctx);
@@ -1435,7 +1439,7 @@
 
     SSL* ssl = SSL_new(ssl_ctx);
     if (ssl == NULL) {
-        throwSSLExceptionWithSslErrors(env, 0, 0,
+        throwSSLExceptionWithSslErrors(env, 0,
                 "Unable to create SSL structure");
         JNI_TRACE("ssl_ctx=%p NativeCrypto_SSL_new => NULL", ssl_ctx);
         return NULL;
@@ -1459,7 +1463,7 @@
 
         if (privatekeyevp == NULL) {
             LOGE(ERR_error_string(ERR_get_error(), NULL));
-            throwSSLExceptionWithSslErrors(env, 0, 0,
+            throwSSLExceptionWithSslErrors(env, 0,
                     "Error parsing the private key");
             SSL_free(ssl);
             JNI_TRACE("ssl_ctx=%p NativeCrypto_SSL_new => NULL", ssl_ctx);
@@ -1473,7 +1477,7 @@
 
         if (certificatesx509 == NULL) {
             LOGE(ERR_error_string(ERR_get_error(), NULL));
-            throwSSLExceptionWithSslErrors(env, 0, 0,
+            throwSSLExceptionWithSslErrors(env, 0,
                     "Error parsing the certificates");
             EVP_PKEY_free(privatekeyevp);
             SSL_free(ssl);
@@ -1484,7 +1488,7 @@
         int ret = SSL_use_certificate(ssl, certificatesx509);
         if (ret != 1) {
             LOGE(ERR_error_string(ERR_get_error(), NULL));
-            throwSSLExceptionWithSslErrors(env, ret, 0,
+            throwSSLExceptionWithSslErrors(env, 0,
                     "Error setting the certificates");
             X509_free(certificatesx509);
             EVP_PKEY_free(privatekeyevp);
@@ -1496,7 +1500,7 @@
         ret = SSL_use_PrivateKey(ssl, privatekeyevp);
         if (ret != 1) {
             LOGE(ERR_error_string(ERR_get_error(), NULL));
-            throwSSLExceptionWithSslErrors(env, ret, 0,
+            throwSSLExceptionWithSslErrors(env, 0,
                     "Error setting the private key");
             X509_free(certificatesx509);
             EVP_PKEY_free(privatekeyevp);
@@ -1507,7 +1511,7 @@
 
         ret = SSL_check_private_key(ssl);
         if (ret != 1) {
-            throwSSLExceptionWithSslErrors(env, ret, 0,
+            throwSSLExceptionWithSslErrors(env, 0,
                     "Error checking the private key");
             X509_free(certificatesx509);
             EVP_PKEY_free(privatekeyevp);
@@ -1639,7 +1643,7 @@
       return;
     }
     ScopedUtfChars str(env, controlString);
-    JNI_TRACE("ssl=%p NativeCrypto_SSL_controlString str=%s", ssl, str);
+    JNI_TRACE("ssl=%p NativeCrypto_SSL_controlString str=%s", ssl, str.c_str());
     int rc = SSL_set_cipher_list(ssl, str.c_str());
     if (rc == 0) {
         freeSslErrorState();
@@ -1683,7 +1687,7 @@
          */
         int sslErrorCode = SSL_get_error(ssl, ret);
         if (sslErrorCode != SSL_ERROR_ZERO_RETURN) {
-            throwSSLExceptionWithSslErrors(env, ret, sslErrorCode,
+            throwSSLExceptionWithSslErrors(env, sslErrorCode,
                                           "SSL session set");
             SSL_clear(ssl);
         }
@@ -1763,7 +1767,7 @@
     JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake s=%d", ssl, fd);
 
     if (ret != 1) {
-        throwSSLExceptionWithSslErrors(env, ret, 0,
+        throwSSLExceptionWithSslErrors(env, 0,
                 "Error setting the file descriptor");
         SSL_clear(ssl);
         JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
@@ -1832,8 +1836,7 @@
                 int selectResult = sslSelect(error, fd, appData, timeout);
 
                 if (selectResult == -1) {
-                    throwSSLExceptionWithSslErrors(env, -1, error,
-                        "handshake error");
+                    throwSSLExceptionWithSslErrors(env, error, "handshake error");
                     SSL_clear(ssl);
                     JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
                     return 0;
@@ -1862,7 +1865,7 @@
             (sslErrorCode == SSL_ERROR_SYSCALL && errno == 0)) {
           throwSSLExceptionStr(env, "Connection closed by peer");
         } else {
-          throwSSLExceptionWithSslErrors(env, ret, sslErrorCode,
+          throwSSLExceptionWithSslErrors(env, sslErrorCode,
               "Trouble accepting connection");
         }
         SSL_clear(ssl);
@@ -1875,7 +1878,7 @@
          * at this point.
          */
         int sslErrorCode = SSL_get_error(ssl, ret);
-        throwSSLExceptionWithSslErrors(env, ret, sslErrorCode,
+        throwSSLExceptionWithSslErrors(env, sslErrorCode,
                 "Trouble accepting connection");
         SSL_clear(ssl);
         JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
@@ -2062,7 +2065,7 @@
     switch (ret) {
         case THROW_EXCEPTION:
             // See sslRead() regarding improper failure to handle normal cases.
-            throwSSLExceptionWithSslErrors(env, returnCode, errorCode, "Read error");
+            throwSSLExceptionWithSslErrors(env, errorCode, "Read error");
             result = -1;
             break;
         case THROW_SOCKETTIMEOUTEXCEPTION:
@@ -2105,7 +2108,7 @@
     int result;
     if (ret == THROW_EXCEPTION) {
         // See sslRead() regarding improper failure to handle normal cases.
-        throwSSLExceptionWithSslErrors(env, returnCode, errorCode,
+        throwSSLExceptionWithSslErrors(env, errorCode,
                 "Read error");
         result = -1;
     } else if(ret == THROW_SOCKETTIMEOUTEXCEPTION) {
@@ -2261,7 +2264,7 @@
 
     if (ret == THROW_EXCEPTION) {
         // See sslWrite() regarding improper failure to handle normal cases.
-        throwSSLExceptionWithSslErrors(env, returnCode, errorCode,
+        throwSSLExceptionWithSslErrors(env, errorCode,
                 "Write error");
     } else if(ret == THROW_SOCKETTIMEOUTEXCEPTION) {
         throwSocketTimeoutException(env, "Write timed out");
@@ -2287,7 +2290,7 @@
 
     if (ret == THROW_EXCEPTION) {
         // See sslWrite() regarding improper failure to handle normal cases.
-        throwSSLExceptionWithSslErrors(env, returnCode, errorCode,
+        throwSSLExceptionWithSslErrors(env, errorCode,
                 "Write error");
     } else if(ret == THROW_SOCKETTIMEOUTEXCEPTION) {
         throwSocketTimeoutException(env, "Write timed out");
@@ -2370,7 +2373,7 @@
              * exception.
              */
             int sslErrorCode = SSL_get_error(ssl, ret);
-            throwSSLExceptionWithSslErrors(env, ret, sslErrorCode, "SSL shutdown failed");
+            throwSSLExceptionWithSslErrors(env, sslErrorCode, "SSL shutdown failed");
             break;
     }
 
@@ -2449,7 +2452,7 @@
  * Gets and returns in a long integer the creation's time of the
  * actual SSL session.
  */
-static jlong NativeCrypto_SSL_SESSION_get_time(JNIEnv* env, jclass, jint ssl_session_address) {
+static jlong NativeCrypto_SSL_SESSION_get_time(JNIEnv*, jclass, jint ssl_session_address) {
     SSL_SESSION* ssl_session = to_SSL_SESSION(ssl_session_address);
     JNI_TRACE("ssl_session=%p NativeCrypto_SSL_SESSION_get_time", ssl_session);
     jlong result = SSL_SESSION_get_time(ssl_session); // must be jlong, not long or *1000 will overflow
@@ -2495,7 +2498,7 @@
 /**
  * Frees the SSL session.
  */
-static void NativeCrypto_SSL_SESSION_free(JNIEnv* env, jclass, jint ssl_session_address) {
+static void NativeCrypto_SSL_SESSION_free(JNIEnv*, jclass, jint ssl_session_address) {
     SSL_SESSION* ssl_session = to_SSL_SESSION(ssl_session_address);
     JNI_TRACE("ssl_session=%p NativeCrypto_SSL_SESSION_free", ssl_session);
     SSL_SESSION_free(ssl_session);
diff --git a/openssl/src/main/native/BNInterface.c b/openssl/src/main/native/BNInterface.c
index 07f0288..c267f86 100644
--- a/openssl/src/main/native/BNInterface.c
+++ b/openssl/src/main/native/BNInterface.c
@@ -66,7 +66,7 @@
 /**
  * public static native int ERR_get_error();
  */
-static unsigned long NativeBN_ERR_get_error(JNIEnv* env, jclass cls) {
+static unsigned long NativeBN_ERR_get_error(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused))) {
     unsigned long e = ERR_get_error();
     return e;
 }
@@ -74,7 +74,7 @@
 /**
  * public static native String ERR_error_string(int);
  */
-static jstring NativeBN_ERR_error_string(JNIEnv* env, jclass cls, unsigned long e) {
+static jstring NativeBN_ERR_error_string(JNIEnv* env, jclass cls __attribute__ ((unused)), unsigned long e) {
     jstring returnJString = 0;
     char* errStr;
     errStr = ERR_error_string(e, NULL);
@@ -86,7 +86,7 @@
 /**
  * public static native int BN_CTX_new()
  */
-static BN_CTX* NativeBN_BN_CTX_new(JNIEnv* env, jclass cls) {
+static BN_CTX* NativeBN_BN_CTX_new(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused))) {
     return BN_CTX_new();
 }
 
@@ -94,14 +94,14 @@
 /**
  * public static native int BN_new()
  */
-static BIGNUM* NativeBN_BN_new(JNIEnv* env, jclass cls) {
+static BIGNUM* NativeBN_BN_new(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused))) {
     return BN_new();
 }
 
 /**
  * public static native int BN_free()
  */
-static void NativeBN_BN_free(JNIEnv* env, jclass cls, BIGNUM* a) {
+static void NativeBN_BN_free(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused)), BIGNUM* a) {
     if (!oneValidHandle(env, a)) return;
     BN_free(a);
 }
@@ -110,7 +110,7 @@
 /**
  * public static native int BN_cmp(int, int)
  */
-static int NativeBN_BN_cmp(JNIEnv* env, jclass cls, BIGNUM* a, BIGNUM* b) {
+static int NativeBN_BN_cmp(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused)), BIGNUM* a, BIGNUM* b) {
     if (!twoValidHandles(env, a, b)) return 1;
     return BN_cmp(a, b);
 }
@@ -118,7 +118,7 @@
 /**
  * public static native int BN_copy(int, int)
  */
-static jboolean NativeBN_BN_copy(JNIEnv* env, jclass cls, BIGNUM* to, BIGNUM* from) {
+static jboolean NativeBN_BN_copy(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused)), BIGNUM* to, BIGNUM* from) {
     if (!twoValidHandles(env, to, from)) return FALSE;
     return (BN_copy(to, from) != NULL);
 }
@@ -127,7 +127,7 @@
 /**
  * public static native int putULongInt(int, long, int)
  */
-static jboolean NativeBN_putULongInt(JNIEnv* env, jclass cls, BIGNUM* a, unsigned long long dw, jboolean neg) {
+static jboolean NativeBN_putULongInt(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, unsigned long long dw, jboolean neg) {
     if (!oneValidHandle(env, a)) return FALSE;
     unsigned int hi = dw >> 32; // This shifts without sign extension.
     int lo = (int)dw; // This truncates implicitely.
@@ -156,7 +156,7 @@
 /**
  * public static native int BN_dec2bn(int, java.lang.String)
  */
-static int NativeBN_BN_dec2bn(JNIEnv* env, jclass cls, BIGNUM* a, jstring str) {
+static int NativeBN_BN_dec2bn(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, jstring str) {
     if (!oneValidHandle(env, a)) return -1;
     char* tmpStr = (char*)(*env)->GetStringUTFChars(env, str, NULL);
     if (tmpStr != NULL) {
@@ -170,7 +170,7 @@
 /**
  * public static native int BN_hex2bn(int, java.lang.String)
  */
-static int NativeBN_BN_hex2bn(JNIEnv* env, jclass cls, BIGNUM* a, jstring str) {
+static int NativeBN_BN_hex2bn(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, jstring str) {
    if (!oneValidHandle(env, a)) return -1;
     char* tmpStr = (char*)(*env)->GetStringUTFChars(env, str, NULL);
     if (tmpStr != NULL) {
@@ -184,7 +184,7 @@
 /**
  * public static native boolean BN_bin2bn(byte[], int, int, int)
  */
-static jboolean NativeBN_BN_bin2bn(JNIEnv* env, jclass cls, jbyteArray arr, int len, jboolean neg, BIGNUM* ret) {
+static jboolean NativeBN_BN_bin2bn(JNIEnv* env, jclass cls __attribute__ ((unused)), jbyteArray arr, int len, jboolean neg, BIGNUM* ret) {
     if (!oneValidHandle(env, ret)) return FALSE;
     jboolean success;
     unsigned char * tmpBytes;
@@ -208,7 +208,7 @@
  * Also note that the same representation is used in the Cordoba Java Implementation of BigIntegers,
  *        whereof certain functionality is still being used.
  */
-static jboolean NativeBN_litEndInts2bn(JNIEnv* env, jclass cls, jintArray arr, int len, jboolean neg, BIGNUM* ret) {
+static jboolean NativeBN_litEndInts2bn(JNIEnv* env, jclass cls __attribute__ ((unused)), jintArray arr, int len, jboolean neg, BIGNUM* ret) {
     if (!oneValidHandle(env, ret)) return FALSE;
     bn_check_top(ret);
 	if (len > 0) {
@@ -244,7 +244,7 @@
   | (bytes[k + 1] & 0xFF) << 16 \
   | (bytes[k + 0] & 0xFF) << 24 )
 
-static jboolean negBigEndianBytes2bn(JNIEnv* env, jclass cls, unsigned char* bytes, int bytesLen, BIGNUM* ret) {
+static jboolean negBigEndianBytes2bn(JNIEnv* env __attribute__ ((unused)), jclass cls __attribute__ ((unused)), unsigned char* bytes, int bytesLen, BIGNUM* ret) {
 // We rely on: (BN_BITS2 == 32), i.e. BN_ULONG is unsigned int and has 4 bytes:
 //
     bn_check_top(ret);
@@ -330,7 +330,7 @@
 /**
  * public static native long longInt(int)
  */
-static long long NativeBN_longInt(JNIEnv* env, jclass cls, BIGNUM* a) {
+static long long NativeBN_longInt(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a) {
     if (!oneValidHandle(env, a)) return -1;
     bn_check_top(a);
     int intLen = a->top;
@@ -364,7 +364,7 @@
 /**
  * public static native java.lang.String BN_bn2dec(int)
  */
-static jstring NativeBN_BN_bn2dec(JNIEnv* env, jclass cls, BIGNUM* a) {
+static jstring NativeBN_BN_bn2dec(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a) {
     if (!oneValidHandle(env, a)) return NULL;
     char* tmpStr;
     char* retStr;
@@ -381,7 +381,7 @@
 /**
  * public static native java.lang.String BN_bn2hex(int)
  */
-static jstring NativeBN_BN_bn2hex(JNIEnv* env, jclass cls, BIGNUM* a) {
+static jstring NativeBN_BN_bn2hex(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a) {
     if (!oneValidHandle(env, a)) return NULL;
     char* tmpStr;
     char* retStr;
@@ -398,7 +398,7 @@
 /**
  * public static native byte[] BN_bn2bin(int, byte[])
  */
-static jbyteArray NativeBN_BN_bn2bin(JNIEnv* env, jclass cls, BIGNUM* a, jbyteArray to) {
+static jbyteArray NativeBN_BN_bn2bin(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, jbyteArray to) {
     if (!oneValidHandle(env, a)) return NULL;
     jbyteArray returnJBytes = to;
     unsigned char * tmpBytes;
@@ -420,7 +420,7 @@
  * public static native int[] bn2litEndInts(int, int[])
  * cf. litEndInts2bn
  */
-static jintArray NativeBN_bn2litEndInts(JNIEnv* env, jclass cls, BIGNUM* a, jintArray to) {
+static jintArray NativeBN_bn2litEndInts(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, jintArray to) {
     if (!oneValidHandle(env, a)) return NULL;
     jintArray returnJInts = to;
     bn_check_top(a);
@@ -446,7 +446,7 @@
 /**
  * public static native int sign(int)
  */
-static int NativeBN_sign(JNIEnv* env, jclass cls, BIGNUM* a) {
+static int NativeBN_sign(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a) {
     if (!oneValidHandle(env, a)) return -2;
     if (BN_is_zero(a)) return 0;
     else if (BN_is_negative(a)) return -1;
@@ -456,7 +456,7 @@
 /**
  * public static native void BN_set_negative(int, int)
  */
-static void NativeBN_BN_set_negative(JNIEnv* env, jclass cls, BIGNUM* b, int n) {
+static void NativeBN_BN_set_negative(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* b, int n) {
     if (!oneValidHandle(env, b)) return;
     BN_set_negative(b, n);
 }
@@ -464,7 +464,7 @@
 /**
  * public static native int bitLength(int)
  */
-static int NativeBN_bitLength(JNIEnv* env, jclass cls, BIGNUM* a) {
+static int NativeBN_bitLength(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a) {
 // We rely on: (BN_BITS2 == 32), i.e. BN_ULONG is unsigned int and has 4 bytes:
 //
     if (!oneValidHandle(env, a)) return FALSE;
@@ -487,7 +487,7 @@
 /**
  * public static native boolean BN_is_bit_set(int, int)
  */
-static jboolean NativeBN_BN_is_bit_set(JNIEnv* env, jclass cls, BIGNUM* a, int n) {
+static jboolean NativeBN_BN_is_bit_set(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, int n) {
     if (!oneValidHandle(env, a)) return FALSE;
     return (jboolean)BN_is_bit_set(a, n);
 }
@@ -495,7 +495,7 @@
 /**
  * public static native void modifyBit(int, int, int)
  */
-static jboolean NativeBN_modifyBit(JNIEnv* env, jclass cls, BIGNUM* a, int n, int op) {
+static jboolean NativeBN_modifyBit(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* a, int n, int op) {
 // LOGD("NativeBN_BN_modifyBit");
     if (!oneValidHandle(env, a)) return FALSE;
     switch (op) {
@@ -511,7 +511,7 @@
 /**
  * public static native int BN_shift(int, int, int)
  */
-static jboolean NativeBN_BN_shift(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, int n) {
+static jboolean NativeBN_BN_shift(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, int n) {
     if (!twoValidHandles(env, r, a)) return FALSE;
     return (n >= 0) ? BN_lshift(r, a, n) : BN_rshift(r, a, -n);
 }
@@ -519,7 +519,7 @@
 /**
  * public static native boolean BN_add_word(int, int)
  */
-static jboolean NativeBN_BN_add_word(JNIEnv* env, jclass cls, BIGNUM *a, BN_ULONG w) {
+static jboolean NativeBN_BN_add_word(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM *a, BN_ULONG w) {
     if (!oneValidHandle(env, a)) return FALSE;
     return BN_add_word(a, w);
 }
@@ -527,7 +527,7 @@
 /**
  * public static native boolean BN_sub_word(int, int)
  */
-static jboolean NativeBN_BN_sub_word(JNIEnv* env, jclass cls, BIGNUM *a, BN_ULONG w) {
+static jboolean NativeBN_BN_sub_word(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM *a, BN_ULONG w) {
     if (!oneValidHandle(env, a)) return FALSE;
     return BN_sub_word(a, w);
 }
@@ -535,7 +535,7 @@
 /**
  * public static native boolean BN_mul_word(int, int)
  */
-static jboolean NativeBN_BN_mul_word(JNIEnv* env, jclass cls, BIGNUM *a, BN_ULONG w) {
+static jboolean NativeBN_BN_mul_word(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM *a, BN_ULONG w) {
     if (!oneValidHandle(env, a)) return FALSE;
     return BN_mul_word(a, w);
 }
@@ -543,7 +543,7 @@
 /**
  * public static native boolean BN_div_word(int, int)
  */
-static BN_ULONG NativeBN_BN_div_word(JNIEnv* env, jclass cls, BIGNUM *a, BN_ULONG w) {
+static BN_ULONG NativeBN_BN_div_word(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM *a, BN_ULONG w) {
     if (!oneValidHandle(env, a)) return FALSE;
     return BN_div_word(a, w);
 }
@@ -551,7 +551,7 @@
 /**
  * public static native boolean BN_mod_word(int, int)
  */
-static BN_ULONG NativeBN_BN_mod_word(JNIEnv* env, jclass cls, BIGNUM *a, BN_ULONG w) {
+static BN_ULONG NativeBN_BN_mod_word(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM *a, BN_ULONG w) {
     if (!oneValidHandle(env, a)) return FALSE;
     return BN_mod_word(a, w);
 }
@@ -561,7 +561,7 @@
 /**
  * public static native int BN_add(int, int, int)
  */
-static jboolean NativeBN_BN_add(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* b) {
+static jboolean NativeBN_BN_add(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* b) {
     if (!threeValidHandles(env, r, a, b)) return FALSE;
     return BN_add(r, a, b);
 }
@@ -569,7 +569,7 @@
 /**
  * public static native int BN_sub(int, int, int)
  */
-static jboolean NativeBN_BN_sub(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* b) {
+static jboolean NativeBN_BN_sub(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* b) {
     if (!threeValidHandles(env, r, a, b)) return FALSE;
     return BN_sub(r, a, b);
 }
@@ -578,7 +578,7 @@
 /**
  * public static native int BN_gcd(int, int, int, int)
  */
-static jboolean NativeBN_BN_gcd(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* b, BN_CTX* ctx) {
+static jboolean NativeBN_BN_gcd(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* b, BN_CTX* ctx) {
     if (!threeValidHandles(env, r, a, b)) return FALSE;
     return BN_gcd(r, a, b, ctx);
 }
@@ -586,7 +586,7 @@
 /**
  * public static native int BN_mul(int, int, int, int)
  */
-static jboolean NativeBN_BN_mul(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* b, BN_CTX* ctx) {
+static jboolean NativeBN_BN_mul(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* b, BN_CTX* ctx) {
     if (!threeValidHandles(env, r, a, b)) return FALSE;
     return BN_mul(r, a, b, ctx);
 }
@@ -594,7 +594,7 @@
 /**
  * public static native int BN_exp(int, int, int, int)
  */
-static jboolean NativeBN_BN_exp(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* p, BN_CTX* ctx) {
+static jboolean NativeBN_BN_exp(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* p, BN_CTX* ctx) {
     if (!threeValidHandles(env, r, a, p)) return FALSE;
     return BN_exp(r, a, p, ctx);
 }
@@ -602,7 +602,7 @@
 /**
  * public static native boolean BN_div(int, int, int, int, int)
  */
-static jboolean NativeBN_BN_div(JNIEnv* env, jclass cls, BIGNUM* dv, BIGNUM* rem, BIGNUM* m, BIGNUM* d, BN_CTX* ctx) {
+static jboolean NativeBN_BN_div(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* dv, BIGNUM* rem, BIGNUM* m, BIGNUM* d, BN_CTX* ctx) {
     if (!fourValidHandles(env, (rem ? rem : dv), (dv ? dv : rem), m, d)) return FALSE;
     return BN_div(dv, rem, m, d, ctx);
 }
@@ -610,7 +610,7 @@
 /**
  * public static native int BN_nnmod(int, int, int, int)
  */
-static jboolean NativeBN_BN_nnmod(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* m, BN_CTX* ctx) {
+static jboolean NativeBN_BN_nnmod(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* m, BN_CTX* ctx) {
     if (!threeValidHandles(env, r, a, m)) return FALSE;
     return BN_nnmod(r, a, m, ctx);
 }
@@ -618,7 +618,7 @@
 /**
  * public static native int BN_mod_exp(int, int, int, int, int)
  */
-static jboolean NativeBN_BN_mod_exp(JNIEnv* env, jclass cls, BIGNUM* r, BIGNUM* a, BIGNUM* p, BIGNUM* m, BN_CTX* ctx) {
+static jboolean NativeBN_BN_mod_exp(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* r, BIGNUM* a, BIGNUM* p, BIGNUM* m, BN_CTX* ctx) {
     if (!fourValidHandles(env, r, a, p, m)) return FALSE;
     return BN_mod_exp(r, a, p, m, ctx);
 }
@@ -627,7 +627,7 @@
 /**
  * public static native int BN_mod_inverse(int, int, int, int)
  */
-static jboolean NativeBN_BN_mod_inverse(JNIEnv* env, jclass cls, BIGNUM* ret, BIGNUM* a, BIGNUM* n, BN_CTX* ctx) {
+static jboolean NativeBN_BN_mod_inverse(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* ret, BIGNUM* a, BIGNUM* n, BN_CTX* ctx) {
     if (!threeValidHandles(env, ret, a, n)) return FALSE;
     return (BN_mod_inverse(ret, a, n, ctx) != NULL);
 }
@@ -636,7 +636,7 @@
 /**
  * public static native int BN_generate_prime_ex(int, int, boolean, int, int, int)
  */
-static jboolean NativeBN_BN_generate_prime_ex(JNIEnv* env, jclass cls, BIGNUM* ret, int bits, jboolean safe,
+static jboolean NativeBN_BN_generate_prime_ex(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* ret, int bits, jboolean safe,
         BIGNUM* add, BIGNUM* rem, jint cb) {
     if (!oneValidHandle(env, ret)) return FALSE;
     return BN_generate_prime_ex(ret, bits, safe, add, rem, (BN_GENCB*) cb);
@@ -645,7 +645,7 @@
 /**
  * public static native int BN_mod_inverse(int, int, int, int)
  */
-static jboolean NativeBN_BN_is_prime_ex(JNIEnv* env, jclass cls, BIGNUM* p, int nchecks, BN_CTX* ctx, jint cb) {
+static jboolean NativeBN_BN_is_prime_ex(JNIEnv* env, jclass cls __attribute__ ((unused)), BIGNUM* p, int nchecks, BN_CTX* ctx, jint cb) {
     if (!oneValidHandle(env, p)) return FALSE;
     return BN_is_prime_ex(p, nchecks, ctx, (BN_GENCB*) cb);
 }