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

Build OpenJDK8 reports a warning error wvarhidenmem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 8-pool
    • 8, openjdk8u
    • client-libs
    • Environment: Solaris 11.4 sparcv9

    • 2d
    • generic
    • generic

      I have checked all the warning messages that are output when building OpenJDK8 with the Solaris Studio C compiler.
      I believe that one of the code the message points out is not just a warning, but a bug.
      When compiling sun/font/layout/MPreFixups.cpp in JDK8, the Solaris Studio C compiler outputs the following warning message:
      "/xxxx/jdk/src/share/native/sun/font/layout/MPreFixups.cpp",
      line 91: Warning, wvarhidenmem: success hides the same name in an outer scope.
      https://github.com/openjdk/jdk8u/blob/dce530003ca50a94e2305dfb10653304863f799a/jdk/src/share/native/sun/font/layout/MPreFixups.cpp#L91
      I believe this is not merely a warning, but rather a bug.
      The 'success' value set in lines L101, L114, L117, L122 should be set to the 'success' argument in L68.
      If the 'success' setting is incorrect, it could lead to erroneous behavior in the calling function Java_sun_font_SunLayoutEngine_nativeLayout().

      MPreFixups handles text layout and rendering for Indic scripts.
      The condition where the error (LE_MEMORY_ALLOCATION_ERROR, LE_NO_LAYOUT_ERROR, LE_INDEX_OUT_OF_BOUNDS_ERROR, LE_ILLEGAL_ARGUMENT_ERROR) is set to success seems to be special.
      I have not been able to create test code that actually causes a problem.
      MPreFixups.cpp has been removed since JDK10.

            aivanov Alexey Ivanov
            kyukihiro Kimura Yukihiro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: