By reviewing the glibc sources it turns out that memmove() only does word copy. Thus, the function will not work correctly when |dst-src|<|word|. The C99 standard (section 7.21.2.2 "The memmove function") mandates: --- #include <string.h> void *memmove(void *s1, const void *s2, size_t n); The memmove function copies n characters from the object pointed to by s2 into the object pointed to by s1. Copying takes place as if the n characters from the object pointed to by s2 are first copied into a temporary array of n characters that does not overlap the objects pointed to by s1 and s2, and then the n characters from the temporary array are copied into the object pointed to by s1. ---
Nonsense, memmove takes the buffer location into account on all the supported architectures. I don't know what file you're looking at.