Hi everybody,
I have the problem that memcpy/memmove change the pointer of a struct FOO foo
, which is neither src nor destination of the function. Here are the gdb outputs:
Before memmove(y,y_temp,size_y);
:
(gdb) p y
$38 = 0xbff7a2e0
(gdb) p y_temp
$39 = (float *) 0x815ea20
(gdb) p foo
$40 = (FOO *) 0x81d4e90
and after:
(gdb) p y_temp
$41 = (float *) 0x343434
(gdb) p y
$42 = 0x343434
(gdb) p foo
$43 = (FOO *) 0x343434
Here are the definitions of the variables:
FOO *foo;
float y[nsamples];
float size_y = nsamples*sizeof(y);
float* y_temp = (float*) malloc(size_y);
I know, that it is not a bug with memcpy/move, so I looking for a tipp, what programming error on my side could have caused it.
Thanks