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

Fix xlc17 clang 15 warnings in java.desktop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • client-libs
    • None
    • b26

      Compiling on AIX with xlc17 which contains the new clang 15 frontend
      shows the following warnings.

      src/java.desktop/unix/native/common/awt/awt_GraphicsEnv.h:53:12: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype]
      extern int XShmQueryExtension();
      ^
      /usr/include/X11/extensions/XShm.h:91:6: note: conflicting prototype is here
      Bool XShmQueryExtension(
      ^



      src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c:158:11: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
      if (m = fp_unity_launcher_entry_get_quicklist(entry)) {
      ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      solved by adding line
      DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \

      src/java.desktop/share/native/common/java2d/opengl/OGLPaints.c:581:48: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
      snprintf(cycleCode, sizeof(cycleCode), noCycleCode, texCoordCalcCode);
      ^~~~~~~~~~~



      src/java.desktop/share/native/common/java2d/opengl/OGLBufImgOps.c:153:48: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
      snprintf(finalSource, sizeof(finalSource), convolveShaderSource,
      ^~~~~~~~~~~~~~~~~~~~

      src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1095:41: error: '&&' within '||' [-Werror,-Wlogical-op-parentheses]
      if ((synth_state & MOUSE_OVER) != 0 && (synth_state & PRESSED) == 0 ||
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
      src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1180:29: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
      if (init_result = (NULL == gtk2_widgets[_GTK_CHECK_MENU_ITEM_TYPE]))
      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      solved by adding line
      DISABLED_WARNINGS_clang_aix_gtk2_interface.c := parentheses logical-op-parentheses, \



      In harfbuzz, hb-subset.cc we can undo the define for AIX we needed
      to compile with xlc16.
      In jdk21 we would like to support both compilers, but afterwards
      we can omit the define altogether.
      See also JDK-8304291: [AIX] Broken build after JDK-8301998

            goetz Goetz Lindenmaier
            goetz Goetz Lindenmaier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: