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

"if( !this )" construct prevents build on Xcode 6.3

XMLWordPrintable

    • b64
    • x86_64
    • os_x

        Yesterday I updated to the latests Xcode 6.3 which brought Clang 6.1 to my
        machine. Later I tried to build jdk9 and ran into this thing:

            error: 'this' pointer cannot be null in well-defined C++ code; pointer may be
            assumed to always convert to true [-Werror,-Wundefined-bool-conversion]

        Caused by this :

            if (!this)...

        I've found 2 files are affected by this problem:

           * dev/hotspot/src/share/vm/libadt/set.cpp:60
           * dev/hotspot/src/share/vm/adlc/formssel.cpp:3395

        Code around those lines doesn't seem to have changed since 2007 (at least).
        Unfortunately I'm not familiar with C++, and in order to build jdk9 I googled a
        bit and found that dereferencing a null pointer in this case would lead to an
        undefined behaviour. So I'm asking you whether these conditionals are needed or
        it's something we can remove. (For now I commented them out from my working
        copy).

              sla Staffan Larsen (Inactive)
              prappo Pavel Rappo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: