Alright here’s the code:
//in another file
void **ptr; ptr = kmalloc(sizeof(void *) * 2);
*(ptr+0) = tf; //type trapframe *
*(ptr+1) = as; //type addrspace *
func(*ptr);
And here is that function:
void func(void *ptr) {
struct trapframe *parentTF = ptr[0];
struct addrspace *newAS = ptr[1];
//now I wanna do stuff with parentTF and newAS
}
And the error I get is:
warning: dereferencing `void *' pointer
Thanks for any help.
If I’m correctly understanding what you’re trying to do, it seems like you need to change this:
to this:
and this:
to this:
Note that
*(ptr+0)andptr[0]are synonymous, as are*(ptr+1)andptr[1].