Dereferencing a non returned function ?

What happens if I have a pointer

variable = pointer -> function();

where function() didn't return anything? would it cause a crash?
It causes a syntax error because the function is a void().
No I mean say the function normally returns something like an object pointer but there is a bug and it didn't. If this was running in real time would it cause the program to crash?
What do you mean? Computers are always accurate.
This is for like a embedded system where there are tons of possibilities. Say if I had a variable = pointer -> function() and function was suppose to return an item from say a list, but there was an error and it was out of bounds and it didn't have a default case for this case (no return here), what would happen, would it crash if there were no error checks? It still compiles and I will fix it but I want to know what would happen if in real time it went into that case since it still compiled but just gave a warning.
Last edited on
Does it terminate the program if there is nothing catching the error or error check for this?
Topic archived. No new replies allowed.