fix strict-aliasing warnings by using unions