[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / format-strings-pedantic.c
blob76668978fadfe16b9a22dd59e81d2a0d480ba164
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
2 // RUN: %clang_cc1 -xobjective-c -fblocks -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
3 // RUN: %clang_cc1 -xc++ -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
5 __attribute__((format(printf, 1, 2)))
6 int printf(const char *restrict, ...);
8 int main(void) {
9 printf("%p", (int *)0); // expected-warning {{format specifies type 'void *' but the argument has type 'int *'}}
10 printf("%p", (void *)0);
12 #ifdef __OBJC__
13 printf("%p", ^{}); // expected-warning {{format specifies type 'void *' but the argument has type 'void (^)(void)'}}
14 printf("%p", (id)0); // expected-warning {{format specifies type 'void *' but the argument has type 'id'}}
15 #endif
17 #ifdef __cplusplus
18 printf("%p", nullptr); // expected-warning {{format specifies type 'void *' but the argument has type 'std::nullptr_t'}}
19 #endif