howto.html: Update some links.

2003-04-24  Phil Edwards  <pme@gcc.gnu.org>

	* docs/html/17_intro/howto.html:  Update some links.
	* docs/html/18_support/howto.html:  Link doxygen numeric_limits notes.
	* docs/html/27_io/howto.html:  Link doxygen stdio_filebuf notes.
	* docs/html/ext/howto.html:  Link to demangler notes and API.
	* docs/html/faq/index.html:  Remove trailing whitespace.
	(1.4, 2.4, 3.8, 4.1):  Bring up to date.
	(5.6):  Change to a bulleted list.

	* docs/html/faq/index.txt, docs/html/documentation.html,
	docs/html/17_intro/porting.html:  Regenerate.

From-SVN: r66050
This commit is contained in:
Phil Edwards 2003-04-24 20:39:50 +00:00
parent 59325650b1
commit 39ec52254e
9 changed files with 259 additions and 264 deletions

View File

@ -1,3 +1,16 @@
2003-04-24 Phil Edwards <pme@gcc.gnu.org>
* docs/html/17_intro/howto.html: Update some links.
* docs/html/18_support/howto.html: Link doxygen numeric_limits notes.
* docs/html/27_io/howto.html: Link doxygen stdio_filebuf notes.
* docs/html/ext/howto.html: Link to demangler notes and API.
* docs/html/faq/index.html: Remove trailing whitespace.
(1.4, 2.4, 3.8, 4.1): Bring up to date.
(5.6): Change to a bulleted list.
* docs/html/faq/index.txt, docs/html/documentation.html,
docs/html/17_intro/porting.html: Regenerate.
2003-04-23 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/basic_filebuf/3.cc: _S_pback_size now

View File

@ -163,7 +163,7 @@
<p>For those of you new to ISO C++98, no, that isn't a typo, the headers
really have new names. Marshall Cline's C++ FAQ Lite has a good
explanation in
<a href="http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-26.4">item [26.4]</a>.
<a href="http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4">item [27.4]</a>.
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
@ -219,7 +219,8 @@
<a href="../18_support/howto.html#5">runtime demangler function</a>.
(The classes in <code>&lt;stdexcept&gt;</code> have constructors which
require an argument to use later for <code>what()</code> calls, so the
question does not arise in most user-defined exceptions.)
problem of <code>what()</code>'s value does not arise in most
user-defined exceptions.)
</p>
<p><strong>[18.5.1]/7</strong> The return value of
<code>std::type_info::name()</code> is the mangled type name (see the

View File

@ -134,12 +134,49 @@ need to define. You will need to add them to the
target. It will not work to simply define these macros in
<code>os_defines.h</code>.
<p>At this time, there is one libstdc++-v3-specific macro which may be
<p>At this time, there are a few libstdc++-v3-specific macro which may be
defined. <code>_G_USING_THUNKS</code> may be defined to 0 to express that the
port doesn't use thunks (although it is unclear that this is still
useful since libio support isn't currently working and the g++ v3 ABI
invalidates the assumption that some ports don't use thunks).
<p><code>_GLIBCPP_USE_C99_CHECK</code> may be defined to 1 to check C99
function declarations (which are not covered by specialization below)
found in system headers against versions found in the library headers
derived from the standard.
<p><code>_GLIBCPP_USE_C99_DYNAMIC</code> may be defined to an expression that
yields 0 if and only if the system headers are exposing proper support
for C99 functions (which are not covered by specialization below). If
defined, it must be 0 while bootstrapping the compiler/rebuilding the
library.
<p><code>_GLIBCPP_USE_C99_LONG_LONG_CHECK</code> may be defined to 1 to check
the set of C99 long long function declarations found in system headers
against versions found in the library headers derived from the
standard.
<p><code>_GLIBCPP_USE_C99_LONG_LONG_DYNAMIC</code> may be defined to an
expression that yields 0 if and only if the system headers are
exposing proper support for the set of C99 long long functions. If
defined, it must be 0 while bootstrapping the compiler/rebuilding the
library.
<p><code>_GLIBCPP_USE_C99_FP_MACROS_DYNAMIC</code> may be defined to an
expression that yields 0 if and only if the system headers
are exposing proper support for the related set of macros. If defined,
it must be 0 while bootstrapping the compiler/rebuilding the library.
<p><code>_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK</code> may be defined
to 1 to check the related set of function declarations found in system
headers against versions found in the library headers derived from
the standard.
<p><code>_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC</code> may be defined
to an expression that yields 0 if and only if the system headers
are exposing proper support for the related set of functions. If defined,
it must be 0 while bootstrapping the compiler/rebuilding the library.
<p>Finally, you should bracket the entire file in an include-guard, like
this:

View File

@ -117,7 +117,9 @@
<p>This header mainly defines traits classes to give access to various
implementation defined-aspects of the fundamental types. The
traits classes -- fourteen in total -- are all specilizations of the
template class <code>numeric_limits</code> defined as follows:
template class <code>numeric_limits</code>, documented
<a href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/structstd_1_1numeric__limits.html">here</a>
and defined as follows:
</p>
<pre>
template&lt;typename T&gt; struct class {

View File

@ -741,8 +741,9 @@
<li>Beginning with 3.1, the extra <code>filebuf</code> constructor and
the <code>fd()</code> function were removed from the standard
filebuf. Instead, <code>&lt;ext/stdio_filebuf.h&gt;</code> contains
a derived class called <code>__gnu_cxx::stdio_filebuf</code>. This
class can be constructed from a C <code>FILE*</code> or a file
a derived class called
<a href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/class____gnu__cxx_1_1stdio__filebuf.html"><code>__gnu_cxx::stdio_filebuf</code></a>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
</li>
</ul>

View File

@ -224,6 +224,7 @@
<li><a href="ext/howto.html#6">Allocators (version 3.3)</a></li>
<li><a href="ext/howto.html#4">Compile-time checks</a></li>
<li><a href="ext/howto.html#5">LWG Issues</a></li>
<li><a href="ext/../18_support/howto.html#5">Demangling</a></li>
</ul>
</li>

View File

@ -45,6 +45,7 @@
<li><a href="#6">Allocators (version 3.3)</a></li>
<li><a href="#4">Compile-time checks</a></li>
<li><a href="#5">LWG Issues</a></li>
<li><a href="../18_support/howto.html#5">Demangling</a></li>
</ul>
<hr />

View File

@ -10,9 +10,9 @@
<meta name="DESCRIPTION" content="FAQ for the GNU libstdc++ effort." />
<title>libstdc++-v3 FAQ</title>
<link rel="StyleSheet" href="../lib3styles.css" />
<!--
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, 1_4, 4_1.
<!--
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, .
-->
</head>
<body>
@ -55,7 +55,7 @@
<ol>
<li><a href="#2_1">How do I install libstdc++-v3?</a> </li>
<li><a href="#2_2">[removed]</a> </li>
<li><a href="#2_3">What is this CVS thing that you keep
<li><a href="#2_3">What is this CVS thing that you keep
mentioning?</a> </li>
<li><a href="#2_4">How do I know if it works?</a> </li>
<li><a href="#2_5">This library is HUGE! And what's libsupc++?</a> </li>
@ -127,8 +127,8 @@
<!-- I suspect these will mostly be links to/into existing documents. -->
<h2><a name="1_1">1.1 What is libstdc++-v3?</a></h2>
<p>The GNU Standard C++ Library v3 is an
ongoing project to implement the ISO 14882 Standard C++ library
as described in chapters 17 through 27 and annex D. As the
ongoing project to implement the ISO 14882 Standard C++ library
as described in chapters 17 through 27 and annex D. As the
library reaches stable plateaus, it is captured in a snapshot
and released. The latest release is
<a href="http://gcc.gnu.org/libstdc++/index.html#download">the
@ -137,7 +137,7 @@
far the project has come, or just want the latest
bleeding-edge code, the up-to-date source is available over
anonymous CVS, and can even be browsed over the Web (see
<a href="#1_4">1.4</a> below).
<a href="#1_4">1.4</a> below).
</p>
<p>The older libstdc++-v2 project is no longer maintained; the code
has been completely replaced and rewritten.
@ -145,7 +145,7 @@
report bugs to your system vendor, not to the V3 list.
</p>
<p>A more formal description of the V3 goals can be found in the
official <a href="../17_intro/DESIGN">design document</a>.
official <a href="../17_intro/DESIGN">design document</a>.
</p>
<hr />
@ -156,11 +156,11 @@
implementations are (as the Draft Standard used to say)
&quot;incomplet and incorrekt,&quot; and many suffer from
limitations of the compilers that use them.
</p>
</p>
<p>The GNU C/C++/FORTRAN/&lt;pick-a-language&gt; compiler
(<code>gcc</code>, <code>g++</code>, etc) is widely considered to be
one of the leading compilers in the world. Its development
has recently been taken over by the
has recently been taken over by the
<a href="http://gcc.gnu.org/">GCC team</a>. All of
the rapid development and near-legendary
<a href="http://gcc.gnu.org/gcc-3.0/buildstat.html">portability</a>
@ -178,8 +178,8 @@
<h2><a name="1_3">1.3 Who's in charge of it?</a></h2>
<p>The libstdc++ project is contributed to by several developers
all over the world, in the same way as GCC or Linux.
Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, Ulrich Drepper,
Loren James Rittle, and Paolo Carlini are the lead maintainers of
Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, Ulrich Drepper,
Loren James Rittle, and Paolo Carlini are the lead maintainers of
the CVS archive.
</p>
<p>Development and discussion is held on the libstdc++ mailing
@ -191,23 +191,22 @@
<hr />
<h2><a name="1_4">1.4 How do I get libstdc++?</a></h2>
<p>The fourteenth (and latest) snapshot of libstdc++-v3 is
<a href="http://gcc.gnu.org/libstdc++/index.html#download">available
via ftp</a>.
</p>
<p>The <a href="http://gcc.gnu.org/libstdc++/">homepage</a>
has instructions for retrieving the latest CVS sources, and for
browsing the CVS sources over the web.
</p>
<p>Stable versions of libstdc++-v3 are included with releases of
<a href="http://gcc.gnu.org/releases.html">the GCC compilers</a>.
</p>
<p>The subset commonly known as the Standard Template Library
(chapters 23 through 25, mostly) is adapted from the final release
of the SGI STL.
</p>
</p>
<hr />
<h2><a name="1_5">1.5 When is libstdc++ going to be finished?</a></h2>
<!-- <p>Nathan Myers gave the best of all possible answers in <a
href="http://www.deja.com/getdoc.xp?AN=469581698&fmt=text">a
<!-- <p>Nathan Myers gave the best of all possible answers in <a
href="http://www.deja.com/getdoc.xp?AN=469581698&fmt=text">a
Usenet article</a>.</p>
which is no longer available, thanks deja...-->
<p>Nathan Myers gave the best of all possible answers, responding to a
@ -224,7 +223,7 @@ which is no longer available, thanks deja...-->
source code; anybody who is willing to help write
documentation, for example, or has found a bug in code that
we all thought was working, is more than welcome!
</p>
</p>
<hr />
<h2><a name="1_7">1.7 What happened to libg++? I need that!</a></h2>
@ -254,7 +253,6 @@ which is no longer available, thanks deja...-->
from libg++ might be extracted into an updated utilities library,
but nobody has stated such a project yet.
</p>
<!-- The advertisement, so to speak, might have to go. Hmmmmm. -->
<p>(The <a href="http://www.boost.org/">Boost</a> site houses free
C++ libraries that do varying things, and happened to be started
by members of the Standards Committee. Certain &quot;useful
@ -317,7 +315,7 @@ which is no longer available, thanks deja...-->
browse those files over CVSweb ahead of time to get a feel for
what's required. RELEASE-NOTES is located in the
&quot;.../docs/17_intro/&quot; directory of the distribution.
</p>
</p>
<hr />
<h2><a name="2_2">2.2 [removed]</a></h2>
@ -332,9 +330,9 @@ which is no longer available, thanks deja...-->
control packages. It was selected for GNU projects because it's
free (speech), free (beer), and very high quality. The <a
href="http://www.gnu.org/software/cvs/cvs.html">CVS entry in
the GNU software catalogue</a> has a better description as
the GNU software catalogue</a> has a better description as
well as a
<a href="http://www.cvshome.org/">link to the makers of CVS</a>.
<a href="http://www.cvshome.org/">link to the makers of CVS</a>.
</p>
<p>The &quot;anonymous client checkout&quot; feature of CVS is
similar to anonymous FTP in that it allows anyone to retrieve
@ -349,7 +347,9 @@ which is no longer available, thanks deja...-->
<h2><a name="2_4">2.4 How do I know if it works?</a></h2>
<p>libstdc++-v3 comes with its own testsuite. You do not need
to actually install the library (&quot;<code>make
install</code>&quot;) to run the testsuite.
install</code>&quot;) to run the testsuite, but you do need
DejaGNU, as described
<a href="http://gcc.gnu.org/install/test.html">here</a>.
</p>
<p>To run the testsuite on the library after building it, use
&quot;make check&quot; while in your build directory. To run
@ -362,7 +362,7 @@ which is no longer available, thanks deja...-->
</p>
<hr />
<h2><a name="2_5">2.4 This library is HUGE! And what's libsupc++?</a></h2>
<h2><a name="2_5">2.5 This library is HUGE! And what's libsupc++?</a></h2>
<p>Usually the size of libraries on disk isn't noticeable. When a
link editor (or simply &quot;linker&quot;) pulls things from a
static archive library, only the necessary object files are copied
@ -431,7 +431,7 @@ which is no longer available, thanks deja...-->
should, in theory, be usable under any ISO-compliant
compiler. It will still be targeted and optimized for
GCC/g++, however.
</p>
</p>
<hr />
<h2><a name="3_2">3.2 [removed]</a></h2>
@ -510,17 +510,17 @@ which is no longer available, thanks deja...-->
only available on the i486 and later. So if you configured GCC
to target, for example, i386-linux, but actually used the programs
on an i686, then you would encounter no problems. Only when
actually running the code on a i386 will the problem appear.
actually running the code on a i386 will the problem appear.
</p>
<p>This is fixed in 3.2.2.
</p>
<hr />
<h2><a name="3_8">3.8 Recent GNU/Linux glibc required?</a></h2>
<p>For 3.2.1 (shared library version 5.0.1) and later, the library
uses localization and formatting code from the system C library
(glibc) version 2.2.5. That version of glibc is over a year old
and contains necessary bugfixes. Many GNU/Linux distros make
<p>When running on GNU/Linux, libstdc++ 3.2.1 (shared library version
5.0.1) and later uses localization and formatting code from the system
C library (glibc) version 2.2.5. That version of glibc is over a
year old and contains necessary bugfixes. Many GNU/Linux distros make
glibc version 2.3.x available now.
</p>
<p>The guideline is simple: the more recent the C++ library, the
@ -546,9 +546,9 @@ which is no longer available, thanks deja...-->
<hr />
<h1><a name="4_0">4.0 Known Bugs and Non-Bugs</a></h1>
<em>Note that this section can get rapdily outdated -- such is the
nature of an open-source project. For the latest information, join
the mailing list or look through recent archives. The RELEASE-
NOTES and BUGS files are generally kept up-to-date.</em>
nature of an open-source project. For the latest information, join
the mailing list or look through recent archives. The RELEASE-
NOTES and BUGS files are generally kept up-to-date.</em>
<p>For 3.0.1, the most common &quot;bug&quot; is an apparently missing
&quot;<code>../</code>&quot; in include/Makefile, resulting in files
@ -579,59 +579,22 @@ which is no longer available, thanks deja...-->
</p>
<h2><a name="4_1">4.1 What works already?</a></h2>
<p>This is a verbatim clip from the &quot;Status&quot; section
<p>Short answer: Pretty much everything <em>works</em> except for some
corner cases. Also, localization is incomplete. For whether it works
well, or as you expect it to work, see 5.2.
</p>
<p>Long answer: See the docs/html/17_intro/CHECKLIST file, which is
badly outdated...
</p>
<p>What follows is a verbatim clip from the &quot;Status&quot; section
of the RELEASE-NOTES for the latest snapshot. For a list of
fixed bugs, see that file.
</p>
</p>
<!-- Yeah, I meant that "verbatim clip" thing literally... :-) -->
<pre>
New:
---
(post 3.0.97)
- more doxygen documentation
- more named locale fixups
- stdio_filebuf that takes fd, FILE
- io performance tuning
- allocation tuning, valgrind fixups
- __cxa_demangle now supported
(3.0.97)
- more doxygen documentation.
- more named locale bug fixes
- support for symbol versioning when using GNU ld &gt;= 2.12
- wide-io
- tuning for executable size
(3.0.96)
- more doxygen documentation.
- extensions moved out of namespace std
- HPUX long long support
- more string optimizations
- support for NetBSD cross compiles
- concept_check merge from boost
- header simplification
- named locale bug shakeout
- thread testsuite
(3.0.95)
- add S390, m68k, x86-64 support.
- doxygen documentation has been extended, including man pages.
- verbose terminate handling has been added.
- some libsupc++ tweaks
- warnings for deprecated headers now active.
- dejagnu testsuite preliminary documentation.
- dejagnu testsuite default.
- dejagnu testsuite cross compiler, multilib safe.
- long long iostreams on by default, rework of ISO C99 support.
- iterator re-write and testsuites.
- container testsuites.
- allocator revamp and testsuites.
- more concept-checking work.
- basic_string optimization and MT fixes.
- new limits implementation.
- update -fno-exceptions code, verify it works.
- full named locale support fpr all facets, choice of gnu,
ieee_1003.1-200x (POSIX 2), or generic models. Full support depends
on target OS and underlying &quot;C&quot; library support.
</pre>
@ -713,8 +676,8 @@ New:
reason is that the state flags are <strong>not</strong> cleared
on a successful call to open(). The standard unfortunately did
not specify behavior in this case, and to everybody's great sorrow,
the <a href="../ext/howto.html#5">proposed LWG resolution</a> (see
DR #22) is to leave the flags unchanged. You must insert a call
the <a href="../ext/howto.html#5">proposed LWG resolution in
DR #22</a> is to leave the flags unchanged. You must insert a call
to <code>fs.clear()</code> between the calls to close() and open(),
and then everything will work like we all expect it to work.
</p>
@ -738,16 +701,15 @@ New:
</p>
<p>If the headers are in <code>${prefix}/include/g++-3</code>, or if
the installed library's name looks like <code>libstdc++-2.10.a</code>
or <code>libstdc++-libc6-2.10.so</code>,
then you are using the old libstdc++-v2 library, which is nonstandard
and unmaintained. Do not report problems with -v2 to the -v3
mailing list.
or <code>libstdc++-libc6-2.10.so</code>, then you are using the old
libstdc++-v2 library, which is nonstandard and unmaintained. Do not
report problems with -v2 to the -v3 mailing list.
</p>
<p>For GCC versions 3.0 and 3.1 the libstdc++-v3 header files are
installed in <code>${prefix}/include/g++-v3</code> (see the 'v'?).
Starting with version 3.2 the headers are installed in
<code>${prefix}/include/c++/${version}</code> as this prevents
headers from previous versions being found by mistake.
installed in <code>${prefix}/include/g++-v3</code> (see the 'v'?).
Starting with version 3.2 the headers are installed in
<code>${prefix}/include/c++/${version}</code> as this prevents
headers from previous versions being found by mistake.
</p>
<p><a name="4_4_glibc"><strong>glibc</strong></a>
If you're on a GNU/Linux system and have just upgraded to
@ -787,13 +749,13 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
when compiling and linking:
</p>
<pre>
// compile the library components
// compile your library components
g++ -fPIC -c a.cc
g++ -fPIC -c b.cc
...
g++ -fPIC -c z.cc
// create the library
// create your library
g++ -fPIC -shared -rdynamic -o libfoo.so a.o b.o ... z.o
// link the executable
@ -826,7 +788,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
entry, it is a Good Thing if you can additionally create a small
test program to test for the presence of the bug that your
patch fixes. Bugs have a way of being reintroduced; if an old
bug creeps back in, it will be caught immediately by the
bug creeps back in, it will be caught immediately by the
<a href="#2_4">testsuite</a> -- but only if such a test exists.
</p>
@ -903,7 +865,8 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
<p>In particular, <code>string</code> is not from SGI and makes no
use of their &quot;rope&quot; class (which is included as an
optional extension), nor is <code>valarray</code> and some others.
Classes like <code>vector&lt;&gt;</code> are, however.
Classes like <code>vector&lt;&gt;</code> are, however we have
made significant changes to them since then.
</p>
<p>The FAQ for SGI's STL (one jump off of their main page) is
recommended reading.
@ -949,7 +912,6 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
<p>This is a bit cleaner than defining typedefs for all the
instantiations you might need.
</p>
<p>Extensions to the library have
<a href="../ext/howto.html">their own page</a>.
</p>
@ -962,15 +924,21 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
<hr />
<h2><a name="5_6">5.6 Is libstdc++-v3 thread-safe?</a></h2>
<p>When the system's libc is itself thread-safe, a non-generic
implementation of atomicity.h exists for the architecture, and gcc
itself reports a thread model other than single; libstdc++-v3
strives to be thread-safe. The user-code must guard against
concurrent method calls which may access any particular library
object's state. Typically, the application programmer may infer
what object locks must be held based on the objects referenced in
a method call. Without getting into great detail, here is an
example which requires user-level locks:
<p>libstdc++-v3 strives to be thread-safe when all of the following
conditions are met:
</p>
<ul>
<li>The system's libc is itself thread-safe,</li>
<li><code>gcc -v</code> reports a thread model other than 'single',</li>
<li>[pre-3.3 only] a non-generic implementation of atomicity.h
exists for the architecture in question.</li>
</ul>
<p>The user-code must guard against concurrent method calls which may
access any particular library object's state. Typically, the
application programmer may infer what object locks must be held
based on the objects referenced in a method call. Without getting
into great detail, here is an example which requires user-level
locks:
</p>
<pre>
library_class_a shared_object_a;
@ -994,12 +962,12 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
object_a.mutate ();
} </pre>
<p>All library objects are safe to use in a multithreaded program as
long as each thread carefully locks out access by any other thread
while it uses any object visible to another thread. In general,
long as each thread carefully locks out access by any other
thread while it uses any object visible to another thread, i.e.,
treat library objects like any other shared resource. In general,
this requirement includes both read and write access to objects;
unless otherwise documented as safe, do not assume that two
threads may access a shared standard library object at the
same time.
unless otherwise documented as safe, do not assume that two threads
may access a shared standard library object at the same time.
</p>
<p>See chapters <a href="../17_intro/howto.html#3">17</a> (library
introduction), <a href="../23_containers/howto.html#3">23</a>
@ -1051,7 +1019,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
a &quot;free-standing implementation&quot; that doesn't include (much
of) the standard library. It is a good basis for the work to come.
</p>
<p>A useful C++ ABI must also incorporate many details of the standard
<p>A useful C++ ABI must also incorporate many details of the standard
library implementation. For a C ABI, the layouts of a few structs
(such as FILE, stat, jmpbuf, and the like) and a few macros suffice.
For C++, the details include the complete set of names of functions
@ -1063,7 +1031,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
those details so that future bug fixes and optimizations don't
force breaking the ABI.
</p>
<p>There are ways to help isolate library implementation details from the
<p>There are ways to help isolate library implementation details from the
ABI, but they trade off against speed. Library details used in
inner loops (e.g., getchar) must be exposed and frozen for all
time, but many others may reasonably be kept hidden from user code,

