PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / Wvarargs-2.c
bloba6b51f19e603b7027196a2c77f09c4967a11c595
1 /*
2 { dg-options "-Wno-varargs" }
3 { dg-do compile }
4 */
6 #include <stdarg.h>
8 void
9 err (int a)
11 va_list vp;
12 va_start (vp, a); // { dg-error "used in function with fixed args" }
15 void
16 foo0 (int a, int b, ...)
18 va_list vp;
19 /* 'a' is not the last argument of the enclosing function, but
20 don't warn because we are ignoring -Wvarargs. */
21 va_start (vp, a);
22 va_end (vp);
25 void
26 foo1 (int a, register int b, ...) // { dg-warning "ISO C\\+\\+17 does not allow 'register' storage class specifier" "" { target c++17 } }
28 va_list vp;
29 /* 'b' is declared with register storage, but don't warn
30 because we are ignoring -Wvarargs. */
31 va_start (vp, b);
32 va_end (vp);