A
Army1987
If uMyInt_t is an unsigned integral type, is the following a
necessary and sufficient condition that uMyInt_t has no trap
representation?
(uMyInt_t)(-1) >> CHAR_BIT*sizeof(uMyInt_t)-1
That is, I'm asking wheter it equals 0 whenever uMyInt_t has trap
representations, equals a nonzero value whenever uMyInt_t has no
trap representation, and never triggers undefined behaviour.
necessary and sufficient condition that uMyInt_t has no trap
representation?
(uMyInt_t)(-1) >> CHAR_BIT*sizeof(uMyInt_t)-1
That is, I'm asking wheter it equals 0 whenever uMyInt_t has trap
representations, equals a nonzero value whenever uMyInt_t has no
trap representation, and never triggers undefined behaviour.