Sun Studio 12: C User's Guide

6.1 Basic Modes

The ISO C compiler allows both old-style and new-style C code. The compiler provides varying degrees of compliance to the ISO C standard when you use the following -X (note case) options with -xc99=none. -Xa is the default mode. Note that the compiler’s default mode is -xc99=all, so its behavior under each of the -X options depends on the setting of -xc99.

6.1.1 -Xc

(c = conformance) Maximally conformant ISO C, without K&R C compatibility extensions. The compiler issues errors and warnings for programs that use ISO C constructs.

6.1.2 -Xa

ISO C plus K&R C compatibility extensions, with semantic changes required by ISO C. Where K&R C and ISO C specify different semantics for the same construct, the compiler issues warnings about the conflict and uses the ISO C interpretation. This is the default mode.

6.1.3 -Xt

(t = transition) ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. Where K&R C and ISO C specify different semantics for the same construct, the compiler issues warnings about the conflict and uses the K&R C interpretation.

6.1.4 -Xs

(s = K&R C) The compiled language includes all features compatible with ISO K&R C. The compiler warns about all language constructs that have differing behavior between ISO C and K&R C.