mask off unused bits for compilers that range check casts