[LLVMbugs] [Bug 20963] New: Spurious warning from Wformat-extra-args

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 16 14:04:18 PDT 2014


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

            Bug ID: 20963
           Summary: Spurious warning from Wformat-extra-args
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hyc at symas.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

violino:/tmp/clang> cat bug.c
#include <stdio.h>

int main(int argc, char *argv[]) {
    printf(argc > 1 ? "%s %s\n" : "%s\n", argv[0], argv[1]);
}

violino:/tmp/clang> clang -c bug.c
bug.c:4:47: warning: data argument not used by format string
[-Wformat-extra-args]
        printf(argc > 1 ? "%s %s\n" : "%s\n", argv[0], argv[1]);
                                      ~~~~~~           ^
1 warning generated.

gcc (correctly) does not complain.

-- 
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/20140916/23ab03bc/attachment.html>


More information about the llvm-bugs mailing list