- 1 -
6.0 C++ Compiler Release Notes
- 2 -
________________________________________________
Contributors:
Engineering contributions by John Wilkinson, Andy Palay, Shankar Unni,
Michey Mehta, Anil Pal, Ravi Shankar, Roy Mittendorff, Rune Dahl and
Chandrasekhar Murthy
________________________________________________
c Copyright 1992-1994, Silicon Graphics, Inc. - All rights reserved
This document contains proprietary information
of Silicon Graphics, Inc. The contents of this
document may not be disclosed to third parties,
copied, or duplicated in any form, in whole or
in part, without the prior written permission of
Silicon Graphics, Inc.
Restricted Rights Legend
Use, duplication, or disclosure of the technical
data contained in this document by the
Government is subject to restrictions as set
forth in subdivision (c) (1) (ii) of the Rights
in Technical Data and Computer Software clause
at DFARS 52.227-7013, and/or in similar or
successor clauses in the FAR, or the DOD or NASA
FAR Supplement. Unpublished rights reserved
under the Copyright Laws of the United States.
Contractor/manufacturer is Silicon Graphics,
Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
6.0 C++ Compiler Release Notes
- 3 -
Document Number 007-1606-010
Silicon Graphics, Inc.
Mountain View, California
Silicon Graphics and IRIS are registered
trademarks and IRIX, Graphics Library, IRIS
POWER Series, and Personal IRIS are trademarks
of Silicon Graphics, Inc.
1. Introduction
The Silicon Graphics C++ Compiler is an
environment for compiling programs written in
the C++ programming language. This environment
allows access to standard IRIX features and to
the Graphics Library.
NOTE: This release of the compiler is based on a
new C++ compiler frontend from the Edison
Design Group. There are really two
compilers: a 32-bit version, which is
invoked when any of the options -32,
-mips1, or -mips2 is specified on the
command line; and a 64-bit version, which
is invoked otherwise. The 32-bit version
is based on release 2.19 of the Edison
frontend; the 64-bit versions is based on
relase 2.22. The old frontend, based on
release 3.0.1 of the USL C++ Translator,
is also available by specifying the
options -32 -use_cfront.
Please read Chapter 3 carefully for a
description of the differences between the old
compiler and the new one, especially section 3.4
that deals with the new template instantiation
mechanism.
The C++ Compiler product includes:
o CC, the C++ compiler driver (not to be
confused with cc).
o fecc, the 64-bit C++ compiler frontend.
o edgcpfe, the 32-bit C++ compiler frontend.
o The utilities edg_prelink, c++patch and
c++filt.
- 4 -
o For users wishing to use the old frontend,
cfront, a language translator for C++-to-C
translation, and the utilities markc++,
ptcomp, and ptlink.
o The libraries libcomplex.a, and
libmangle.a.
o Include files specific to C++.
o Online manual page for CC(1).
o Online release notes for CC(1).
o C++ Programmer's Guide, which includes the
hard-copy CC(1) manual page.
The C++ library /usr/lib/libC.so is installed in
the subsystem c++_eoe.sw.lib. This allows
application libraries written in C++ to be used
on systems that do not have C++ installed. Note
that this library is now a dynamic shared object
and is not an archive. There is also a non-
shared archive form of the library,
/usr/lib/nonshared/libC.a.
Note: Packaged with this software is a separate
sheet that contains the Software License
Agreement. This software is provided to
you solely under the terms and conditions
of the Software License Agreement.
Please take a few moments to review the
Agreement.
This document contains the following chapters:
1. Introduction
2. Installation Information
3. New Features for This Release
4. Known Problems and Workarounds
1.1 Release_Identification_Information_
Following is the release identification
information for 6.0 C++ Compiler.
C++ Compiler
- 5 -
Software Option Product
- 6 -
Version 6.0
Product Code SC4-C++-6.0
Software Requirements IRIX 6.0
IRIS Development
Option 6.0
1.2 Online_Release_Notes
After you install the online documentation for a
product (the relnotes subsystem), you can view
the release notes on your screen.
If you have a graphics system, select ``Release
Notes'' from the Tools submenu of the Toolchest.
This displays the grelnotes(1) graphical browser
for the online release notes. Refer to the
grelnotes(1) man page for information on options
to this command.
If you do not have a graphics system, you can
use the relnotes command. Refer to the
relnotes(1) man page for accessing the online
release notes.
1.3 Product_Support
Silicon Graphics, Inc., provides a comprehensive
product support maintenance program for its
products.
If you are in the U.S. or Canada and would like
support for your Silicon Graphics-supported
products, contact the Technical Assistance
Center at 1-800-800-4SGI.
If you are outside the U.S. or Canada, contact
the Silicon Graphics subsidiary or authorized
distributor in your country.
- 1 -
6.0 C++ Compiler Release Notes
- 2 -
________________________________________________
Contributors:
Engineering contributions by John Wilkinson, Andy Palay, Shankar Unni,
Michey Mehta, Anil Pal, Ravi Shankar, Roy Mittendorff, Rune Dahl and
Chandrasekhar Murthy
________________________________________________
c Copyright 1992-1994, Silicon Graphics, Inc. - All rights reserved
This document contains proprietary information
of Silicon Graphics, Inc. The contents of this
document may not be disclosed to third parties,
copied, or duplicated in any form, in whole or
in part, without the prior written permission of
Silicon Graphics, Inc.
Restricted Rights Legend
Use, duplication, or disclosure of the technical
data contained in this document by the
Government is subject to restrictions as set
forth in subdivision (c) (1) (ii) of the Rights
in Technical Data and Computer Software clause
at DFARS 52.227-7013, and/or in similar or
successor clauses in the FAR, or the DOD or NASA
FAR Supplement. Unpublished rights reserved
under the Copyright Laws of the United States.
Contractor/manufacturer is Silicon Graphics,
Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
6.0 C++ Compiler Release Notes
- 3 -
Document Number 007-1606-010
Silicon Graphics, Inc.
Mountain View, California
Silicon Graphics and IRIS are registered
trademarks and IRIX, Graphics Library, IRIS
POWER Series, and Personal IRIS are trademarks
of Silicon Graphics, Inc.
2. Installation_Information
This chapter lists supplemental information to
the IRIS Software Installation Guide. The
information listed here is product-specific; use
it with the installation guide to install this
product.
2.1 C++_Compiler_Subsystems
Following is a description of the C++ Compiler
subsystems:
c++_dev.sw.c++ The C++ compiler
c++_dev.sw.lib C++ demangling and
complex libraries
c++_dev.sw.libns Non_shared C++
runtime library
c++_dev.hdr.lib Standard C++
header files
c++_dev.man.c++ Man pages for C++
and the standard
C++ header files
c++_dev.man.relnotes These release
notes
c++_dev.books.c++LangSysOverview C++ Language
System Overview
c++_dev.books.c++Lang_System_Lib C++ Language
System Library
c++_dev.books.C++Product_Ref The C++ Language
System Product
Reference Manual
- 4 -
c++_dev.books.c++_PG C++ Language
System
Programmer's Guide
2.2 C++_Compiler_Subsystem_Disk_Use
This section lists the subsystems (and their
sizes) of the C++ Compiler option.
If you are installing this option for the first
time, the subsystems marked ``default'' are
those that are installed if you use the ``go''
menu item. To install a different set of
subsystems, use the ``install,'' ``remove,''
``keep,'' and ``step'' commands to customize the
list of subsystems to be installed, then select
the ``go'' menu item.
Subsystem Name Subsystem Size
(512-byte blocks)
c++_dev.sw.c++ (default) 7916
c++_dev.sw.lib (default) 1340
c++_dev.sw.libns (default) 396
c++_dev.hdr.lib (default) 97
c++_dev.man.c++ (default) 449
c++_dev.man.relnotes (default) 152
c++_dev.books.C++LangSysOverview 3384
c++_dev.books.C++Lang_System_Lib 1152
c++_dev.books.C++Product_Ref 3285
c++_dev.books.C++_PG 478
2.3 Installation_Method
All of the subsystems for the C++ Compiler can
be installed using inst from IRIX.
The procedure for installing the CROSS64
development option (to be installed from the 6.0
IDO CD-ROM onto a machine running 5.2 IRIX) is
specialized. For the details of this procedure,
consult the 6.0 IRIX Development Option release
notes. For information about using the CROSS64
development option, see the release notes for
the 6.0 Baae Compiler Development Option.
- 5 -
2.4 Compatibility
2.4.1 Compatibility_with_C++_3.2.1
The C++ 6.0 compiler operating in 32-bit mode is
fully link-compatible with code compiled with
C++ 3.2.1, with the following exceptions:
2.4.1.1 Signed_char_parameters
Due to a bug in C++ 3.2.1, signed char
parameters were mangled into the function name
as plain char. If you have such a function, and
the caller and callee are compiled with
different compilers (3.2.1 versus 6.0), the
resultant program will not link. To fix this,
change the parameter type to a plain char, or
recompile both caller and callee with the same
compiler.
2.4.1.2 Stricter_error_checking_than_3.2.1
The C++ 6.0 compiler is much stricter in its
enforcement of the C++ language as described by
the The Annotated C++ Reference Manual (Margaret
Ellis and Bjarne Stroustrup, Addison-Wesley
1990), far more so than even C++ 3.2.1. Some
code changes may be required to correct
previously uncaught errors in the code.
2.4.1.3 Template_mechanism_differences
The template instantiation mechanism is quite
different in the two compilers. Normally, this
is hidden from the user, at least for
straightforward links. However, the use of
archives and DSOs (Shared Libraries) exposes
this mechanism to the user, and Makefiles will
have to be migrated to move from C++ 3.2.1 to
C++ 6.0.
Please see Chapter 5, on Templates, for the
pitfalls in mixing 3.2.1 and 6.0 compiled
objects with templates, and the steps required
for migrating to the new compiler.
- 6 -
2.4.2 Compatibility_with_C++_2.1.1
Some source code that compiled correctly under
C++ 2.1.1 must be changed to compile under C++
6.0, and some code compiled under C++ 2.1.1 must
be recompiled to link successfully with code
compiled under C++ 6.0. The following sections
list the differences between version 3.x and
version 2.1.1 that affect compatibility:
2.4.2.1 Nested_Classes
C++ versions 3.0 and later support true nesting
of classes, enumerations, and unions, as
specified in the C++ Product Reference Manual.
An enumeration declared within a class, for
example, is not recognized outside the class
declaration unless it is qualified by the class
name. For example:
class X {
enum E {...
};
E e; // OK in 2.1.1; error in 3.0 or later; should be X::E e;
2.4.2.2 Stricter_Error_Checking
C++ 3.0 and later enforce the The Annotated C++
Reference Manual (Margaret Ellis and Bjarne
Stroustrup, Addison-Wesley 1990) more strictly
than C++ 2.1.1 did, so some code that does not
conform to the ARM and that compiled under C++
2.1.1 might fail to compile under C++ 3.0 and
later.
2.4.2.3 Linkage_Directives
The #pragma linkage directive is no longer
supported.
2.4.3 Compatibility_with_C++_3.0
2.4.3.1 Header_Files
The header files /usr/include/CC/osfcn.h and
/usr/include/CC/libc.h used to contain
prototypes for standard IRIX functions. These
files now consist entirely of #include
directives. This should improve compatibility
across releases. On the other hand, it results
- 7 -
in including prototypes for many more functions,
and might cause new name-space collisions in
some cases.
2.4.3.2 No_C++-2.1_Compatibility_Mode
The -v2 option is no longer supported. All
source code must now conform to the syntax and
semantics of C++ 3.x as defined in the C++
Product Reference Manual.
2.4.4 Compatibility_with_C++_3.1
2.4.4.1 Overloaded increment and decrement
operators
The overloaded increment and decrement operators
are now supported in both prefix and suffix form
as described in the ARM. As a result, the
suffix forms now require an extra int parameter
in their prototypes. For example:
class C {
public:
C& operator++(); // should be operator++(int)
};
main()
{
C c;
...
c++; // Accepted by version 3.1 but not by version 3.2 or 6.0
}
2.5 C++_Compiler_Files
After installing the C++ Compiler, you should
have the following files:
/usr/bin/CC C++ compiler
driver
/usr/lib/64bit/cmplrs/fecc The 64-bit
compiler
frontend
/usr/lib/64bit/cmplrs/be The 64-bit
compiler
backend
- 8 -
/usr/lib/DCC/edgcpfe The 32-bit
compiler
frontend
/usr/lib/DCC/edg_prelink The "prelinker"
which controls
template
instantiation.
/usr/lib/c++/c++patch C++ post-
processor
/usr/include/CC C++ include
file directory
/usr/lib/libcomplex.a C++ complex
math library
/usr/lib/c++/libmangle.a C++ name-
demangler
library
/usr/lib/c++/c++filt C++ name-
demangling
utility
/usr/catman/u_man/cat1/CC.z C++ compiler
driver manual
page
/usr/relnotes/CC C++ Release
Notes directory
/usr/lib/c++/cfront The old C++
Translator, for
use with
-use_cfront
/usr/lib/c++/markc++ The old utility
to identify C++
files for
dbx(1)
/usr/lib/c++/ptcomp Old tool for
Template
support for
cfront
/usr/lib/c++/ptlink Old tool for
Template
support for
- 9 -
cfront
Note that the C++ library /usr/lib/libC.so is
installed from the subsystem c++_eoe.sw.lib.
This allows application libraries written in C++
to be used on systems that do not have C++
installed.
2.6 C++_Compiler_Documentation
Silicon Graphics has produced the following C++
Compiler documentation:
o CC(1) man page (printed and online version)
o 6.0 C++ Release Notes (this online
document)
- 1 -
6.0 C++ Compiler Release Notes
- 2 -
________________________________________________
Contributors:
Engineering contributions by John Wilkinson, Andy Palay, Shankar Unni,
Michey Mehta, Anil Pal, Ravi Shankar, Roy Mittendorff, Rune Dahl and
Chandrasekhar Murthy
________________________________________________
c Copyright 1992-1994, Silicon Graphics, Inc. - All rights reserved
This document contains proprietary information
of Silicon Graphics, Inc. The contents of this
document may not be disclosed to third parties,
copied, or duplicated in any form, in whole or
in part, without the prior written permission of
Silicon Graphics, Inc.
Restricted Rights Legend
Use, duplication, or disclosure of the technical
data contained in this document by the
Government is subject to restrictions as set
forth in subdivision (c) (1) (ii) of the Rights
in Technical Data and Computer Software clause
at DFARS 52.227-7013, and/or in similar or
successor clauses in the FAR, or the DOD or NASA
FAR Supplement. Unpublished rights reserved
under the Copyright Laws of the United States.
Contractor/manufacturer is Silicon Graphics,
Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
6.0 C++ Compiler Release Notes
- 3 -
Document Number 007-1606-010
Silicon Graphics, Inc.
Mountain View, California
Silicon Graphics and IRIS are registered
trademarks and IRIX, Graphics Library, IRIS
POWER Series, and Personal IRIS are trademarks
of Silicon Graphics, Inc.
3. New_Features_for_This_Release
This chapter lists the changes to the C++
compiler from the previous version (3.2.1) of
this compiler. Section 3.5 has a very brief
summary of the additions from C++ 2.1.1 to C++
3.2.1 and C++ 6.0.
3.1 New_Native_C++_Compiler
C++ 6.0 is a new native C++ compiler for Irix
6.0. This compiler is based on a different
frontend (one from the Edison Design Group) than
the previous releases (which were based on USL's
cfront), and bypasses the generation of C
intermediate code.
Among the changes to be expected in this
compiler are:
o Much tighter error checking than cfront
(see section 3.2 below).
o A couple of obscure link compatibility
changes (related to name mangling - see
section 3.3 below).
o A different template instantiation
mechanism, which has less overhead and is
easier to use with libraries. (see section
3.4 below).
NOTE: The previous compiler (the Cfront-based
translator that was shipped with C++ 3.2.1)
is still available in this release, by
specifying the -use_cfront and -32 options
to CC, or by setting the environment
variable USE_CFRONT to 1 before executing
the compiler and specifying the -32 option.
- 4 -
Thus, users who need to continue compiling with
the old Translator can do so by globally setting
this environment variable for their builds.
Also, in case of specific incompatibilities (see
section 3.3 below) that cannot be worked around,
individual compilation units can be compiled
with the old translator by using the -use_cfront
option to get the old name mangling for those
types.
WARNING: We are only continuing to ship the old
translator as a way to allow a phased
migration to the new compiler. In a
future release of this compiler, the
translator will be removed.
- 5 -
3.2 Source Compatibility with C++ 3.2.1
(tighter error checking)
Source changes may be necessitated if your C++
source code contains any of several errors not
caught by C++ 3.2.1.
In each of the sections below, the errors shown
are not caught by C++ 3.2.1 (known as Cfront in
the text below), but are caught by C++ 6.0.
3.2.1 //_Comments_ending_in_a_\
There is a serious bug in preprocessor in C++
3.2.1, where C++-style comments ending in a "\"
are not continued to the next line.
If you depend on this bug, and have "real" code
in the line following such a line, C++ 6.0 will
treat this line as a part of the preceding
comment, causing syntax errors in the best case,
and obscure runtime bugs in the worst case.
For example, the following code will have a very
hard-to-detect bug:
...
// Increment the counter \
i++; // silently swallowed by C++ 6.0
...
The workaround is to remove the trailing "\" in
the // comment. A good way to scan for such
errors is to run the following command on your
source files:
% grep '//.*\\\\$'