1) Use C preprocessor to replace memcpy => my_memcpy2) Write your own and be sure to link first before standard lib is linked.This should work, but not for the case where the compiler uses build-in memcpy/memset in cases like this:char a[4] = {0};But I am sure the manual might give you some hints too.