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

Enable implicit switch fallthrough detection

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 26
    • hotspot

      All of gcc, clang, and Visual Studio provide options to warn when a switch case implicitly falls through to the next case. For gcc and clang it's `-Wimplicit-fallthrough[=level]`, and for Visual Studio it's C26819.

      We currently don't enable these warnings at all for Visual Studio. The level 3 warning is enabled for gcc and clang, by `-Wextra`. But for HotSpot we disable this warning. And there are currently 85 such warnings when building HotSpot.

      Once we have C++17 `[[fallthrough]]` attributes, those places should be examined and apply the new attribute, or fix any bugs that might be found by that examination. Once that's been done, stop disabling the warning.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: