This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A question about memcpy


This is the wrong list for such questions. In the future, please use gcc-help, thanks.

On Nov 1, 2005, at 10:38 PM, Eric Fisher wrote:
When I compile such c codes as following,
int a=0xffffffff,i;
int sra[32]={0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,
0xfffffffa,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff};
the compiler will come out the error message like undefined reference
to `memcpy'.

Ok.


Can you where is the memcpy?

You will find the call to memcpy in the .s file the compiler generates. To find it on your OS, please consult yout OS documentation. /usr/lib/libc.a is such a place on some systems. If you are using newlib'/libgloss, you can find it in there. If you're using glibc, you can find it in there.


And how the compiler call this funcion implicitly?

This is an optimization the compiler performs.


Need I implement it?

Only if you want to run your code.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]