Hey folks, I think this just because I'm not really familiar with C or Unsafe Rust code, but would like to make sure.
Given that I have a function that returns
*mut *mut c_void, and then cast the result of that function like so
fun().cast::<ngx_http_core_loc_conf_t>(), that turned it into a
*mut ngx_http_core_loc_conf_t instead a
*mut *mut ngx_http_core_loc_conf_t, which eventually resulted in a segfault. I fixed that by de-referencing the pointer in the function, so it now returns
*mut c_void instead, and cast returns a
*mut ngx_http_core_loc_conf_t, but this time it's actually right about that.
Is this is a bug, or have I simply failed to understand how casting pointers works? Should I have tried to cast it like this
cast::<*mut ngx_http_core_loc_conf_t>() instead? Is using
cast the right approach, or is it considered more "standard" use
as *mut *mut ngx_http_core_loc_conf_t, say?
For clarity, I've historically been a Java programmer, and this is my first foray into serious C/Rust FFI work.