Ensure void cast operates on correctly typed pointer