Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / Wbuiltin-declaration-mismatch-8.c
blobd06af6528fbca5f1174f122dacc8d8dc53eb4a35
1 /* PR c/86125 - missing -Wbuiltin-declaration-mismatch on a mismatched
2 return type
3 Verify that declarations of file I/O built-ins with different
4 definitions of struct FILE triggers -Wbuiltin-declaration-mismatch
5 when -Wextra is specified.
6 { dg-do compile }
7 { dg-options "-Wall -Wbuiltin-declaration-mismatch" } */
9 struct FooFile;
10 int fputc (int, struct FooFile*);
12 typedef struct FooFile AlsoFooFile;
13 int fprintf (AlsoFooFile*, const char*, ...);
15 typedef AlsoFooFile* FooFilePtr;
16 int fscanf (FooFilePtr, const char*, ...);
18 /* No warning here (-Wextra not specified). */
19 struct BarFile;
20 int vfprintf (struct BarFile*, const char*, __builtin_va_list);
23 /* Set -Wextra and verify -Wbuiltin-declaration-mismatch is issued. */
24 #pragma GCC diagnostic warning "-Wextra"
26 int fputs (const char*, struct BarFile*); /* { dg-warning "mismatch in argument 2 type of built-in function .fputs.; expected .struct FooFile \\\*." } */