[LLVMbugs] [Bug 18631] New: -Wformat '*' precision shortcuts format checking

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 27 10:08:44 PST 2014


            Bug ID: 18631
           Summary: -Wformat '*' precision shortcuts format checking
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: seth.cantrell at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The Code:

#include <stdio.h>
void f() {
  printf("%.*f%f%f%f", 1., 1, 1, 1, 1);

Produces only a single warning:

main.cpp:3:13: warning: field precision should have type 'int', but argument
has type 'double' [-Wformat]
  printf("%.*f%f%f%f", 1., 1, 1, 1, 1);
          ~~^~         ~~
1 warning generated.

The '*' related error is checked first and prevents the format from being
checked any further. The format checker should not stop, but should continue to
find all the errors it can.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140127/e7695b22/attachment.html>

More information about the llvm-bugs mailing list