C++ User's Guide

Chapter 1 The C++ Compiler

This chapter provides a brief, conceptual overview of Sun(TM) C++ and the C++ compiler.

Standards Conformance

The C++ compiler (CC) supports the ISO International Standard for C++, ISO IS 14882:1998, Programming Language-C++. The README file that accompanies the current release describes any departures from requirements in the standard

On SPARC platforms, the compiler provides support for the optimization-exploiting features of SPARC V8, and SPARC V9, including the UltraSPARC(TM) implementation. These features are defined in the SPARC Architecture Manuals, Version 8 (ISBN 0-13-825001-4), and Version 9 (ISBN 0-13-099227-5), published by Prentice-Hall for SPARC International.

In this document, "Standard" means conforming to the versions of the standards listed above. "Nonstandard" or "Extension" refers to features that go beyond these versions of these standards.

The responsible standards bodies may revise these standards from time to time. The versions of the applicable standards to which the C++ compiler conforms may be revised or replaced, resulting in features in future releases of the Sun C++ compiler that create incompatibilities with earlier releases.

Operating Environments

The C++ compiler (CC) integrates with other Sun development tools, such as the Sun(TM) WorkShop(TM) and the C compiler. The Sun C++ compiler and its runtime library are part of the Sun(TM) Visual WorkShop(TM) C++. You can use these components to develop threaded applications in multiprocessor Solaris(TM) 2.5.1, 2.6, and in Solaris 7 operating environments.


Note -

The name of the operating environment is Solaris 7, but code and path or package path names might use Solaris 2.7 or SunOS(TM) 5.7. Always follow the code or path as it is written.


Release 5.0 of CC is available in the Solaris 2.5.1, 2.6, and Solaris 7 operating environments on SPARC(TM) and x86 devices.


Note -

Features that are unique to a particular operating environment or hardware platform are so indicated. However, most aspects of the compilers on these systems are the same, including functionality, behavior, and features. The multiprocessor features are available as part of the Sun WorkShop on the SPARC platform with Solaris 2.5.1, 2.6, and Solaris 7 software, and require a Sun WorkShop license.


See the C++ README files for details.

READMEs

The READMEs directory contains files that describe new features, software incompatibilities, bugs, and information that was discovered after the manuals were printed. The location of this directory depends on where your software was installed.

The READMEs in a standard install would appear in: /opt/SUNWspro/READMEs/

The READMEs for all compilers are easily accessed by the --xhelp=readme command-line option. For example, CC -xhelp=readme displays the C++ README file directly.

Man Pages

On-line manual (man) pages provide immediate documentation about a command, function, subroutine, or collection of such things.

Sun WorkShop man pages are located in /opt/SUNWspro/man/ after a standard install of the products. Add this path to your MANPATH environment variable to access these Sun WorkShop man pages.

You can display a man page by running the command:


demo% man topic

Throughout the C++ documentation, man page references appear with the topic name and man section number: CC(1) is accessed with man CC. Other sections, denoted by ieee_flags(3M) for example, are accessed using the --s option on the man command:


demo% man -s 3M ieee_flags

See the C++ Programming Guide for a complete list of C++ related man pages.

Licensing

The C++ compiler uses network licensing, as described in the Sun WorkShop Installation Reference.

If you invoke the compiler, and a license is available, the compiler starts. If no license is available, your request for a license is put in a queue, and your compiler continues when a license becomes available. A single license can be used for any number of simultaneous compiles by a single user on a single machine.

To run C++ and the various utilities, several licenses might be required, depending on the package you have purchased.

New Features of the C++ Compiler

The C++ compiler offers the following new features:

The C++ compiler package also includes:

C++ Utilities

The following C++ utilities are now incorporated into traditional UNIX\256 tools and are bundled with the UNIX operating system:

See Analyzing Program Performance With Sun WorkShop and associated man pages for further information on these UNIX tools.

Native-Language Support

This release of C++ supports the development of applications in languages other than English, including most European languages and Japanese. As a result, you can easily switch your application from one native language to another. This feature is known as internationalization.

In general, the C++ compiler implements internationalization as follows:

Variable names cannot be internationalized and must be in the English character set.

You can change your application from one native language to another by setting the locale. For information on this and other native-language support features, see the operating environment documentation.