1) uninitialized variable of primitive types — contains rubbish
2) uninitialized pointer — very dangerous.
We are treating rubbish as an address! This address may happen to be Inside or Outside this process’s address space.
Read/write on this dereferenced pointer can lead to crashes. See P161 [[understanding and using C pointers]].
There are third-party tools to help identify uninitialized pointers. I think it’s by source code analysis. If function3 receives an uninitialized pointer it would look completely normal to the compiler or runtime.
3) uninitialized class instance? Possible. Every class instance in c++ will have its memory layout well defined, though a field therein may fall into category 1) or 2) above.
4) uninitialized array of pointers could hold wild pointers