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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to