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

Java_sun_awt_X11_XlibWrapper_XSynchronize is wrong and unused

XMLWordPrintable

    • b16

      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.

            azvegint Alexander Zvegintsev
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: