Debian Codegraph @

gcc/testsuite/g++.dg/opt/builtins1.C

raw
1 // PR c++/14791
2 // Test if builtins with FILE * arguments work
3 // { dg-options "-O2 -Wformat" }
4
5 typedef struct _FILE FILE;
6 FILE *stderr;
7 extern "C" int printf (__const char *__restrict, ...);
8 extern "C" int fprintf (FILE *__restrict, __const char *__restrict, ...);
9
10 int main ()
11 {
12 printf ("%d\n", 1, 1); // { dg-warning "too many arguments for format" }
13 fprintf (stderr, "%d\n", 1, 1); // { dg-warning "too many arguments for format" }
14 }