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

Fix warning "format not a string literal"

    XMLWordPrintable

Details

    • b06

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: