Re: [Cppunit-devel] Re: [ cppunit-Bugs-464844 ] Comp. warnings & errors - rel 1.6.0
Brought to you by:
blep
From: Stanley S. <su...@t-...> - 2001-09-30 18:03:38
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta http-equiv="Content-Type" content= "text/html; charset=iso-8859-1"> <meta name="LAST-MODIFIED" content="00/08/28"> <meta name="DESCRIPTION" content="Sun WorkShop Component Readme"> <meta name="KEYWORDS" content= "readme, documentation, publication,"> <meta name="GENERATOR" content= "Mozilla/4.04 [en] (X11; I; SunOS 5.5.1 sun4u) [Netscape]"> <title>Sun WorkShop(TM) Compilers C++ 6 update 1 Readme</title> </head> <body bgcolor="#FFFFFF"> <table border="0" cellpadding="0" width="98%"> <tr> <td align="right"><i><font size="-1">Updated 00/08/28</font></i></td> </tr> </table> <table border="0" cellpadding="6" width="100%"> <tr> <td bgcolor="#666699"><font face="Arial,Helvetica"><font color= "#FFFFFF"><font size="+4">Sun WorkShop(TM) Compilers C++ 6 update 1 Readme</font></font></font></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="10%"> </td> <td> <font size="+2">Contents </font> <ol type="A"> <li><a href="#introduction">Introduction</a></li> <li><a href="#about">About the Sun WorkShop 6 update 1 C++ Compiler (5.2)</a></li> <li><a href="#corrections">Software Corrections</a> </li> <li><a href="#problems">Problems and Workarounds</a> </li> <li><a href="#limitations">Limitations and Incompatibilities</a> </li> <li><a href="#documenation">Documentation Errata</a> </li> <li><a href="#shippable">Shippable Libraries</a> </li> <li><a href="#new">New Features</a> </li> <li><a href="#standards">Standards Not Implemented</a></li> </ol> <p> </p> <hr> <p><a name="introduction"></a><font size="+2">A. Introduction</font></p> <p>This document contains last minute information about the Sun WorkShop 6 update 1 C++ compiler. It describes the software corrections addressed by this release and lists the known problems, limitations, and incompatibilities.</p> <p>To view the text version of this document, type the following at a command prompt:</p> <pre> example% CC -xhelp=readme </pre> <p> To access the HTML version of this document, point your Netscape(TM) Communicator 4 or compatible Netscape version browser to:</p> <pre> <a href= "../../index.html">file:/opt/SUNWspro/docs/index.html</a> </pre> <p><b>Note -</b> If your Sun WorkShop software is not installed in the <tt>/opt</tt> directory, ask your system administrator for the equivalent path on your system. <p>For more information about this product, see the following sources. If your Sun WorkShop 6 update 1 software is not installed in the <tt>/opt</tt> directory, ask your system administrator for the equivalent path on your system.</p> <ul> <li><b>Man pages and readmes.</b> These describe the new features, performance enhancements, problems and workarounds, and software corrections in this Sun WorkShop 6 update 1 release. <p> You can access these documents in HTML on your local system or network by pointing your browser to <a href="../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>.</p> </li> <li><b>The Sun WorkShop and Sun WorkShop TeamWare online help.</b> The online help has been updated for the new features in this Sun WorkShop 6 update 1 release. <p>You can access the online help on your local system or network by pointing your browser to <a href="../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>. You can also access the online help from the Help menus in the Sun WorkShop products.</p> </li> <li><b><i>What's New in Sun WorkShop 6 update 1</i></b>. This document describes the new features in this Sun WorkShop 6 update 1 release and in the Sun WorkShop 6 release. <p> You can access this manual on your local system or network by pointing your browser to <a href="../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>. You can also access it by pointing your browser to <a href="http://docs.sun.com"><tt> http://docs.sun.com</tt></a> and searching for the Forte(TM) Developer 6 update 1 collection.</p> </li> <li><b>Sun WorkShop 6 manuals.</b> These manuals were provided with Sun WorkShop 6. Information in the man pages, readmes, and online help for Sun WorkShop 6 update 1 supersedes information in the manuals. <p> You can access the manuals on your local system or network by pointing your browser to <a href="../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>. You can also access them by pointing your browser to <a href="http://docs.sun.com"><tt> http://docs.sun.com</tt></a> and searching for the Forte(TM) C, Forte(TM) C++, Forte(TM) for High Performance Computing, and Forte(TM) TeamWare products.</p> <p>The following Sun WorkShop manuals are <i>not</i> available through <tt>http://docs.sun.com</tt>. You can access them on your local system or network by pointing your browser to <a href= "../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>.</p> <ul> <li><i>Sun WorkShop Memory Monitor User's Manual</i></li> <li><i>Standard C++ Class Library Reference</i></li> <li><i>Standard C++ Library User's Guide</i></li> <li><i>Tools.h++ Class Library Reference</i></li> <li><i>Tools.h++ User's Guide</i></li> <li><i>Sun Performance Library Reference</i></li> </ul> <p> </li> <li><b>Sun WorkShop 6 update 1 supplements.</b> The supplements provide more detailed information on some of the major new features in this Sun WorkShop 6 update 1 release. <p> You can access the supplements by pointing your browser to <a href="http://docs.sun.com"><tt> http://docs.sun.com</tt></a> and searching for the Forte Developer 6 update 1 collection. The supplements are not available on your local system or network because they are not on the Forte Developer 6 update 1 CD.</p> </li> <li><i><b>Sun WorkShop 6 update 1 Release Notes.</b></i> These notes provide installation-related and late-breaking information about this Sun WorkShop 6 update 1 release. Information in the release notes supersedes information in any of the other documentation. <p>The release notes are available as a text file on the Forte Developer 6 update 1 CD at <tt> /cdrom/devpro_v8n1_<platform>/release_notes.txt</tt> (where <tt><platform></tt> is either <tt>sparc</tt> or <tt>intel</tt>). The release notes are also available in HTML on the <a href= "http://www.sun.com/forte/developer/hotnews.html"> Forte Developer Products Hot News</a> page at <tt> http://www.sun.com/forte/developer/hotnews.html</tt>.</p> </li> </ul> <p> </p> <hr> <a name="about"></a><font size="+2">B. About the Sun WorkShop 6 update 1 C++ Compiler (5.2)</font> <p>The Sun WorkShop 6 update 1 C++ compiler (5.2) runs on SPARC(TM) processors running Solaris(TM) SPARC Platform Edition versions 2.6, 7, and 8, and Intel(R) processors running Solaris Intel Platform Edition, versions 2.6, 7, and 8. Information unique to one or more platforms is identified as "(SPARC)" or "(IA)." </p> <p>This 5.2 version of the C++ compiler is upwardly source-compatible and binary-compatible with C++ compiler versions 5.0 and 5.1. That is, you can compile source code written for versions 5.0 and 5.1 of the C++ compiler using the 5.2 C++ compiler. In addition, you can link object code that was generated by C++ compiler versions 5.0 and 5.1 with object code that was generated by the 5.2 C++ compiler.</p> <p>The 5.2 C++ compiler also offers the <tt>-compat</tt> option for compiling source code that was written for the 4.2 C++ compiler. The <tt>-compat</tt> option was introduced in version 5.0.</p> <p> </p> <hr> <a name="corrections"></a> <font size="+2">C. Software Corrections</font> <p> This section discusses the following software corrections. </p> <ol> <li><a href="#aStatic">Support for <tt>-instance=static</tt> and <tt>-instance=semiexplicit</tt> With Static Variables Within Templates</a></li> <li><a href="#aDifferent">Different Behavior for Function-Local Static Variables for Extern Inline Functions</a></li> <li><a href="#aTemplate">Template Syntax Error is No Longer Ignored</a></li> </ol> <p> <ol> <li><a name="aStatic"><font size="+1">Support for <tt>-instance=static</tt> and <tt>-instance=semiexplicit</tt> With Static Variables Within Templates </font></a> <p> With prior versions of the C++ compiler, use of the static instances method and use of the semi-explicit instances method were not supported with static variables within templates. This restriction does not exist with the 5.2 version.</p> <li><a name="aDifferent"><font size="+1">Different Behavior for Function-Local Static Variables for Extern Inline Functions </font></a> <p>Under the ARM rules, function-local static variables for extern inline functions are file static. Under the ISO standard, function-local static variables for extern inline functions are global variables that are shared among compilation units.</p> <p> The 5.0 and 5.1 versions of the C++ compiler implemented the ARM behavior for both compatibility mode (<tt>-compat</tt>) and standard mode (the default mode). The 5.2 version of the C++ compiler implements the ARM behavior for compatiblity mode and the ISO behavior for standard mode. For example, <pre> one.cc inline int inner() { static int variable = 0; return variable++; } int outer() { return inner(); } two.cc inline int inner() { static int variable = 0; return variable++; } int main() { return inner() + outer(); } </pre> <p>When compiled in compatibility mode (<tt>-compat</tt>), the two variables are different and the result of main is <tt>0</tt> (zero). <p> When compiled in standard mode (the default mode), the two variables are the same and the result of main is <tt>1</tt> (one). To obtain the old behavior in standard mode, declare the inline function static.</p> </li> <li><a name="aTemplate"><font size="+1">Template Syntax Error is No Longer Ignored</font></a> <p>The following template syntax has never been valid, but Sun C++ 4 and 5.0 did not report the error. The 5.1 and 5.2 versions of the C++ compiler report this syntax error when you compile in standard mode (the default mode).</p> <pre> template<class T> class MyClass<T> { ... }; // definition error template<class T> class MyClass<T>; // declaration error </pre> <p>In both cases, the "<tt><T></tt>" on "<tt>MyClass<T></tt>" is invalid, and must be removed, as shown in the following example:</p> <pre> template<class T> class MyClass { ... }; // definition template<class T> class MyClass; // declaration </pre> </li> </ol> <p> </p> <hr> <a name="problems"></a><font size="+2">D. Problems and Workarounds</font> <p>This section discusses the following software bugs that could not be fixed in time for this release. For updates, check Forte Developer Products Hot News at <a href= ""><tt>http://www.sun.com/forte/developer/hotnews.html</tt></a>.</p> <ol> <li><a href="#anEmpty">An Empty Virtual Base Class Can Cause a Program to Core Dump</a></li> <li><a href="#cNameMangling">Name Mangling Linking Problems</a></li> <li><a href="#cmake">Using <tt>make</tt> With Standard Library Header Files on Versions 2.6 and 7 of the Solaris Operating Environment</a></li> <li><a href="#cIncorrect">Debugging Tools Erroneously Report Extra Leading Parameter for Member Functions</a></li> <li><a href="#cUndefined">Reference From Template to Non-Global File-Scope Object is Not Supported</a></li> <li><a href="#cHeaders">Standard Header Warning Messages</a></li> <li><a href="#cpragma"><tt>#pragma</tt> <tt>align</tt> Inside Namespace Requires Mangled Names</a></li> <li><a href="#cctypend"><tt>__ctype</tt> Not Defined Errors</a></li> </ol> <p> <ol> <li><a name="anEmpty"><font size="+1">An Empty Virtual Base Class Can Cause a Program to Core Dump</font></a> <p>A program might core dump if it has a complex class hierarchy that contains empty virtual base classes. To prevent the problem, add a data member to the empty virtual base class. You do not need to initialize the data member. When you copy or assign the virtual base class, you do not need to copy or assign the data member. <!-- 4309374/4350308 --></p> </li> <li><a name="cNameMangling"><font size="+1">Name Mangling Linking Problems</font></a> <p>The following conditions may cause linking problems:</p> <ul> <li>A function is declared in one place as having a const parameter and in another place as having a non-const parameter. <p>Example:</p> <pre> void foo1(const int); void foo1(int); </pre> <p>These declarations are equivalent, but the compiler mangles the names differently. To prevent this problem, do not declare value parameters as <tt>const</tt>. For example, use <tt>void foo1(int);</tt> everywhere, including the body of the function definition. </p> </li> <li>A function has two parameters with the same composite type, and just one of the parameters is declared using a typedef. <p>Example:</p> <pre> class T; typedef T x; // foo2 has composite (that is, pointer or array) // parameter types void foo2(T*, T*) void foo2(T*, x*); void foo2(x*, T*); void foo2(x*, x*); </pre> <p>All declarations of <tt>foo2</tt> are equivalent and should mangle the same. However, the compiler will mangle some of them differently. To prevent this problem, use typedefs consistently. <p>If you cannot use typedefs consistently, a workaround is to use a weak symbol in the file that defines the function to equate a declaration with its definition. For example:</p> <p><font size=-1><tt>#pragma weak "__1_undefined_name" = "__1_defined_name"</tt></font></p> <p><b>Note</b> -- Some mangled names are dependent on the target architecture. (For example, <tt>size_t</tt> is <tt>unsigned</tt> <tt>long</tt> for the SPARC V9 architecture, and <tt>unsigned</tt> <tt>int</tt> otherwise.) In such a case, two versions of the mangled name will be involved, one for each model. Two pragmas must be provided, controlled by appropriate <tt>#if</tt> directives.</p> </li> </ul> <p>For more information, see the <i>C++ Migration Guide</i>. To access this guide in HTML, point your browser to <a href= "../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>.</p> </li> <li><a name="cmake"></a><font size="+1">Using <tt>make</tt> With Standard Library Header Files on Versions 2.6 and 7 of the Solaris Operating Environment</font> <p>The standard library file names do not have "<tt>.h</tt>" suffixes. Instead, they are named <tt>istream</tt>, <tt> fstream</tt>, and so forth. In addition, the template source files are named <tt>istream.cc</tt>, <tt>fstream.cc</tt>, and so forth.</p> <p>If, in the Solaris 2.6 or 7 operating environment, you include a standard library header in your program, such as <tt> <istream></tt>, and your makefile has <tt>.KEEP_STATE</tt>, you will encounter problems. For example, if you include <tt> <istream></tt>, <tt>make</tt> thinks that <tt>istream</tt> is an executable and uses the default rules to build <tt>istream</tt> from <tt>istream.cc</tt> resulting in very misleading error messages. (Both <tt>istream</tt> and <tt>istream.cc</tt> are installed under the C++ include files directory). Here are possible workarounds:</p> <ul> <li>Use the <tt>-r</tt> option which disables the default <tt> make</tt> rules. This solution may break the build process.</li> <li>Use the <tt>dmake</tt> utility in serial mode instead of <tt> make</tt>:<br> <tt>dmake -m serial</tt></li> <li>Avoid the use of <tt>.KEEP_STATE</tt>.</li> </ul> <p> </li> <li><a name="cIncorrect"></a><font size="+1">Debugging Tools Erroneously Report Extra Leading Parameter for Member Functions</font> <p>In compatability mode (<tt>-compat=4</tt>), the C++ compiler incorrectly mangles the link names for pointers to member functions. The consequence of this error is that the demangler, and hence some debugging tools, like <tt>dbx</tt> and <tt>c++filt</tt>, report the member functions as having an extra leading parameter consisting of a reference to the class type of which the function is a member. To correct this problem, add the flag <tt>-Qoption ccfe -abiopt=pmfun1</tt>. Note, however, that sources compiled with this flag may be binary incompatible with sources compiled without the flag. In standard mode (the default mode), there is no problem with mangled names. </p> </li> <li><a name="cUndefined"></a><font size="+1">Reference From Template to Non-Global File-Scope Object is Not Supported</font> <!-- 4174997 --> <p> A program using templates and static objects causes link-time errors of undefined symbols. The compiler currently does not support reference to non-global file-scope objects from templates</p> </li> <li><a name="cHeaders"></a><font size="+1">Standard Header Warning Messages</font> <p>There are known problems with standard headers that cause lots of warnings when <tt>+w</tt> is used.</p> </li> <li><a name="cpragma"><font size="+1"><tt>#pragma</tt> <tt> align</tt> Inside Namespace Requires Mangled Names</font></a> <p>When you use <tt>#pragma align</tt> inside a namespace, you must use mangled names. For example, in the following code, the <tt> #pragma align</tt> statement has no effect. To correct the problem, replace <tt>a</tt>, <tt>b</tt>, and <tt>c</tt> in the <tt>#pragma align</tt> statement with their mangled names.</p> <pre> namespace foo { #pragma align 8 (a, b, c) static char a; static char b; static char c; } </pre> </li> <li><a name="cctypend"><font size="+1"><tt>__ctype</tt> Not Defined Errors</font></a> <!-- BG 4300780 --> <p>The Solaris 8 operating environment has a bug that can cause "<tt>__ctype</tt> not defined" errors from the C++ compiler when you use <tt>MB_CUR_MAX</tt> from <tt><stdlib.h></tt>.</p> <p>The bug will be fixed in an update to the Solaris 8 operating environment. The workaround is to include the standard header <tt> <ctype.h></tt> as well as the header <tt> <stdlib.h></tt>.</p> </li> </ol> <p> </p> <hr> <a name="limitations"></a><font size="+2">E. Limitations and Incompatibilities</font> <p><font size="+1">1. C++ Shared Library Patch</font></p> <p>A SUNWlibC patch is provided for each version of the Solaris Operating Environment supported by this Sun WorkShop 6 update 1 release on each of the supported platforms. Without these patches, some programs will not link and some programs will terminate in unusual ways due to runtime errors.</p> <p>For information about required and optional patches for this Sun WorkShop 6 update 1 release, see the <i>Sun WorkShop 6 update 1 Release Notes</i>. The release notes are available as a text file on the Forte Developer 6 update 1 CD at <tt> /cdrom/devpro_v8n1_<platform>/release_notes.txt</tt> (where <tt><platform></tt> is either <tt>sparc</tt> or <tt>intel</tt>). The release notes are also available in HTML on the <a href= "http://www.sun.com/forte/developer/hotnews.html"> Forte Developer Products Hot News</a> page at <tt> http://www.sun.com/forte/developer/hotnews.html</tt>.<p> <p> </p> <p><font size="+1">2. Compiler Version Incompatibilities</font></p> <p>The remainder of this section discusses the incompatibilities between Sun WorkShop C++ compiler versions 4.0, 4.1, 4.2, and the following versions:</p> <blockquote> <ul> <li>Sun WorkShop C++ compiler 5.0</li> <li>Sun WorkShop 6 C++ compiler 5.1</li> <li>Sun WorkShop 6 update 1 C++ compiler 5.2</li> </ul> </blockquote> <ol type="a"> <li><a href="#cachedifferences">Cache Version Differences May Cause Compilation Errors</a></li> <li><a href="#interface">C++ Interface Incompatibilities</a></li> <li><a href="#iostreams">Using Tools.h++ With <tt> iostreams</tt></a></li> <li><a href="#using">Using Multiple Template Repositories; <kbd> -ptr</kbd> Option Ignored</a></li> <li><a href="#incompatible">Linking With 4.0.1 Libraries Containing Pointers to <kbd>const</kbd> Member Functions</a></li> <li><a href="#unparsable">Linking With Libraries Compiled With Earlier Compilers</a></li> <li><a href="#compat">Mixing Object Code From Different Versions</a></li> </ol> <br> <ol type="a"> <li><a name="cachedifferences"></a><font size="+1">Cache Version Differences May Cause Compilation Errors</font> <p>When upgrading compilers, it is always good practice to run <tt> CCadmin -clean</tt> on every directory that contains a <tt> SunWS_cache</tt> subdirectory (alternately, you can use <tt>rm -rf SunWS_cache</tt>). Failure to do so can result in compilation errors such as the following:</p> <font size=-1> <ul> <li><tt>SunWS_cache: Error: Database version mismatch<br> <path>/SunWS_cache/CC_version. </tt> <p> </li> <li> <tt> "<path>/SunWS_cache/CC_state",<br> line 3: Error: "" not allowed here. ** Assertion ** : 0 </tt> <p> </li> </ul> </font> <p> </li> <li><a name="interface"></a><font size="+1">C++ Interface Incompatibilities</font> <p>The Sun WorkShop 6 C++ compiler (5.1) and the Sun WorkShop 6 update 1 C++ compiler (5.2) are not binary compatible with versions 4.0, 4.1, and 4.2 of the C++ compiler unless the <tt>-compat</tt> option is used when compiling with the 5.1 or 5.2 compiler. The incompatibility is due to the changes in the class layouts, the calling sequences, and the way names are mangled to meet the requirements defined in the ANSI/ISO C++ Standard.</p> <p>The Sun WorkShop 6 update 1 C++ compiler (5.2), the Sun WorkShop 6 C++ compiler (5.1) and the Sun WorkShop C++ compiler 5.0 are binary compatible.</p> <p>See the <i>C++ Migration Guide</i> for more information. To access this document in HTML, point your browser to <a href= "../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>.</p> </li> <li><a name="iostreams"></a><font size="+1">Using Tools.h++ With <tt>iostreams</tt></font> <p> The C++ compiler now uses standard iostreams as the default. However, Tools.h++ version 7 is built with classic iostreams. If you use Tools.h++ in standard mode, you must include <kbd> libiostream</kbd> as shown in the following compiler option:</p> <pre> -library=rwtools7,iostream </pre> <p>See the <i>C++ Migration Guide</i> for more information. To access this guide in HTML, point your browser to <a href= "../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>.</p> </li> <li><a name="using"></a><font size="+1">Using Multiple Template Repositories; <tt>-ptr</tt> Option Ignored</font> <p>In compilers prior to C++ compiler 5.0, the <tt>-ptr</tt> flag was used to designate repositories for template instantiations. With the 5.0, 5.1, and 5.2 versions of the C++ compiler, the <tt> -ptr</tt> flag is no longer required, as the compilation system reads from the template repositories corresponding to the object files that it reads, and writes template instances into the repository contained in the directory of the output location specified by the CC command.</p> <p> In this release, the <tt>-ptr</tt> option is obsolete and is ignored by the compiler. Even though the option is ignored, you should remove <tt>-ptr</tt> from all compilation commands because, in a later release, it may be reimplemented with a different behavior.</p> <p><b>Note --</b> Sharing a single template repository for more than one application or library has not been and is currently not supported. Attempting to do so can lead to compilation failure and unpredictable results at runtime because of template redefinitions.</p> </li> <li><a name="incompatible"></a><font size="+1">Linking With 4.0.1 Libraries Containing Pointers to <kbd>const</kbd> Member Functions</font> <p>The C++ 4.0.1 compiler generated different mangled names for pointers to <tt>const</tt> member functions than the C++ compiler versions 4.1, 4.2, 5.0, 5.1, and 5.2 do. If you are using the Sun WorkShop 6 C++ compiler and you are unable to link with a library that was built with 4.0.1 and that contains such names, you should either recompile the library, or compile the rest of the program with the <tt>-compat -Qoption ccfe -abirel=4.0.1</tt> flags.</p> <p><b>Note --</b> Future releases may not support the <tt> -abirel=4.0.1</tt> flag.</p> </li> <li><a name="unparsable"></a><font size="+1">Linking With Libraries Compiled With Earlier Compilers</font> <p>The C++ 4.0.1 and C++ 4.1 compilers generated a mangled name that was unparsable for templates instantiated with an extern "C" function. As a consequence, debugging tools behaved incorrectly. We have corrected the problem, but some users may be unable to link objects that are compiled using versions 5.0, 5.1, or 5.2 of the C++ compiler with libraries compiled with earlier compilers. This incompatibility should be extremely rare, but in the event that it does happen, you can either</p> <ul> <li>Recompile the library with the Sun WorkShop 6 update 1 C++ compiler (5.2), or</li> <li>Compile the new objects using the Sun WorkShop 6 update 1 C++ compiler (5.2) with the <tt>-compat=4</tt> and <tt>-Qoption ccfe -abirel=4.1</tt> flags.</li> </ul> <p><b>Note --</b> Future releases may not support the <tt> -abirel=4.1</tt> flag.</p> </li> <li><a name="compat"></a><font size="+1">Mixing Object Code From Different Versions</font> <p>You can mix object code from different versions of the SunWorkShop C++ compiler in the same program, as long as you don't mix compatibility-mode and standard-mode code. However, you must link the final program using a compiler at least as new as the newest compiler version in the mix.</p> </li> </ol> <p> </p> <hr> <a name="documenation"></a><font size="+2">F. Documentation Errata </font> <ul> <li><b><i>C++ Migration Guide</i>.</b> Section 1.3.2 "Mixing Old and New Binaries" says that you can mix code if no exceptions cross the boundary, but this is not true. If you mix <tt>compat=4</tt> with <tt>compat=5</tt> code in the same program, you can use exceptions in the <tt>compat=4</tt> code or in the <tt>compat=5</tt> code, but not in both. If you have exceptions in the <tt>compat=4</tt> code, link libC before linking libCrun. If you have exceptions in the <tt>compat5</tt> code, link libCrun before linking libC. <p> </li> <li><b><i>C++ Migration Guide</i>.</b> Section 2.3.1 "Copy Constructor" has an invalid code fragment. Replace it with: <pre> class T { T(const T&); // private public: T(); }; T f1(T t) { return t; } // Error, can't return a T void f2() { f1( T() ); } // Error, can't pass a T </pre> </li> <li><b><i>C++ Migration Guide</i>.</b> Section 3.3.1 "Resolving Type Names" has invalid code examples. Replace the first code example with: <pre> typedef int S; template< class T > class B { typedef int U; }; template< class T > class C : public B<T> { S s; // OK T t; // OK U x; // 1 No longer valid T::V z; // 2 No longer valid }; </pre> <p>Replace the paragraph below the code example with:</p> <blockquote> <p>The new language rules state that no base class that is dependent on a template parameter is searched automatically to resolve type names in a template, and that no name coming from a base class or template parameter class is a type name unless it is declared to be so with the keyword <tt>typename</tt>. </blockquote> <p>Replace the second code example with</p> <pre> typedef int S; template< class T > class B { typedef int U; }; template< class T > class C : public B<T> { S s; // OK T t; // OK typename B::U x; // OK typename T::V z; // OK }; </pre> </li> <li><b><i>C++ Migration Guide</i>.</b> Section 3.4 "Class Name Injection" is missing a semi-colon (<tt>;</tt>) in CODE EXAMPLE 3-2. Replace the second-to-last line in the code example with: <pre> }; </pre> </li> <li><b><i>C++ Migration Guide</i>.</b> Section 3.7 "String Literals and <tt>char*</tt>" has an invalid code example. Remove the semi-colon (<tt>;</tt>) from the first line: <pre> #define GREETING "Hello world" </pre> </li> <li><b><i>C++ Programming Guide</i>.</b> Section 2.1.1 "Language-Adaptable Header Files" shows spaces in some macro names. Replace all occurrences of "<tt>_ _STDC_ _</tt>" with "<tt>__STDC__</tt>". Replace all occurrences of "<tt>_ _cplusplus</tt>" with "<tt>__cplusplus</tt>". <p></li> <li><b><i>C++ Programming Guide</i>.</b> Section 4.3.3.4 "Explicit Instantiation of Template Class Static Data members" as an invalid code fragment. Replace it with: <pre> template int String<19>::overflows; </pre> </li> <li><b><i>C++ Programming Guide</i>.</b> Section 4.7.2 "Local Types as Template Arguments" has errors in CODE EXAMPLE 4-1. In <tt>file1.cc</tt> replace the last line with: <pre> Array<Foo> File1Data(10); </pre> <p>In <tt>file2.cc</tt> replace the last line with:</p> <pre> Array<Foo> File2Data(20); </pre> </li> <li><b><i>C++ Programming Guide</i>.</b> Section 5.4.3 "Specifying Exceptions to Be Thrown" has an error in the last code example. Remove the semi-colon (<tt>;</tt>) from the second line: <pre> void f(int) throw(x) </pre> </li> <li><b><i>C++ Programming Guide</i>.</b> Section 7.5.3 "Casting Down or Across the Hierarchy" has errors in both code examples. <p> Add the following to the beginning of the first code example: <pre> #include <assert.h> #include <stddef.h> // for NULL </pre> <p>Replace the second code example with: <pre> #include <assert.h> #include <stddef.h> // for NULL #include <typeinfo> class A { public: virtual void f() { } }; class B { public: virtual void g() { } }; class AB : public virtual A, private B { }; void attempted_casts( ) { AB ab; B* bp = (B*)&ab; // C-style cast needed to break protection A* ap = dynamic_cast<A*>(bp); // fails, B is inaccessible assert(ap == NULL); try { AB& abr = dynamic_cast<AB&>(*bp); // fails, B is inaccessible } catch(const std::bad_cast&) { return; // failed reference cast caught here } assert(0); // should not get here } </pre> </li> <li><b><i>C++ Programming Guide</i>.</b> Section 9.3 has an error in the last code example. Remove the semi-colon (<tt>;</tt>) from the first line: <pre> #include <rw/stdmutex.h> </pre> </li> <li><b><i>C++ Library Reference</i></b>. Section 2.3 "Mathematical Functions" has an error in TABLE 2-1. Replace <tt>double ang(const complex)</tt> with <tt>double arg(const complex)</tt>.<p></li> <li><b><i>C++ Library Reference</i></b>. Section 3.3.9 "Handling Input Errors" has an error in the code example. Replace <tt>#include <unistd.h></tt> with <tt>#include <stdlib.h></tt>. <p></li> <li><b><i>C++ Library Reference</i></b>. Section 3.4.1.5 "Repositioning within a File" has an error in the first code fragment. Add a semi-colon (<tt>;</tt>) to the end of the line: <pre> enum seek_dir { beg=0, cur=1, end=2 }; </pre> </li> <li><b><i>C++ Library Reference</i></b>. Section 4.8 "Object Destruction" has an error in the code example. Replace the first line of the function definition with: <pre> void multi_process(const char* filename, int numthreads) </pre> </li> <li><b><i>C++ User's Guide</i></b>. In the entries for <b><tt>-xtarget</tt></b>, <b><tt>-xarch</tt></b>, and <b><tt> -xchip</tt></b>, add <b><tt>generic64</tt></b> and <b><tt>native64</tt></b> to the lists of valid values. See the <b><tt>CC</tt></b>(1) man page for details.<p></li> </ul> <hr> <a name="shippable"></a><font size="+2">G. Shippable Libraries</font> <p> If your executable uses a Sun dynamic library listed in the file named below, your license includes the right to redistribute the library to your customer.</p> <pre> <a href= "runtime.libraries.html"><install-directory>/SUNWspro/READMEs/runtime.libraries</a> </pre> (Replace <tt><install-directory></tt> with the path to your Sun WorkShop installation directory. In a default installation, <tt><install-directory></tt> is <tt>/opt</tt>.) <p> You may not redistribute or otherwise disclose the header files, source code, object modules, or static libraries of object modules in any form.</p> <p> The License to Use appears in the End User Object Code License, viewable from the back of the plastic case containing the CDROM.</p> <p> </p> <hr> <a name="new"></a><font size="+2">H. New Features</font> <p> For information about new features, see <i>What's New in Sun WorkShop 6 update 1</i>. This document describes the new features in this Sun WorkShop 6 update 1 release and in the Sun WorkShop 6 release.</p> <p> You can access this manual on your local system or network by pointing your browser to <a href="../../index.html"><tt> file:/opt/SUNWspro/docs/index.html</tt></a>. You can also access it by pointing your browser to <a href="http://docs.sun.com"><tt> http://docs.sun.com</tt></a> and searching for the Forte Developer 6 update 1 collection.</p> <p> </p> <hr> <a name="standards"></a> <font size="+2">I. Standards Not Implemented</font> <p><!-- BG 4310670 --> The C++ compiler (CC) supports the ISO standard for C++, ISO IS 14882:1998, Programming Language C++. The following list describes requirements in the standard that are not supported in this release:</p> <ul> <li>Expressions involving non-type template parameters in the function parameter list for function templates, such as <p><tt>template<int I> void foo(mytype<2*I> ) { ... }</tt></p> </li> <li>Template template parameters (templates as template parameters).<p></li> <li>Universal character names.<p></li> </ul> <p>The following functions, which appeared in the 1994 Addendum to the 1990 C standard and are included by reference in the 1998 C++ standard, are supported on versions 7 and 8 of the Solaris operating environment, but are not supported on version 2.6. With version 2.6 of the Solaris operating environment, the declarations do not appear in any headers, and the functions are not available in the Solaris run-time libraries.</p> <blockquote> <pre> btowc fwide fwprintf fwscanf mbrlen mbrtowc mbsinit mbsrtowcs swprintf swscanf vfwprintf vswprintf vwprintf wcrtomb wcsrtombs wcsstr wctob wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf </pre> </blockquote> <p> </p> <hr> <p><a href="./copyright.html">Copyright</a> 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved. </p> <p>Sun, Sun Microsystems, the Sun logo, docs.sun.com, and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries.</p> </td> </tr> </table> </body> </html> |