[8] WXP minor fixes for a cleaner compile of c code

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue Dec 10 10:09:54 UTC 2013


Francis,

I suggest you post this to the hotspot-dev mailing list instead, since 
these are changes to hotspot source code, not the build system.

/Magnus

On 2013-12-07 18:49, Francis ANDRE wrote:
> Hi
>
> 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)




More information about the build-dev mailing list