When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
dereferencing a null pointer is UB 
void test_c(struct c * v){
//^ v = NULL here
printf("c2: %p -> %p -> %p\n", &v, v, *v);
}
Okay I'm on my phone rn so i wont test
But run this woth ubsan
On something like godbolt.org
Oh wait I'm just dumb
Oh wait you probably shouldn't
But look up casting rules I guess
I don't really know C, the type system is very weird
It allows a lot of things that break stuff
also note that you are trying to print things that are not pointers with %p
casting a struct **a to a struct *a?
maybe the cast isn't UB, but de-referencing it afterwards definitely is
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity