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

Fix warning "format not a string literal"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      Since "8030350: Enable additional compiler warnings for GCC", the hotspot build issues warnings:
      src/share/vm/compiler/compilerOracle.cpp: In function 'bool scan_line(const char*, char*, MethodMatcher::Mode*, char*, MethodMatcher::Mode*, int*, const char*&)':
      src/share/vm/compiler/compilerOracle.cpp:425: warning: format not a string literal, argument types not checked
      src/os/linux/vm/os_linux.cpp: In function 'jlong slow_thread_cpu_time(Thread*, bool)':
      src/os/linux/vm/os_linux.cpp:5316: warning: format not a string literal, argument types not checked

      Also, gccs 4.2.2 and before can not build hotspot any more. They don't know the option introduced in that change:

      cc1plus: error: unrecognized command line option "-Wno-error=format-nonliteral"

      Solution:
      Fix the warning in the hotspot code and remove the flag from the makefiles.

            goetz Goetz Lindenmaier
            goetz Goetz Lindenmaier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: