]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Wrestrict-19.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Wrestrict-19.c
CommitLineData
9a0cbb60
MS
1/* PR middle-end/89934 - ICE on a call with fewer arguments to strncpy
2 declared without prototype
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6typedef __SIZE_TYPE__ size_t;
7
8char *strncpy ();
9
10char* f0 (char *s)
11{
12 return strncpy ();
13}
14
15char* f1 (char *s)
16{
17 return strncpy (s);
18}
19
20char* f2 (char *s)
21{
22 return strncpy (s, s + 1); /* ICE here. */
23}
24
25void f3 (char *s, size_t n, const char *t)
26{
27 strncpy (s, n, t);
28 strncpy (n, s, t);
29}
30
31/* { dg-prune-output "\\\[-Wbuiltin-declaration-mismatch]" }
32 { dg-prune-output "\\\[-Wint-conversion]" } */