-Wlogical-not-parentheses warnings in JRSUIConstantSync.m

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: 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).

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

              Created:
              Updated:
              Resolved: