Fixing warning using reinterpret_cast by switching to union