C++ User's Guide

-compat[=(4|5)]

Sets the major release compatibility mode of the compiler. This option controls the __SUNPRO_CC_COMPAT and __cplusplus macros.

The C++ compiler has two principal modes. The compatibility mode accepts ARM semantics and language defined by the 4.2 compiler. The standard mode accepts constructs according to the ANSI/ISO standard. These two modes are incompatible with each other because the ANSI/ISO standard forces significant, incompatible changes in name mangling, vtable layout, and other ABI details. These two modes are differentiated by the -compat option as shown in the following values.

Values

-compat=4

(Compatibility mode) Set language and binary compatibility to that of the 4.0.1, 4.1, and 4.2 compilers. 

-compat=5

(Standard mode) Set language and binary compatibility to that of the 5.0 compiler. 

Defaults

If the -compat option is not specified, -compat=5 is assumed.

If only -compat is specified, -compat=4 is assumed.

Regardless of the -compat setting, _ _SUNPRO_CC is set to 0x500.

Interactions

This option controls the preprocessor __SUNPRO_CC_COMPAT=(4|5) macro.

The -xarch=v9 and the -compat[=4] options are not supported when used together.

See also

C++ Migration Guide