1 typedef struct FILE FILE;
3 FILE* fopen (const char*, const char*);
5 int fprintf (FILE *, const char *, ...);
7 #define NULL ((void *)0)
14 for (i
= 0; i
< 2; ++i
) {
15 FILE *fp
= fopen ("/tmp/test", "w");
16 fprintf (fp
, "hello:%s ", "world");
17 fclose (fp
); /* { dg-bogus "double 'fclose'" } */
26 for (i
= 0; i
< 2; ++i
) {
27 FILE *fp
= fopen ("/tmp/test", "w");
28 fprintf (fp
, "hello");
30 } /* { dg-warning "leak of FILE 'fp'" "" { xfail *-*-* } } */
31 /* TODO: fails on some targets due to fprintf call being optimized to
32 __builtin_fwrite with a size argument (idx 2) that fails
33 gimple_builtin_call_types_compatible_p, and thus the known_function
34 for __builtin_fwrite not being used (PR middle-end/108988). */
43 for (i
= 0; i
< 2; ++i
) {
44 *fpp
= fopen ("/tmp/test", "w");
45 fprintf (*fpp
, "hello");
46 fclose (*fpp
); /* { dg-bogus "double 'fclose'" } */