JDK-8245722 : 32-bit build failures after JDK-8243491
  • Type: Bug
  • Component: core-libs
  • Affected Version: 15
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-05-25
  • Updated: 2020-05-30
  • Resolved: 2020-05-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b25Fixed
Related Reports
Relates :  
Relates :  
Description
$ CONF=linux-x86-server-fastdebug make all-images
...
/home/shade/trunks/jdk-jdk/test/jdk/java/foreign/libNativeAccess.c: In function 'Java_TestNative_allocate':
/home/shade/trunks/jdk-jdk/test/jdk/java/foreign/libNativeAccess.c:121:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     return (jlong)malloc(size);
            ^
/home/shade/trunks/jdk-jdk/test/jdk/java/foreign/libNativeAccess.c: In function 'Java_TestNative_free':
/home/shade/trunks/jdk-jdk/test/jdk/java/foreign/libNativeAccess.c:126:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     free((void*) ptr);
          ^
cc1: all warnings being treated as errors

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/a07bcb9122f0 User: shade Date: 2020-05-26 07:29:14 +0000
26-05-2020

Similarly to JDK-8236634 fixes: diff -r d52c2e540934 test/jdk/java/foreign/libNativeAccess.c --- a/test/jdk/java/foreign/libNativeAccess.c Mon May 25 12:03:30 2020 +0200 +++ b/test/jdk/java/foreign/libNativeAccess.c Mon May 25 14:22:58 2020 +0200 @@ -116,12 +116,12 @@ return (*env)->GetDirectBufferCapacity(env, buf); } JNIEXPORT jlong JNICALL Java_TestNative_allocate(JNIEnv *env, jclass cls, jint size) { - return (jlong)malloc(size); + return (jlong)(uintptr_t)malloc(size); } JNIEXPORT void JNICALL Java_TestNative_free(JNIEnv *env, jclass cls, jlong ptr) { - free((void*) ptr); + free((void*)(uintptr_t)ptr); }
25-05-2020

This is similar to JDK-8236634
25-05-2020