http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55949
--- Comment #3 from Ryan Mansfield <rmansfield at qnx dot com> 2013-01-12 01:03:03 UTC --- (In reply to comment #2) > Looks like a bug in whatever <string.h> headers you are using. > The second parameter for __builtin_object_size for memcpy should be always 0, > not __USE_FORTIFY_LEVEL > 1 (that is used for functions like strcpy and has > the > additional restriction that the copying isn't allowed to cross array/field > boundaries). > In glibc there is > #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) > #define __bos0(ptr) __builtin_object_size (ptr, 0) > and > __extern_always_inline void * > __NTH (memcpy (void *__restrict __dest, __const void *__restrict __src, > size_t __len)) > { > return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); > } OK, thanks. I misread the object size checking docs then.