@setfilename g++FAQ.info
@settitle Frequently asked questions about the GNU C++ compiler
@setchapternewpage off
-@c version: @(#)g++FAQ.texi 1.60 01/31/98
+@c version: %W% %G%
@c %**end of header
@iftex
@titlepage
@title G++ FAQ
@subtitle Frequently asked questions about the GNU C++ compiler
-@subtitle January 31, 1998
+@subtitle March 16, 1998.
@sp 1
@author Joe Buck
@page
* new-in-2.8.0:: What's new in gcc 2.8.0?
* egcs-intro:: What is egcs?
* egcs-whats-new:: What's new in egcs vs 2.7.2?
-* egcs-bug-fixes:: What was fixed in egcs-1.0.1?
+* egcs-bug-fixes:: What was fixed in egcs-1.0.1 and 1.0.2?
* egcs-linux:: If I install on Linux, will it overwrite my libraries?
* egcs-run-both:: How can I run both egcs and an FSF release?
* egcs-vs-2.8.0:: How will egcs affect 2.8.0?
@cindex egcs release
-The egcs project (on the Web: @file{http://www.cygnus.com/egcs/}) has
-released a bug-fix version, egcs-1.0.1, on January 6, 1998. Folks
-using egcs-1.0 should upgrade, as it has some important bug fixes.
+The newest release from the egcs project (on the Web:
+@file{http://www.cygnus.com/egcs/}) is egcs-1.0.2, released March 16,
+1998.
@cindex gcc/g++, version date
-The current version of gcc/g++ is 2.8.0 (!), released January 14, 1998.
-It is a huge improvement over the 2.7.x releases, and thanks to
-extensive testing in the egcs framework, is perhaps the least buggy .0
-gcc release anyone can remember (though there are definitely a few).
+The current version of gcc/g++ is 2.8.1, released March 4, 1998.
+This release fixes some bugs in the 2.8.0 release from January.
+It is a huge improvement over the 2.7.x releases.
-The current version of libg++ is 2.8.0, released January 19, 1998.
-However, libg++ is being deprecated; libstdc++-2.8.0 contains just the
-standard C++ classes and is a subset of libg++ 2.8.0. The libstdc++
-library is identical to the one included in egcs-1.0.1.
+libg++ has now been deprecated (that is, it is no longer really
+supported), so gcc2.8.1 users need to grab libstdc++-2.8.1 from
+their favorite GNU site (egcs users don't need to get this separately
+as it is bundled with egcs). However, there is an 'add-on' libg++ 2.8.1
+mini-release. If you want to use it, you need to combine it with
+libstdc++ 2.8.1.
I would strongly recommend that anyone using a g++ version earlier
than 2.7.2 should upgrade if at all possible (@pxref{version 2.7.x}).
-Folks who need modern C++ features should upgrade to 2.8.0 or egcs.
+Folks who need modern C++ features should upgrade to 2.8.1 or egcs.
For some non-Unix platforms, the latest port of gcc may be an earlier
-version (2.6.3, say). You'll need to use a version of libg++ that
+version (2.7.2, say). You'll need to use a version of libg++ that
has the same first two digits as the compiler version, e.g. use libg++
-2.6.x (for the latest x you can find) with gcc version 2.6.3.
+2.7.x (for the latest x you can find) with gcc version 2.7.2.1.
The latest "1.x" version of gcc is 1.42, and the latest "1.x" version of
g++ is 1.42.0.
-While gcc 1.42 is quite usable for C programs,
-I recommend against using g++ 1.x except in special circumstances
-(and I can't think of any such circumstances).
+While gcc 1.42 is quite usable for C programs, g++ 1.x is only of
+historical interest (since the C++ language has changed so much).
@node g++ for Unix, g++ for HP, latest versions, basics
@section How do I get a copy of g++ for Unix?
utility. All GNU archive sites should have a copy of this program,
which you will need to uncompress the distributions.
-@cindex libg++
-Don't forget to retrieve libg++ as well!
+@cindex libstdc++
+Don't forget to retrieve libstdc++ as well!
@node g++ for HP, g++ for Solaris 2.x, g++ for Unix, basics
@section Getting gcc/g++ for the HP Precision Architecture
* new-in-2.8.0:: What's new in gcc 2.8.0?
* egcs-intro:: What is egcs?
* egcs-whats-new:: What's new in egcs vs 2.7.2?
-* egcs-bug-fixes:: What was fixed in egcs-1.0.1?
+* egcs-bug-fixes:: What was fixed in egcs-1.0.1 and egcs-1.0.2?
* egcs-linux:: If I install on Linux, will it overwrite my libraries?
* egcs-run-both:: How can I run both egcs and an FSF release?
-* egcs-vs-2.8.0:: How will egcs affect 2.8.0?
+* egcs-vs-2.8.0:: How will egcs affect 2.8.x?
* egcs-robustness:: How robust is egcs?
@end menu
@section What's new in gcc/g++ 2.8.0?
After a two-year wait, gcc 2.8.0 was released in January 1998, along
-with libstdc++-2.8.0 and libg++-2.8.0. Note that the latter (libg++)
-contains the former (libstdc++) so there is no reason to install both
-library packages, but libstdc++ is required.
+with libstdc++-2.8.0 and libg++-2.8.0. This has been followed up in
+March by the 2.8.1 release of all three packages, though libg++-2.8.1
+is an "add-on" (it does not contain libstdc++ anymore). Note that
+libstdc++ is required.
For those familiar with egcs, the most obvious difference between
-gcc-2.8.0 and egcs-1.0 or 1.0.1 is the packaging: egcs is bundled with
-libstdc++, and gcc-2.8.0 does not contain the class library. Otherwise,
+gcc-2.8.x and egcs is the packaging: egcs is bundled with
+libstdc++, and gcc-2.8.x does not contain the class library. Otherwise,
except for the lack of the @code{-frepo} option and some bug fixes
-that have not yet made it into gcc-2.8.0, C++ users will find the
-two compilers to be almost the same at this stage, other than that 2.8.0
+that have not yet made it into gcc-2.8.x, C++ users will find the
+two compilers to be almost the same at this stage, other than that 2.8.x
users may get more bogus warnings with -Wall and optimization because
some fixes to flow analysis in the presence of exceptions that egcs made
are not yet present in gcc 2.8.0.
Questions not addressed here may be answered in the egcs FAQ
(@file{http://www.cygnus.com/egcs/faq.html}).
-@node egcs-whats-new, egcs-bug-fixes, egcs-intro, egcs and 2.8.0
+@node egcs-whats-new, egcs-bug-fixes, egcs-intro, egcs and 2.8.x
@section What new C++ features are in egcs?
@strong{Note}: unless indicated otherwise, these features are also
-present in g++ 2.8.0.
+present in g++ 2.8.x.
@itemize @bullet
@item
@cindex integrated libstdc++
The standard C++ classes are integrated with the egcs release (but
-@strong{not} for gcc-2.8.0, which does not include the class libraries).
+@strong{not} for gcc-2.8.x, which does not include the class libraries).
libg++ is not being
supported, though an add-on version that will work with egcs can be found at
@file{ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.0b6.6.tar.gz},
(instantiating functions possibly in multiple .o files and using weak
symbols to link correctly) is provided, in addition to other
options. The SGI version of STL is shipped verbatim with libstdc++
-(libstdc++ is included with egcs, separate with gcc-2.8.0).
+(libstdc++ is included with egcs, separate with gcc-2.8.x).
@item
@cindex redundant template elimination
@item
@cindex repository
@cindex -frepo
-The @code{-frepo} flag is supported in egcs (it is not in 2.8.0).
+The @code{-frepo} flag is supported in egcs (it is not in 2.8.x).
However, because of the previous item, I don't recommend its use on ELF
systems, as the default method is better.
@end itemize
Features that are still missing include namespaces and templates as
-template arguments.
+template arguments, though there is support for the latter feature
+in the egcs snapshots (which has not yet made it into a release).
@node egcs-bug-fixes, egcs-linux, egcs-whats-new, egcs and 2.8.0
@section What was fixed in egcs-1.0.1?
While the 'e' stands for 'experimental', egcs has been tested thoroughly
and should be of high quality. A few glitches in the initial release
-were fixed in 1.0.1. egcs-1.0 users should upgrade.
+were fixed in 1.0.1, and a few more in 1.0.2. egcs-1.0 users should upgrade.
-Some memory bloat problems with deeply nested templates were fixed in
-1.0.1 (though it appears that there are still a few cases where
-excessive memory requirements occur).
+Memory bloat problems with deeply nested templates were fixed in
+1.0.2.
@node installation, evolution, egcs and 2.8.0, Top
@chapter Installation Issues and Problems
the debug symbol table considerably. The 2.7 version adds some symbol
table compression for ELF and Solaris targets.
-Users of egcs or 2.8.0 on ELF systems should definitely
+Users of egcs or 2.8.x on ELF systems should definitely
use GNU ld (2.8 or later), as it will automatically remove duplicate
instantiations of templates, virtual function tables, or ``outlined''
copies of inline functions.
@node version 2.7.x, libstdc++, evolution, evolution
@section What's new in version 2.7.x of gcc/g++
-[ This section is old now, since 2.8.0/egcs is the new stuff ] The
+[ This section is old now, since 2.8.x/egcs is the new stuff ] The
latest 2.7.x version was 2.7.2.2, released February 10, 1997. The only
change between 2.7.2.1 and 2.7.2.2 is that support was added for using
the GNU C library, version 2, on Linux; users not interested in that
in places in the code) is not libg++, though it is included in the
libg++ distribution. Rather, it contains classes and functions
required by the ANSI/ISO standard. The copyright conditions are the
-same as those for the iostreams classes; the LGPL is not used
+same as those for for the iostreams classes; the LGPL is not used
(@pxref{legalities}).
This library, libstdc++, is in the libg++ distribution in versions 2.6.2
implementation, SGI's web site, at
@file{http://www.sgi.com/Technology/STL/}, is an excellent resource.
Note that the SGI version of STL is the one that is included with the
-egcs and 2.8.0 releases of g++/libstdc++.
+egcs and 2.8.x releases of g++/libstdc++.
@end itemize
As of version 2.7.2, there are still a few limitations in the template
implementation besides the above (thanks to Jason Merrill for this info):
-@strong{Note}: these problems are eliminated in egcs and in gcc-2.8.0.
+@strong{Note}: these problems are eliminated in egcs and in gcc-2.8.x.
@enumerate 1
@item
emitted).
@strong{Note:} this kind of ``guiding declaration'' is not standard and
-isn't supported by egcs or gcc-2.8.0, as the standard says that this
+isn't supported by egcs or gcc-2.8.x, as the standard says that this
declares a ``normal'' @code{min} function which has no relation to
the template function @code{min<int>(int,int)}. But then the new
compilers have no problem inlining template functions.
@section Does g++ support the Standard Template Library?
If you want to use the Standard Template Library, do not pass go,
-upgrade immediately to gcc-2.8.0 or to egcs. The new C++ front end
+upgrade immediately to gcc-2.8.x or to egcs. The new C++ front end
handles STL very well, and the high-quality implementation of STL
from SGI is included verbatim as part of the libstdc++ class library.
As of version 2.7.2, g++ recognizes the keywords @code{namespace} and
@code{using}, and there is some rudimentary code present, but almost
nothing connected with namespaces works yet.
-The new versions (2.8.0/egcs) still lack namespace support, but to help
+The new versions (2.8.x/egcs) still lack namespace support, but to help
compile standard programs they make
@example
@cindex exceptions
Up until recently, there was no really usable exception support. If you
-need exceptions, you want gcc-2.8.0 or egcs. The implementation works
+need exceptions, you want gcc-2.8.x or egcs. The implementation works
fairly well. The 2.7.x version was strictly alpha quality and quite
fragile.
keyword, in version 2.5.x. 2.6.x added support for the built-in boolean
type @code{bool}, with constants @code{true} and @code{false}. Run-time
type identification was rudimentary in 2.7.x but is fully supported in
-2.8.0, so there are
+2.8.x, so there are
more reserved words: @code{typeid}, @code{static_cast},
@code{reinterpret_cast}, @code{const_cast}, and @code{dynamic_cast}.
As with any beta-test compiler, there are bugs. You can help improve
the compiler by submitting detailed bug reports.
-[ This paragraph obsoleted by 2.8.0/egcs: ]
+[ This paragraph obsoleted by 2.8.x/egcs: ]
One of the weakest areas of g++ other than templates is the resolution
of overloaded functions and operators in complex cases. The usual
symptom is that in a case where the ARM says that it is ambiguous which
Although the GNU C compiler already knows how to write out symbolic debugging
information in the DWARF format, the GNU C++ compiler does not yet have this
feature yet. However, work is in progress for DWARF 2 debug support for
-gcc and g++ and it works fairly well in 2.8.0 and egcs, though we'll
+gcc and g++ and it works fairly well in 2.8.x and egcs, though we'll
have to wait for gdb 4.17 to be released to take full advantage.
@cindex stabs
step with @code{c++} instead of @code{g++} to search only the
@file{-lstdc++} library and avoid the LGPL'ed code in @file{-lg++}.
-Note that in egcs and in gcc-2.8.0, if you do not
+Note that in egcs and in gcc-2.8.x, if you do not
specify any libraries the @code{g++} command will only link in
@file{-lstdc++}, so your executable will not be affected by the LGPL.