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.

          Attachments

            Issue Links

              Activity

                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: