|
|
Only in the transition (-Xt) and K&R modes (-Xk) mode will the ANSI C compiler use the unsigned preserving promotions; in the other three modes, the value preserving promotion rules will be used. The compiler will warn you about each expression whose behavior might depend on the promotion rules used at compiler warning output levels at or above -W2.
This warning is not optional since this is a serious change in behavior.
Fortunately, these situations do not often occur,
and it is always possible to suppress the warning by
making the intended behavior explicit, as is shown below.