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

Enable gcc -Wtype-limits and fix upcoming issues.

    Details

    • Subcomponent:
    • Resolved In Build:
      b57

      Backports

        Description

        This warning detects unnecessary compares for >= 0 of unsigned values.

        At least one warning unveils a real bug. In memory/blockOffsetTable.cpp, BlockOffsetArrayContigSpace::last_active_index(), the compare to >=0 tries to prevent an underflow, but the value is unsigned.

        Further useless compares in real code are in os_linux.cpp, opto/graphKit.cpp and prims/jvmtiRedefineClasses.cpp.

        In some places debug code with constant debug flags caused warnings in the opt build (g1/concurrentMark.cpp, classfile/systemDictionary.cpp) .

        Most of the warnings occur in asserts.

        The change also removes an empty #ifdef ASSERT.

          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: