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

Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.

    Details

    • Subcomponent:
    • Resolved In Build:
      b93

      Backports

        Description

        In several places variables are initializaed in switch statements or the like, where the default case is decorated with ShouldNotReachHere() and the initialization is missing.

        In the debug build, ShouldNotReachHere() can be suppressed, so the uninitialized value actually can cause problems.

        In opt builds, not all tools recognize the ShouldNotReachHere properly.

        This adds a row of initializations where I encountered problems and enables -Wuninitialized with linux gcc 4.8.
        This would find most of these warnings. The flag works best in the product build, as it depends on compiler optimizations.

        This unveiled some missing initializations in constructors, as in compile.hpp and oopMap.hpp, that can actually cause wrong behavior.

          Activity

          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/825cee2cd7a6
          User: coleenp
          Date: 2015-10-22 23:37:48 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/825cee2cd7a6 User: coleenp Date: 2015-10-22 23:37:48 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/825cee2cd7a6
          User: lana
          Date: 2015-11-18 23:53:22 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/825cee2cd7a6 User: lana Date: 2015-11-18 23:53:22 +0000

            People

            • Assignee:
              goetz Goetz Lindenmaier
              Reporter:
              goetz Goetz Lindenmaier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: