[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / implicit-builtin-decl.c
blob3a3b3ed7d47dac3f28d69b63df4bcc9d4e18736c
1 // RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s
3 void f() {
4 int *ptr = malloc(sizeof(int) * 10); // expected-warning{{implicitly declaring library function 'malloc' with type}} \
5 // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for 'malloc'}} \
6 // expected-note{{'malloc' is a builtin with type 'void *}}
9 void *alloca(__SIZE_TYPE__); // redeclaration okay
11 int *calloc(__SIZE_TYPE__, __SIZE_TYPE__); // expected-warning{{incompatible redeclaration of library function 'calloc'}} \
12 // expected-note{{'calloc' is a builtin with type 'void *}}
15 void g(int malloc) { // okay: these aren't functions
16 int calloc = 1;
19 void h() {
20 int malloc(int); // expected-warning{{incompatible redeclaration of library function 'malloc'}}
21 int strcpy(int); // expected-warning{{incompatible redeclaration of library function 'strcpy'}} \
22 // expected-note{{'strcpy' is a builtin with type 'char *(char *, const char *)'}}
25 void f2() {
26 fprintf(0, "foo"); // expected-warning{{declaration of built-in function 'fprintf' requires inclusion of the header <stdio.h>}} \
27 expected-warning {{implicit declaration of function 'fprintf' is invalid in C99}}
30 // PR2892
31 void __builtin_object_size(); // expected-error{{conflicting types}} \
32 // expected-note{{'__builtin_object_size' is a builtin with type}}
34 int a[10];
36 int f0() {
37 return __builtin_object_size(&a); // expected-error {{too few arguments to function}}
40 void * realloc(void *p, int size) { // expected-warning{{incompatible redeclaration of library function 'realloc'}} \
41 // expected-note{{'realloc' is a builtin with type 'void *(void *,}}
42 return p;
45 // PR3855
46 void snprintf(); // expected-warning{{incompatible redeclaration of library function 'snprintf'}} \
47 // expected-note{{'snprintf' is a builtin}}
49 int
50 main(int argc, char *argv[])
52 snprintf();
55 void snprintf() { }
57 void longjmp();
59 extern float fmaxf(float, float);
61 struct __jmp_buf_tag {};
62 void sigsetjmp(struct __jmp_buf_tag[1], int);
64 // PR40692
65 void pthread_create(); // no warning expected