From-SVN: r19834
This commit is contained in:
Jason Merrill 1998-05-18 00:51:07 -04:00
parent be1559e5b5
commit 11d3633762

View File

@ -3,7 +3,7 @@
@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
@ -12,7 +12,7 @@
@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
@ -87,7 +87,7 @@ The Next Generation(s) of g++
* 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?
@ -178,35 +178,35 @@ or GPL (@pxref{legalities}).
@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?
@ -282,8 +282,8 @@ Most GNU utilities are compressed with ``gzip'', the GNU compression
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
@ -460,10 +460,10 @@ convention. It means ``the C++ compiler included with gcc-2.x.y.''
* 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
@ -471,16 +471,17 @@ convention. It means ``the C++ compiler included with gcc-2.x.y.''
@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.
@ -502,18 +503,18 @@ The current release is egcs-1.0.1, released January 6, 1998.
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},
@ -530,7 +531,7 @@ supported. An instantiation method resembling that used in Borland C++
(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
@ -542,7 +543,7 @@ at link time.
@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.
@ -570,7 +571,8 @@ There are many more changes: see @file{http://www.cygnus.com/egcs/c++features.ht
@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?
@ -649,11 +651,10 @@ to proceed more quickly.
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
@ -773,7 +774,7 @@ debug format (e.g. Suns running SunOS 4.x), the GNU linker compresses
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.
@ -1181,7 +1182,7 @@ in the future.
@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
@ -1315,7 +1316,7 @@ The GNU Standard C++ Library (also called the ``GNU ANSI C++ Library''
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
@ -1784,7 +1785,7 @@ While there is no libg++-specific document describing the STL
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
@ -1822,7 +1823,7 @@ template ostream& operator << (ostream&, const A<int>&);
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
@ -1892,7 +1893,7 @@ before @code{f()}; this will force it to be instantiated (though not
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.
@ -1982,7 +1983,7 @@ This bug is fixed in 2.7.0.
@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.
@ -2049,7 +2050,7 @@ and ``VAX may also work'' (according to Mike Stump).
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
@ -2065,7 +2066,7 @@ a no-op.
@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.
@ -2075,7 +2076,7 @@ that don't appear in the ARM are supported, notably the @code{mutable}
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}.
@ -2083,7 +2084,7 @@ more reserved words: @code{typeid}, @code{static_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
@ -2142,7 +2143,7 @@ debugging information in a format known as `DWARF'.
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
@ -2309,7 +2310,7 @@ all the standard classes are in @file{-lstdc++}; you can do the link
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.