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

Fixes for warning "format not a string literal"

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b93

      The gcc build has -Wformat enabled. This warns if the format string in a printf-like function is not a string literal, because if so it can not check that the types of the arguments match the format specifiers.

      In a row of places this warning is suppressed by a PRAGMA.

      This change fixes all but three occurrences of PRAGMA_FORMAT_NONLITERAL_IGNORED

      This especially improves heapInspection.hpp where a static buffer is used to print the format string, which is not multithreading safe.

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

              Created:
              Updated:
              Resolved: