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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: infrastructure
    • Environment:

      OS X 10.10.3
      Xcode 6.3 (6D570)

    • Subcomponent:
    • Resolved In Build:
      b64
    • CPU:
      x86_64
    • OS:
      os_x

      Backports

        Description

        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).

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sla Staffan Larsen (Inactive)
                  Reporter:
                  prappo Pavel Rappo
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: