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

Format warning in traceStream.hpp

XMLWordPrintable

    • b15
    • x86
    • os_x

        (From Staffan Larsen:)

        BTW, I got compilation errors with Xcode 4.6.3 when compiling only the OpenJDK code:

        /Users/staffan/mercurial/jdk9-hs-rt/hotspot/src/share/vm/trace/traceStream.hpp: In member function ‘void TraceStream::print_val(const char*, s8)’:
        /Users/staffan/mercurial/jdk9-hs-rt/hotspot/src/share/vm/trace/traceStream.hpp:69: warning: format ‘%lld’ expects type ‘long long int’, but argument 4 has type ‘s8’

        Configure flags were:
        configure --disable-zip-debug-info --with-debug-level=release --with-jobs=7 --with-conf-name=openjdk-release --enable-openjdk-only


        I think this is a fix:

        diff --git a/src/share/vm/trace/traceStream.hpp b/src/share/vm/trace/traceStream.hpp
        --- a/src/share/vm/trace/traceStream.hpp
        +++ b/src/share/vm/trace/traceStream.hpp
        @@ -66,7 +66,7 @@
          }

          void print_val(const char* label, s8 val) {
        - _st.print("%s = "INT64_FORMAT, label, val);
        + _st.print("%s = "INT64_FORMAT, label, (int64_t) val);
          }

              drchase David Chase (Inactive)
              drchase David Chase (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: