absurd
unread,Jul 12, 2012, 11:27:28 AM7/12/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
I have the following simple code.
#include <string.h>
int main()
{
char dst[50];
char src[50];
memcpy(dst, src, 50);
return dst[1];
}
When I use gcc to compile it without any optimization, I can see a function call to memcpy is in the executable (with objdump). With optimization, the memcpy seems to be inlined.
I checked string.h. It has only the declaration of memcpy, not implementation. The implementation is in glibc. My understanding is in order to inline, gcc has to see the function implementation when it compiles. How does the gcc inline memcpy here ? Does it have special treatment to the functions in the standard library ?
Thanks.
}