I get a compiler error in Java_sun_awt_X11_XlibWrapper_XSynchronize when building jdk19 with clang 12:
* For target support_native_java.desktop_libawt_xawt_XlibWrapper.o:
ws/jdk/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c:2191:12: error: cast to smaller integer type 'jint' (aka 'int') from 'int (*)(Display *)' (aka 'int (*)(struct _XDisplay *)') [-Werror,-Wpointer-to-int-cast]
return (jint) XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False));
The error is because XSynchronize returns a pointer. Casting to jint loses information. This seems to have gone unnoticed because as far as I can tell this native method is never called. Perhaps it should just be removed.
* For target support_native_java.desktop_libawt_xawt_XlibWrapper.o:
ws/jdk/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c:2191:12: error: cast to smaller integer type 'jint' (aka 'int') from 'int (*)(Display *)' (aka 'int (*)(struct _XDisplay *)') [-Werror,-Wpointer-to-int-cast]
return (jint) XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False));
The error is because XSynchronize returns a pointer. Casting to jint loses information. This seems to have gone unnoticed because as far as I can tell this native method is never called. Perhaps it should just be removed.