1 /* PR middle-end/93926 - ICE on a built-in redeclaration returning an integer
4 { dg-options "-Wall" } */
6 typedef __SIZE_TYPE__
size_t;
8 void* ret_calloc (size_t n1
, size_t n2
)
10 extern size_t calloc (size_t, size_t); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
12 return (void *) calloc (n1
, n2
);
15 void* ret_malloc (size_t n
)
17 extern size_t malloc (size_t); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
19 return (void *) malloc (n
);
22 void* ret_realloc (void *p
, size_t n
)
24 extern size_t realloc (void *p
, size_t); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
26 return (void *) realloc (p
, n
);
29 void* ret_strdup (const char *s
)
31 extern size_t strdup (const char*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
33 return (void *) strdup (s
);
36 void* ret_strndup (const char *s
, size_t n
)
39 strndup (const char*, size_t); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
41 return (void *) strndup (s
, n
);
44 // For good measure also exerise strcmp return type (not part of the bug).
46 char* ret_strcmp (const char *s
, const char *t
)
49 strcmp (const char*, const char*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
54 // Exercise warnings for pointer/integer mismatches in argument types
55 // (also not part of the bug).
57 char* ret_strcat (size_t s
, const char *t
)
60 strcat (size_t, const char*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
65 char* ret_strcpy (char *s
, size_t t
)
67 extern char* strcpy (char*, size_t); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
72 char* ret_strncpy (char *s
, const char *t
, size_t n
)
75 strncpy (char*, size_t, const char*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch" }
77 return strncpy (s
, n
, t
);