Mike Stump - Re: A question about memcpy (original) (raw)
This is the mail archive of the gcc@gcc.gnu.orgmailing 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] |
- From: Mike Stump
- To: Eric Fisher
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 2 Nov 2005 00:55:17 -0800
- Subject: Re: A question about memcpy
- References: <d6afecde0511012238u7941f262j@mail.gmail.com>
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.
- References:
- A question about memcpy
* From: Eric Fisher
- A question about memcpy
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |