Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8030010

cleanup native code warnings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Resolved In Build:
      b04

      Description

      http://mail.openjdk.java.net/pipermail/build-dev/2013-December/011332.html

      Below are some warnings produced by the build of jdk8.

      Z:/JDK/jdk8/jdk/src/share/native/java/lang/Throwable.c(48) : warning C4028:
      paramétre formel 3 différent de la déclaration
      Z:/JDK/jdk8/jdk/src/windows/native/java/io/WinNTFileSystem_md.c(363) : warning
      C4101: 'pathlen': variable locale non référencée
      Z:/JDK/jdk8/jdk/src/windows/native/common/jdk_util_md.c(45) : warning C4101:
      'ret': variable locale non référencée
      Z:/JDK/jdk8/jdk/src/share/bin/java.c(1253) : warning C4101: 'result': variable
      locale nonréférencée
      Z:/JDK/jdk8/jdk/src/share/bin/parse_manifest.c(196) : warning C4244: 'fonction':
      conversion de 'jlong' en 'unsigned int', perte possible de données



      And here are the fixes

      diff --git a/src/share/bin/java.c b/src/share/bin/java.c
      --- a/src/share/bin/java.c
      +++ b/src/share/bin/java.c
      @@ -1250,7 +1250,6 @@
        GetApplicationClass(JNIEnv *env)
        {
            jmethodID mid;
      - jobject result;
            jclass cls = GetLauncherHelperClass(env);
            NULL_CHECK0(cls);
            NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls,
      diff --git a/src/share/bin/parse_manifest.c b/src/share/bin/parse_manifest.c
      --- a/src/share/bin/parse_manifest.c
      +++ b/src/share/bin/parse_manifest.c
      @@ -193,7 +193,7 @@
                return (-1);
            if ((buffer = malloc(END_MAXLEN)) == NULL)
                return (-1);
      - if ((bytes = read(fd, buffer, len)) < 0) {
      + if ((bytes = read(fd, buffer, (size_t)len)) < 0) {
                free(buffer);
                return (-1);
            }
      diff --git a/src/share/native/java/lang/Throwable.c
      b/src/share/native/java/lang/Throwable.c
      --- a/src/share/native/java/lang/Throwable.c
      +++ b/src/share/native/java/lang/Throwable.c
      @@ -44,7 +44,7 @@
         * `this' so you can write 'throw e.fillInStackTrace();'
         */
        JNIEXPORT jobject JNICALL
      -Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, int
      dummy)
      +Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint
      dummy)
        {
            JVM_FillInStackTrace(env, throwable);
            return throwable;
      diff --git a/src/windows/native/common/jdk_util_md.c
      b/src/windows/native/common/jdk_util_md.c
      --- a/src/windows/native/common/jdk_util_md.c
      +++ b/src/windows/native/common/jdk_util_md.c
      @@ -42,7 +42,6 @@
        JNIEXPORT HMODULE JDK_LoadSystemLibrary(const char* name) {
            HMODULE handle = NULL;
            char path[MAX_PATH];
      - int ret;

            if (GetSystemDirectory(path, sizeof(path)) != 0) {
                strcat(path, "\\");
      diff --git a/src/windows/native/java/io/WinNTFileSystem_md.c
      b/src/windows/native/java/io/WinNTFileSystem_md.c
      --- a/src/windows/native/java/io/WinNTFileSystem_md.c
      +++ b/src/windows/native/java/io/WinNTFileSystem_md.c
      @@ -360,7 +360,6 @@
                                                          jobject file)
        {
            jint rv = 0;
      - jint pathlen;

            WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
            if (pathbuf == NULL)

        Attachments

          Activity

            People

            Assignee:
            mchung Mandy Chung
            Reporter:
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: