1 /* PR middle-end/83373 - False positive reported by -Wstringop-overflow
3 { dg-options "-O2 -Wstringop-overflow" } */
5 typedef __SIZE_TYPE__
size_t;
11 __attribute__ ((nonnull(1, 2)))
12 inline char* my_strcpy (char* dst
, const char* src
, size_t size
)
14 size_t len
= __builtin_strlen (src
);
16 __builtin_memcpy (dst
, src
, len
+ 1);
19 __builtin_memcpy (dst
, src
, size
- 1); /* { dg-bogus "\\\[-Wstringop-oveflow]" } */
28 char data
[20] = "12345";
32 my_strcpy (buf
, data
, sizeof buf
);