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

Fix for 8036122 breaks build with Xcode5/clang

    XMLWordPrintable

Details

    • b15

    Backports

      Description

        Fix for JDK-8036122 removed -Wno-format-nonliteral, which cause build with Xcode5 or clang to fail because clang has more strict rule with format than GCC,

        Quoted from http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html,

        "-Wformat-nonliteral
        If -Wformat is specified, also warn if the format string is not a string literal and so cannot be checked, unless the format function takes its format arguments as a va_list."

        As for clang, quoted from http://clang.llvm.org/docs/AttributeReference.html?highlight=wformat#format-gnu-format,

        "Clang checks that the format string argument is a literal string. This is the -Wformat-nonliteral warning, it is off by default.

        Clang implements this mostly the same way as GCC, but there is a difference for functions that accept a va_list argument (for example, vprintf). GCC does not emit -Wformat-nonliteral warning for calls to such fuctions. Clang does not warn if the format string comes from a function parameter, where the function is annotated with a compatible attribute, otherwise it warns."

        Attachments

          Issue Links

            Activity

              People

                drchase David Chase (Inactive)
                henryjen Henry Jen
                Votes:
                1 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: