[LLVMbugs] [Bug 14935] New: Overzealous -Wformat-nonliteral warns for va_list functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 12 13:10:14 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14935

             Bug #: 14935
           Summary: Overzealous -Wformat-nonliteral warns for va_list
                    functions
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: gribozavr at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


>From test/Sema/format-strings.c:

vprintf(s,ap); // expected-warning {{format string is not a string literal}}

Is this intentional?  Most of the time vprintf() and other v*() calls that take
a va_list will have a non-literal format string (that came from the same source
as the va_list).

So essentially, most of -Wformat-nonliteral warnings for va_list functions is
just noise.

And, GCC intentionally does not warn in this case.

See http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Warning-Options.html

Should we move warnings for va_list case under a separate flag or just silence
them altogether?

(This was reported on the IRC)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list