Unfortunately, you cannot use a union
to substitute for a return value of an unknown type. On architectures which have floating point registers, a floating point return value is returned in a floating point register, while an integer or pointer return value is returned in a general purpose register. Usually, if the return value is a union or struct, the caller must provide a first argument pointing to a storage area (of the correct size) which the callee will fill in with the return value. (There are lots of variations. It's completely dependent on the platform ABI; what I described is (part of) the i386 ABI.)
So you really need to know the signature of the function in order to call it.