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

[8u] enable Wparentheses warnings in HotSpot

    XMLWordPrintable

    Details

    • Resolved In Build:
      b01
    • Verification:
      Not verified

      Backports

        Description

        In 8u HotSpot there are several Wparentheses warnings which causes compilation failure on recent versions of Xcode. We will fix these warnings as part of our toolchain upgrade effort.

        This is somewhat complicated by the fact that enabling (or disabling) Wparentheses also changes the default for a number of other parentheses-related warnings [0]. In the current 8u hotspot code, the following warnings are applicable:

        logical-op-parentheses
        bitwise-op-parentheses
        parentheses-equality
        parentheses

        The first two are already explicitly disabled in gcc.make and will be addressed (very soon) with their own individual bug/changesets. This fix is exclusively for the warnings generated as a result of Wparentheses (and Wbitwise-op-parentheses, which is implicitly disabled by Wno-parentheses).

        The two warnings of interest are:

        warning: '&' within '|' [-Wbitwise-op-parentheses]
        warning: using the result of an assignment as a condition without parentheses [-Wparentheses]

        This is a partial backport of Paul Hohensee's massive cleanup [1] of Xcode warnings. A complete backport of that chnageset is well beyond the scope of our toolchain upgrade work. But we do want to clean up as many warnings as we can with minimal risk.

        [0] https://clang.llvm.org/docs/DiagnosticsReference.html#wparentheses
        [1] http://hg.openjdk.java.net/jdk10/jdk10/hotspot/rev/c044f8d03932

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dbuck David Buck
                Reporter:
                dbuck David Buck
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: