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

-Wlogical-not-parentheses warnings in JRSUIConstantSync.m

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • client-libs
    • b127

      In Mac OS X with Xcode 7.3, building java.desktop produces hundreds of lines of warnings like this:

      /Users/dan/Dev/jdk/jdk9/jdk/src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.m:132:5: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
          CONSISTENCY_CHECK(Key, value);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/dan/Dev/jdk/jdk9/jdk/src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.m:96:10: note: expanded from macro 'CONSISTENCY_CHECK'
          if ( !CONSTANT_CHECK(clazz, constant) ) return NO;
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/dan/Dev/jdk/jdk9/jdk/src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.m:132:5: note: add parentheses after the '!' to evaluate the comparison first

      It appears innocent, but produces a lot of noise (and, if I configure without "--disable-warnings-as-errors", breaks the build).

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: