[LLVMbugs] [Bug 14936] New: Improve wording for some cases of -Wformat-nonliteral

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 12 14:44:36 PST 2013


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

             Bug #: 14936
           Summary: Improve wording for some cases of -Wformat-nonliteral
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: gribozavr at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


#include <stdarg.h>

int vprintf(const char *restrict, va_list);

__attribute__((__format__ (__scanf__, 1, 3)))
void z(const char* s, char *buf, ...) {
  va_list ap;
  va_start(ap,buf);

  vprintf(s,ap);
}

$ ./bin/clang -Wformat-nonliteral /tmp/z.c
/tmp/z.c:10:11: warning: format string is not a string literal
[-Wformat-nonliteral]
  vprintf(s,ap);
          ^

That is certainly correct, but it is not really the issue here.  The issue is
that we are passing a scanf format string and args to vprintf.

-- 
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