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

Resolve disabled warnings for libunpack and the unpack200 binary

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs

      Backports

        Description

        With JDK-8074096 (changeset http://hg.openjdk.java.net/jdk9/dev/jdk/rev/676ec3e5cfc3), most warnings in the JDK native libraries were disabled to minimize the noise when building.

        One of the library that had warnings disabled are libunpack, in make/lib/Lib-jdk.pack200.gmk.
        The following warnings are disabled for this library:
        DISABLED_WARNINGS_gcc := conversion-null sign-compare format-security format-nonliteral parentheses
        DISABLED_WARNINGS_clang := bool-conversion format-security
        DISABLED_WARNINGS_solstudio := truncwarn
        DISABLED_WARNINGS_microsoft := 4267 4018

        The unpack200 launcher, which partly shares sources with libunpack, also had a similar, but not identical, set of warnings disabled. The unpack200 binary is build from make/launcher/Launcher-jdk.pack200.gmk. The following warnings are disabled for this executable:
        DISABLED_WARNINGS_gcc := sign-compare unused-result format-nonliteral format-security parentheses
        DISABLED_WARNINGS_microsoft := 4267 4018

        (Note that warnings are disabled per toolchain type (essentially, compiler). Also note that disabling warnings does not work for gcc prior to version 4.4.)

        Blindly hiding warnings is just sweeping the problems under the rug. On the other hand, not all warnings are meaningful to fix in the source code.

        The expected outcome of this bug is, for each disabled warning category, either:
        1) The code is fixed so the warning can be re-enabled (by removing it from the list of disabled warnings for that library), or
        2) The warning is kept disabled, but in that case a rationale added to the stanza for that library in the makefile.

        Incremental builds is helpful when testing the effect of warnings. Once the build has fully finished, if the list of warnings is modified for this library,
        only that library is rebuilt on future calls to make (without clean). This makes it easy to spot the effect of re-enabling warnings for a single library.

        For reference, the log files prior and after JDK-8074096 was pushed is stored here:
        http://cr.openjdk.java.net/~ihse/no-warnings/saved-logs-for-JDK-8074096/

          Issue Links

            Activity

            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/ee13ce369705
            User: mikael
            Date: 2015-03-20 17:06:17 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/ee13ce369705 User: mikael Date: 2015-03-20 17:06:17 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/ee13ce369705
            User: lana
            Date: 2015-04-01 19:53:23 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/ee13ce369705 User: lana Date: 2015-04-01 19:53:23 +0000

              People

              • Assignee:
                mikael Mikael Vidstedt
                Reporter:
                ihse Magnus Ihse Bursie
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: