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

[11u] Backport of 8210988 to 11u removes gcc warnings

XMLWordPrintable

    • b01
    • master
    • generic
    • generic

      The backport to 11u of JDK-8210988 contains a number of issues, the most serious of which is that all warnings are dropped from builds with gcc.

      Flags passed to gcc before JDK-8210988 include '-DLINUX -Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wformat=2 -Wunused-value -Woverloaded-virtual -Wreturn-type -fPIC'

      The same section now reads '-DLINUX -fPIC'

      This is because the section that defines WARNINGS_ENABLE_ALL, WARNINGS_ENABLE_ADDITIONAL_JVM and DISABLED_WARNINGS for gcc was skipped, but the change to WARNING_CFLAGS_JDK and WARNING_CFLAGS_JVM was made, essentially setting them to the empty string.

      There are also a few minor issues where the different flags in 11u have not been taken into account. clang gains '-Wreorder' in the move from WARNING_CFLAGS_JVM to WARNINGS_ENABLE_ADDITIONAL_JVM:

      - WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated"
      + WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder"

      compared to 12u:

      - WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual -Wreorder"
      + WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder"

      TOOLCHAIN_CFLAGS_JDK_CONLY gains a -xc99=%none:

      - TOOLCHAIN_CFLAGS_JDK_CONLY="-xCC -Xa -v -W0,-noglobal" # C only
      + TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only

      compared to

      - TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -v -W0,-noglobal" # C only
      + TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only

      in the 12u version.

            andrew Andrew Hughes
            andrew Andrew Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: