This chapter discusses the evolution of g++ and describes what can be expected in the future.
The current version of gcc/g++ is 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 functionality have no reason to upgrade. The previous version of gcc/g++ is 2.7.2.1, released August 14, 1996. The current version of libg++ is 2.7.2, released July 4, 1996.
Note that gcc 2.7.2.1 just consists of several small patches to gcc-2.7.2. The release is mainly intended to fix platform-specific bugs and does not affect the C++ "front end" of the compiler (the part that parses your C++ code).
The 2.7.x releases represent a great deal of work on the part of the g++ maintainers to fix outstanding bugs and move the compiler closer to the current ANSI/ISO standards committee's working paper, including supporting many of the new features that have been added to the language. I recommend that everyone read the NEWS file contained in the distribution (and that system administrators make the file available to their users). I've borrowed liberally from this file here.
If any features seem unfamiliar, you will probably want to look at the recently-released public review copy of the C++ Working Paper. A new draft, dated 2 December 1996, has been released for public comment. You can find it on the web at `http://www.cygnus.com/misc/wp/' or `http://www.maths.warwick.ac.uk/c++/pub/wp/html/cd2/'. See `http://www.setech.com/x3.html' or `http://www.maths.warwick.ac.uk/c++/pub/' to download the document in PostScript, PDF (Adobe Acrobat), HTML, or ASCII form.
Here are the main points:
-fno-for-scope
to get
the old behavior. You'll need this flag to build groff version 1.09,
Ptolemy, and many other free software packages.
-frtti
.
This support is still in alpha; one major restriction is that any file
compiled with -frtti
must include <typeinfo>
(not
typeinfo.h
as the NEWS file says).
Also, all C++ code you link with (including libg++) has to be built with
-frtti
, so it's still tricky to use.
a ? b : c = 1
has changed from
(a ? b : c) = 1
to a ? b : (c = 1)
. This is a new C/C++
incompatibility brought to you by the ANSI/ISO standards committee.
-ansi
or
-foperator-names
to enable them.
explicit
keyword is now supported. explicit
is used to mark
constructors and type conversion operators that should not be used
implicitly.
inline template class foo<int>;
can be used to emit only the vtable
for a template class.
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 for the iostreams classes; the LGPL is not used (see section What are the rules for shipping code built with g++ and libg++?).
This library, libstdc++, is in the libg++ distribution in versions 2.6.2 and later. It requires at least gcc 2.6.3 to build the libg++-2.6.2 version; use at least gcc 2.7.0 to build the libg++ 2.7.0 version. It contains a hacked-up version of HP's implementation of the Standard Template Library (see section Does g++ support the Standard Template Library?). I've successfully used this Standard Template Library version to build a number of the demos you'll see on various web pages.
As of version 2.7.0, the streams classes are now in libstdc++ instead of libg++, and libiostream is being phased out (don't use it). The g++ program searches this library.
The maintainers of libg++ have de-emphasized work on the older libg++ classes in favor of enhancing libstdc++ to cover the full language, so while libg++ will always be available, enhancements to it should not be expected.
A great deal of work has gone into enhancements to the C++ front end, as well as to other aspects of the compiler.
The next major release(s) of gcc/g++ can be expected to have the following features:
Features that are still missing include namespaces and templates as template arguments.
The egcs effort is a new effort to merge several threads of gcc development and to provide a faster development process. For more information see `http://www.cygnus.com/egcs/'.
The FSF has a policy of never announcing release dates in advance. I'm sure this is frustrating to a lot of people, since it's taken so long, and this frustration was one of the reasons the egcs effort was created. An egcs release should be expected to occur in the very near future. [ More on this next time ].
Go to the first, previous, next, last section, table of contents.