Sun Studio 12: C++ User's Guide

A.2.7.1 Values

The -compat option can have the following values.

Value 

Meaning  

–compat=4

(Compatibility mode) Set language and binary compatibility to that of the 4.0.1, 4.1, and 4.2 compilers. Set the __cplusplus preprocessor macro to 1 and the __SUNPRO_CC_COMPAT preprocessor macro to 4.

–compat=5

(Standard mode) Set language and binary compatibility to ANSI/ISO standard mode. Set the __cplusplus preprocessor macro to 199711L and the __SUNPRO_CC_COMPAT preprocessor macro to 5.

Defaults

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

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

Interactions

You cannot use the standard libraries in compatibility mode (-compat[=4]).

Use of –compat[=4] with any of the following options is not supported.

Use of –compat=5 with any of the following options is not supported.

Warnings

When building a shared library do not use -Bsymbolic.

See also

C++ Migration Guide