I have code that looks like this :
Foo* create(args) {
Foo *t = malloc (sizeof (Foo)) ;
// Fill up fields in struct t from args.
return t;
}
The call is
Foo *created = create (args)
Note that the function and the call to the function are two separate modules.
The value of the pointer assigned to t
on being malloc
ed is slightly different to what is captured in created
. Seemingly the MSB of the address is changed and replaced with fffff
. The LSB portion is the same for around 6-7 characters.
I'm at a loss as to what's going on. I'm using GCC 4.6