DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Complying with standard C

Compilation behavior

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.


Next topic: First example: using a cast
Previous topic: Background

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003