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

Issue with useAppleColor check in CSystemColors.m

    XMLWordPrintable

Details

    • b18
    • generic
    • os_x

    Backports

      Description

        While looking into XCode 12 compilation issues, a problem in jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m
        was found when checking the useAppleColor flag . Because this is a general issue and not really much related to XCode 12 (just shown when using the new compiler) a separate issue is filed for it.

        See also
        https://git.openjdk.java.net/jdk/pull/348

        This is the error message:

        .../src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m:129:9: error: converting the result of '?:' with integer constants to a boolean always evaluates to 'true' [-Werror,-Wtautological-constant-compare]
            if (colorIndex < (useAppleColor) ? sun_lwawt_macosx_LWCToolkit_NUM_APPLE_COLORS : java_awt_SystemColor_NUM_COLORS) {
                ^
        1 error generated.

        Attachments

          Issue Links

            Activity

              People

                mbaesken Matthias Baesken
                mbaesken Matthias Baesken
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: