Message ID | 4F0635CE.2000604@gmail.com |
---|---|
State | New |
Headers | show |
On 01/05/12 17:44, Patrick Marlier wrote: > On Darwin, the memcpy is a macro to provide secure string operations > (FORTIFY_LEVEL > 0). I propose to remove the string.h include and add > manually the declaration. > > Tested on x86_64-apple-darwin and on x86_64-unknown-linux-gnu. > This solves PR51655. > > Patrick Marlier. > > testsuite/ChangeLog > 2012-01-05 Patrick Marlier <patrick.marlier@gmail.com> > > PR testsuite/51655 > * c-c++-common/tm/memcpy-1.c: Declare memcpy instead of > including <string.h>. This looks reasonable. Richard will have to give the approval. Thanks.
On 01/06/2012 10:44 AM, Patrick Marlier wrote: > 2012-01-05 Patrick Marlier <patrick.marlier@gmail.com> > > PR testsuite/51655 > * c-c++-common/tm/memcpy-1.c: Declare memcpy instead of > including <string.h>. Applied. r~
Index: c-c++-common/tm/memcpy-1.c =================================================================== --- c-c++-common/tm/memcpy-1.c (revision 182922) +++ c-c++-common/tm/memcpy-1.c (working copy) @@ -1,6 +1,10 @@ /* { dg-do compile } */ /* { dg-options "-fgnu-tm" } */ -#include <string.h> +typedef __SIZE_TYPE__ size_t; +#ifdef __cplusplus +extern "C" +#endif +void *memcpy (void *__restrict, const void *__restrict, size_t); __attribute__((transaction_safe)) void *wmemcpy(void *dest, const void *src, size_t n)