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

Buld warnings from GCC 7.1 on Fedora 26

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Resolved In Build:
      b21

      Description

      http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-July/027431.html

      I tried to build jdk10-hs on Fedora 26 with gcc-7.1.1-3.fc26.x86_64,
      then I encountered some build warnings.


      details:

      1:
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/code/dependencies.cpp:
      In static member function 'static void
      Dependencies::write_dependency_to(xmlStream*, Dependencies::DepType,
      GrowableArray<Dependencies::DepArgument>*, Klass*)':
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/code/dependencies.cpp:714:6:
      warning: '%d' directive writing between 1 and 10 bytes into a region
      of size 9 [-Wformat-overflow=]
       void Dependencies::write_dependency_to(xmlStream* xtty,
            ^~~~~~~~~~~~
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/code/dependencies.cpp:714:6:
      note: directive argument in the range [0, 2147483647]
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/code/dependencies.cpp:745:27:
      note: 'sprintf' output between 3 and 12 bytes into a destination of
      size 10
             char xn[10]; sprintf(xn, "x%d", j);
                          ~~~~~~~^~~~~~~~~~~~~~

      2:
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/logging/logFileOutput.cpp:
      In static member function 'static void
      LogFileOutput::set_file_name_parameters(jlong)':
      /home/ysuenaga/OpenJDK/jdk10-hs/hotspot/src/share/vm/logging/logFileOutput.cpp:61:99:
      warning: format not a string literal, format string not checked
      [-Wformat-nonliteral]
         res = (int)strftime(_vm_start_time_str, sizeof(_vm_start_time_str),
      TimestampFormat, &local_time);

                                  ^

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ysuenaga Yasumasa Suenaga
                Reporter:
                ysuenaga Yasumasa Suenaga
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: