In ion, any pointer type seems to auto cast to void*, but they don't auto-cast to void**. For example, I have to cast from char** to void** here:
str: char* = NULL;
buf_push((:void**)&str, &val, 1);
Where I elsewhere have the following function:
func buf_push(b: void**, elem: void*, elem_size: usize) {
buf_fit(b, 1 + buf_len(*b), elem_size);
memcpy((:char*)*b + elem_size * buf__hdr(*b).len++, elem, elem_size);
}
If I leave out the cast, it says the following:
error: Invalid type in function call argument. Expected void**, got char**
I understand that there are bizarre edge cases for pointers on various ancient or strange systems. So maybe this is by design because of edge cases that I haven't studied well. But in my mind, this ought to work. If it should work, then it would be nice to automate it.
If it shouldn't work, then I clearly need to design the example function differently ...