View File

@ -4,9 +4,9 @@
The latest version of this document is always available at
[1]http://gcc.gnu.org/onlinedocs/libstdc++/faq/. The main
documentation page is at
[2]http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html.
[2]http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html.
To the [3]libstdc++-v3 homepage.
To the [3]libstdc++-v3 homepage.
_________________________________________________________________
Questions
@ -122,12 +122,12 @@
1.4 How do I get libstdc++?
The fourteenth (and latest) snapshot of libstdc++-v3 is [60]available
via ftp.
The [61]homepage has instructions for retrieving the latest CVS
The [60]homepage has instructions for retrieving the latest CVS
sources, and for browsing the CVS sources over the web.
Stable versions of libstdc++-v3 are included with releases of [61]the
GCC compilers.
The subset commonly known as the Standard Template Library (chapters
23 through 25, mostly) is adapted from the final release of the SGI
STL.
@ -253,7 +253,8 @@
2.4 How do I know if it works?
libstdc++-v3 comes with its own testsuite. You do not need to actually
install the library ("make install") to run the testsuite.
install the library ("make install") to run the testsuite, but you do
need DejaGNU, as described [73]here.
To run the testsuite on the library after building it, use "make
check" while in your build directory. To run the testsuite on the
@ -265,7 +266,7 @@
up your idea and send it to the list!
_________________________________________________________________
2.4 This library is HUGE! And what's libsupc++?
2.5 This library is HUGE! And what's libsupc++?
Usually the size of libraries on disk isn't noticeable. When a link
editor (or simply "linker") pulls things from a static archive
@ -291,7 +292,7 @@
people don't like it, so here are two pseudo-solutions:
If the only functions from libstdc++.a which you need are language
support functions (those listed in [73]clause 18 of the standard,
support functions (those listed in [74]clause 18 of the standard,
e.g., new and delete), then try linking against libsupc++.a (usually
specifying -lsupc++ when calling g++ for the final link step will do
it). This library contains only those support routines, one per object
@ -386,7 +387,7 @@
- < /dev/null" to display a list of predefined macros for any
particular installation.
This has been discussed on the mailing lists [74]quite a bit.
This has been discussed on the mailing lists [75]quite a bit.
This method is something of a wart. We'd like to find a cleaner
solution, but nobody yet has contributed the time.
@ -395,7 +396,7 @@
3.6 OS X ctype.h is broken! How can I hack it?
This is a long-standing bug in the OS X support. Fortunately, the
patch is quite simple, and well-known. [75]Here's a link to the
patch is quite simple, and well-known. [76]Here's a link to the
solution.
_________________________________________________________________
@ -413,11 +414,11 @@
3.8 Recent GNU/Linux glibc required?
For 3.2.1 (shared library version 5.0.1) and later, the library uses
localization and formatting code from the system C library (glibc)
version 2.2.5. That version of glibc is over a year old and contains
necessary bugfixes. Many GNU/Linux distros make glibc version 2.3.x
available now.
When running on GNU/Linux, libstdc++ 3.2.1 (shared library version
5.0.1) and later uses localization and formatting code from the system
C library (glibc) version 2.2.5. That version of glibc is over a year
old and contains necessary bugfixes. Many GNU/Linux distros make glibc
version 2.3.x available now.
The guideline is simple: the more recent the C++ library, the more
recent the C library. (This is also documented in the main GCC
@ -433,7 +434,7 @@
enable itself.
You can fix the problems yourself, and learn more about the situation,
by reading [76]this short thread ("_GLIBCPP_USE_WCHAR_T undefined in
by reading [77]this short thread ("_GLIBCPP_USE_WCHAR_T undefined in
FreeBSD's c++config.h?").
_________________________________________________________________
@ -446,7 +447,7 @@
For 3.0.1, the most common "bug" is an apparently missing "../" in
include/Makefile, resulting in files like gthr.h and gthr-single.h not
being found. Please read [77]the configuration instructions for GCC,
being found. Please read [78]the configuration instructions for GCC,
specifically the part about configuring in a separate build directory,
and how strongly recommended it is. Building in the source directory
is fragile, is rarely tested, and tends to break, as in this case.
@ -454,7 +455,7 @@
For 3.1, the most common "bug" is a parse error when using <fstream>,
ending with a message, "bits/basic_file.h:52: parse error before `{'
token." Please read [78]the installation instructions for GCC,
token." Please read [79]the installation instructions for GCC,
specifically the part about not installing newer versions on top of
older versions. If you install 3.1 over a 3.0.x release, then the
wrong basic_file.h header will be found (its location changed between
@ -467,53 +468,17 @@
4.1 What works already?
This is a verbatim clip from the "Status" section of the RELEASE-NOTES
for the latest snapshot. For a list of fixed bugs, see that file.
Short answer: Pretty much everything works except for some corner
cases. Also, localization is incomplete. For whether it works well, or
as you expect it to work, see 5.2.
Long answer: See the docs/html/17_intro/CHECKLIST file, which is badly
outdated...
What follows is a verbatim clip from the "Status" section of the
RELEASE-NOTES for the latest snapshot. For a list of fixed bugs, see
that file.
New:
---
(post 3.0.97)
- more doxygen documentation
- more named locale fixups
- stdio_filebuf that takes fd, FILE
- io performance tuning
- allocation tuning, valgrind fixups
- __cxa_demangle now supported
(3.0.97)
- more doxygen documentation.
- more named locale bug fixes
- support for symbol versioning when using GNU ld >= 2.12
- wide-io
- tuning for executable size
(3.0.96)
- more doxygen documentation.
- extensions moved out of namespace std
- HPUX long long support
- more string optimizations
- support for NetBSD cross compiles
- concept_check merge from boost
- header simplification
- named locale bug shakeout
- thread testsuite
(3.0.95)
- add S390, m68k, x86-64 support.
- doxygen documentation has been extended, including man pages.
- verbose terminate handling has been added.
- some libsupc++ tweaks
- warnings for deprecated headers now active.
- dejagnu testsuite preliminary documentation.
- dejagnu testsuite default.
- dejagnu testsuite cross compiler, multilib safe.
- long long iostreams on by default, rework of ISO C99 support.
- iterator re-write and testsuites.
- container testsuites.
- allocator revamp and testsuites.
- more concept-checking work.
- basic_string optimization and MT fixes.
- new limits implementation.
- update -fno-exceptions code, verify it works.
- full named locale support fpr all facets, choice of gnu,
ieee_1003.1-200x (POSIX 2), or generic models. Full support depends
on target OS and underlying "C" library support.
_________________________________________________________________
4.2 Bugs in gcc/g++ (not libstdc++-v3)
@ -523,30 +488,30 @@ New:
libstdc++. If you are experiencing one of these problems, you can find
more information on the libstdc++ and the GCC mailing lists.
Before reporting a bug, examine the [79]bugs database with the
Before reporting a bug, examine the [80]bugs database with the
category set to "libstdc++". The BUGS file in the source tree also
tracks known serious problems.
* Debugging is problematic, due to bugs in line-number generation
(mostly fixed in the compiler) and gdb lagging behind the compiler
(lack of personnel). We recommend configuring the compiler using
--with-dwarf2 if the DWARF2 debugging format is not already the
default on your platform. Also, [80]changing your GDB settings can
default on your platform. Also, [81]changing your GDB settings can
have a profound effect on your C++ debugging experiences. :-)
_________________________________________________________________
4.3 Bugs in the C++ language/lib specification
Yes, unfortunately, there are some. In a [81]message to the list,
Yes, unfortunately, there are some. In a [82]message to the list,
Nathan Myers announced that he has started a list of problems in the
ISO C++ Standard itself, especially with regard to the chapters that
concern the library. The list itself is [82]posted on his website.
concern the library. The list itself is [83]posted on his website.
Developers who are having problems interpreting the Standard may wish
to consult his notes.
For those people who are not part of the ISO Library Group (i.e.,
nearly all of us needing to read this page in the first place :-), a
public list of the library defects is occasionally published [83]here.
Some of these have resulted in [84]code changes.
public list of the library defects is occasionally published [84]here.
Some of these have resulted in [85]code changes.
_________________________________________________________________
4.4 Things in libstdc++ that only look like bugs
@ -578,7 +543,7 @@ New:
state on the previous file. The reason is that the state flags are not
cleared on a successful call to open(). The standard unfortunately did
not specify behavior in this case, and to everybody's great sorrow,
the [85]proposed LWG resolution (see DR #22) is to leave the flags
the [86]proposed LWG resolution in DR #22 is to leave the flags
unchanged. You must insert a call to fs.clear() between the calls to
close() and open(), and then everything will work like we all expect
it to work.
@ -588,7 +553,7 @@ New:
same namespace as other comparison functions (e.g., 'using' them and
the <iterator> header), then you will suddenly be faced with huge
numbers of ambiguity errors. This was discussed on the -v3 list;
Nathan Myers [86]sums things up here. The collisions with
Nathan Myers [87]sums things up here. The collisions with
vector/string iterator types have been fixed for 3.1.
The g++-3 headers are not ours
@ -596,7 +561,7 @@ New:
If you have found an extremely broken header file which is causing
problems for you, look carefully before submitting a "high" priority
bug report (which you probably shouldn't do anyhow; see the last
paragraph of the page describing [87]the GCC bug database).
paragraph of the page describing [88]the GCC bug database).
If the headers are in ${prefix}/include/g++-3, or if the installed
library's name looks like libstdc++-2.10.a or libstdc++-libc6-2.10.so,
@ -621,7 +586,7 @@ type has changed in glibc 2.2. The patch is at
http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
Note that 2.95.x shipped with the [88]old v2 library which is no
Note that 2.95.x shipped with the [89]old v2 library which is no
longer maintained. Also note that gcc 2.95.3 fixes this problem, but
requires a separate patch for libstdc++-v3.
@ -634,18 +599,18 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
visibility, or you just plain forgot, etc).
More information, including how to optionally enable/disable the
checks, is available [89]here.
checks, is available [90]here.
dlopen/dlsym If you are using the C++ library across
dynamically-loaded objects, make certain that you are passing the
correct options when compiling and linking:
// compile the library components
// compile your library components
g++ -fPIC -c a.cc
g++ -fPIC -c b.cc
...
g++ -fPIC -c z.cc
// create the library
// create your library
g++ -fPIC -shared -rdynamic -o libfoo.so a.o b.o ... z.o
// link the executable
@ -653,11 +618,11 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
"memory leaks" in containers A few people have reported that the
standard containers appear to leak memory when tested with memory
checkers such as [90]valgrind. The library's default allocators keep
checkers such as [91]valgrind. The library's default allocators keep
free memory in a pool for later reuse, rather than returning it to the
OS. Although this memory is always reachable by the library and is
never lost, memory debugging tools can report it as a leak. If you
want to test the library for memory leaks please read [91]Tips for
want to test the library for memory leaks please read [92]Tips for
memory leak hunting first.
_________________________________________________________________
@ -665,16 +630,16 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
If you have found a bug in the library and you think you have a
working fix, then send it in! The main GCC site has a page on
[92]submitting patches that covers the procedure, but for libstdc++
[93]submitting patches that covers the procedure, but for libstdc++
you should also send the patch to our mailing list in addition to the
GCC patches mailing list. The libstdc++ [93]contributors' page also
GCC patches mailing list. The libstdc++ [94]contributors' page also
talks about how to submit patches.
In addition to the description, the patch, and the ChangeLog entry, it
is a Good Thing if you can additionally create a small test program to
test for the presence of the bug that your patch fixes. Bugs have a
way of being reintroduced; if an old bug creeps back in, it will be
caught immediately by the [94]testsuite -- but only if such a test
caught immediately by the [95]testsuite -- but only if such a test
exists.
_________________________________________________________________
@ -708,7 +673,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
libstdc++. Some of that is already happening, see 4.2. Some of
those changes are being predicted by the library maintainers, and
we add code to the library based on what the current proposed
resolution specifies. Those additions are listed in [95]the
resolution specifies. Those additions are listed in [96]the
extensions page.
2. Performance tuning. Lots of performance tuning. This too is
already underway for post-3.0 releases, starting with memory
@ -724,20 +689,21 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
type from C99.) Bugfixes and rewrites (to improve or fix thread
safety, for instance) will of course be a continuing task.
[96]This question about the next libstdc++ prompted some brief but
interesting [97]speculation.
[97]This question about the next libstdc++ prompted some brief but
interesting [98]speculation.
_________________________________________________________________
5.3 What about the STL from SGI?
The [98]STL from SGI, version 3.3, was the most recent merge of the
The [99]STL from SGI, version 3.3, was the most recent merge of the
STL codebase. The code in libstdc++ contains many fixes and changes,
and it is very likely that the SGI code is no longer under active
development. We expect that no future merges will take place.
In particular, string is not from SGI and makes no use of their "rope"
class (which is included as an optional extension), nor is valarray
and some others. Classes like vector<> are, however.
and some others. Classes like vector<> are, however we have made
significant changes to them since then.
The FAQ for SGI's STL (one jump off of their main page) is recommended
reading.
@ -779,7 +745,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
This is a bit cleaner than defining typedefs for all the
instantiations you might need.
Extensions to the library have [99]their own page.
Extensions to the library have [100]their own page.
_________________________________________________________________
5.5 [removed]
@ -790,15 +756,18 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
5.6 Is libstdc++-v3 thread-safe?
When the system's libc is itself thread-safe, a non-generic
implementation of atomicity.h exists for the architecture, and gcc
itself reports a thread model other than single; libstdc++-v3 strives
to be thread-safe. The user-code must guard against concurrent method
calls which may access any particular library object's state.
Typically, the application programmer may infer what object locks must
be held based on the objects referenced in a method call. Without
getting into great detail, here is an example which requires
user-level locks:
libstdc++-v3 strives to be thread-safe when all of the following
conditions are met:
* The system's libc is itself thread-safe,
* gcc -v reports a thread model other than 'single',
* [pre-3.3 only] a non-generic implementation of atomicity.h exists
for the architecture in question.
The user-code must guard against concurrent method calls which may
access any particular library object's state. Typically, the
application programmer may infer what object locks must be held based
on the objects referenced in a method call. Without getting into great
detail, here is an example which requires user-level locks:
library_class_a shared_object_a;
thread_main () {
@ -823,13 +792,14 @@ a
All library objects are safe to use in a multithreaded program as long
as each thread carefully locks out access by any other thread while it
uses any object visible to another thread. In general, this
requirement includes both read and write access to objects; unless
otherwise documented as safe, do not assume that two threads may
access a shared standard library object at the same time.
uses any object visible to another thread, i.e., treat library objects
like any other shared resource. In general, this requirement includes
both read and write access to objects; unless otherwise documented as
safe, do not assume that two threads may access a shared standard
library object at the same time.
See chapters [100]17 (library introduction), [101]23 (containers), and
[102]27 (I/O) for more information.
See chapters [101]17 (library introduction), [102]23 (containers), and
[103]27 (I/O) for more information.
_________________________________________________________________
5.7 How do I get a copy of the ISO C++ Standard?
@ -840,11 +810,11 @@ a
their two-meeting commitment for voting rights, may get a copy of the
standard from their respective national standards organization. In the
USA, this national standards organization is ANSI and their website is
right [103]here. (And if you've already registered with them, clicking
right [104]here. (And if you've already registered with them, clicking
this link will take you to directly to the place where you can
[104]buy the standard on-line.
[105]buy the standard on-line.
Who is your country's member body? Visit the [105]ISO homepage and
Who is your country's member body? Visit the [106]ISO homepage and
find out!
_________________________________________________________________
@ -895,8 +865,8 @@ a
encompasses the standard library.
_________________________________________________________________
See [106]license.html for copying conditions. Comments and suggestions
are welcome, and may be sent to [107]the libstdc++ mailing list.
See [107]license.html for copying conditions. Comments and suggestions
are welcome, and may be sent to [108]the libstdc++ mailing list.
References
@ -959,8 +929,8 @@ References
57. http://gcc.gnu.org/
58. http://gcc.gnu.org/gcc-3.0/buildstat.html
59. http://gcc.gnu.org/libstdc++/
60. http://gcc.gnu.org/libstdc++/index.html#download
61. http://gcc.gnu.org/libstdc++/
60. http://gcc.gnu.org/libstdc++/
61. http://gcc.gnu.org/releases.html
62. ../17_intro/contribute.html
63. http://www.boost.org/
64. http://gcc.gnu.org/extensions.html
@ -972,38 +942,39 @@ References
70. ../17_intro/RELEASE-NOTES
71. http://www.gnu.org/software/cvs/cvs.html
72. http://www.cvshome.org/
73. ../18_support/howto.html
74. http://gcc.gnu.org/cgi-bin/htsearch?method=and&format=builtin-long&sort=score&words=_XOPEN_SOURCE+Solaris
75. http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html
76. http://gcc.gnu.org/ml/libstdc++/2003-02/subjects.html#00286
77. http://gcc.gnu.org/install/configure.html
78. http://gcc.gnu.org/install/
79. http://gcc.gnu.org/bugs.html
80. http://gcc.gnu.org/ml/libstdc++/2002-02/msg00034.html
81. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
82. http://www.cantrip.org/draft-bugs.txt
83. http://anubis.dkuug.dk/jtc1/sc22/wg21/
84. ../faq/index.html#5_2
85. ../ext/howto.html#5
86. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
87. http://gcc.gnu.org/gnatswrite.html
88. ../faq/index.html#4_4_interface
89. ../19_diagnostics/howto.html#3
90. http://developer.kde.org/~sewardj/
91. ../debug.html#mem
92. http://gcc.gnu.org/contribute.html
93. ../17_intro/contribute.html
94. ../faq/index.html#2_4
95. ../ext/howto.html#5
96. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
97. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
98. http://www.sgi.com/Technology/STL/
99. ../ext/howto.html
100. ../17_intro/howto.html#3
101. ../23_containers/howto.html#3
102. ../27_io/howto.html#9
103. http://www.ansi.org/
104. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
105. http://www.iso.ch/
106. ../17_intro/license.html
107. mailto:libstdc++@gcc.gnu.org
73. http://gcc.gnu.org/install/test.html
74. ../18_support/howto.html
75. http://gcc.gnu.org/cgi-bin/htsearch?method=and&format=builtin-long&sort=score&words=_XOPEN_SOURCE+Solaris
76. http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html
77. http://gcc.gnu.org/ml/libstdc++/2003-02/subjects.html#00286
78. http://gcc.gnu.org/install/configure.html
79. http://gcc.gnu.org/install/
80. http://gcc.gnu.org/bugs.html
81. http://gcc.gnu.org/ml/libstdc++/2002-02/msg00034.html
82. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
83. http://www.cantrip.org/draft-bugs.txt
84. http://anubis.dkuug.dk/jtc1/sc22/wg21/
85. ../faq/index.html#5_2
86. ../ext/howto.html#5
87. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
88. http://gcc.gnu.org/gnatswrite.html
89. ../faq/index.html#4_4_interface
90. ../19_diagnostics/howto.html#3
91. http://developer.kde.org/~sewardj/
92. ../debug.html#mem
93. http://gcc.gnu.org/contribute.html
94. ../17_intro/contribute.html
95. ../faq/index.html#2_4
96. ../ext/howto.html#5
97. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
98. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
99. http://www.sgi.com/Technology/STL/
100. ../ext/howto.html
101. ../17_intro/howto.html#3
102. ../23_containers/howto.html#3
103. ../27_io/howto.html#9
104. http://www.ansi.org/
105. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
106. http://www.iso.ch/
107. ../17_intro/license.html
108. mailto:libstdc++@gcc.gnu.org