use unions to deal with const pointer casting