Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libstdc++-v3 / doc / xml / manual / intro.xml
1 <part xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual.intro" xreflabel="Introduction">
2 <?dbhtml filename="intro.html"?>
3
4 <info><title>
5   Introduction
6   <indexterm><primary>Introduction</primary></indexterm>
7 </title>
8   <keywordset>
9     <keyword>ISO C++</keyword>
10     <keyword>library</keyword>
11   </keywordset>
12 </info>
13
14
15 <!-- Chapter 01 : Status -->
16 <chapter xml:id="manual.intro.status" xreflabel="Status"><info><title>Status</title></info>
17   <?dbhtml filename="status.html"?>
18   
19
20   <!-- Section 01 : Implementation Status -->
21   <section xml:id="manual.intro.status.iso" xreflabel="Status"><info><title>Implementation Status</title></info>
22     
23
24     <!-- Section 01.1 : Status C++ 1998 -->
25     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx1998.xml">
26     </xi:include>
27
28     <!-- Section 01.2 : Status C++ 2011 -->
29     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx2011.xml">
30     </xi:include>
31
32     <!-- Section 01.3 : Status C++ TR1 -->
33     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxxtr1.xml">
34     </xi:include>
35
36     <!-- Section 01.4 : Status C++ TR24733 -->
37     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxxtr24733.xml">
38     </xi:include>
39   </section>
40
41   <!-- Section 02 : License -->
42   <section xml:id="manual.intro.status.license" xreflabel="License"><info><title>License</title></info>
43     <?dbhtml filename="license.html"?>
44     
45     <para>
46     There are two licenses affecting GNU libstdc++: one for the code,
47     and one for the documentation.
48     </para>
49
50     <para>
51       There is a license section in the FAQ regarding common <link linkend="faq.license">questions</link>. If you have more
52       questions, ask the FSF or the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/lists.html">gcc mailing list</link>.
53     </para>
54
55     <section xml:id="manual.intro.status.license.gpl" xreflabel="License GPL"><info><title>The Code: GPL</title></info>
56     
57
58     <para>
59       The source code is distributed under the <link linkend="appendix.gpl-3.0">GNU General Public License version 3</link>,
60       with the addition under section 7 of an exception described in
61       the <quote>GCC Runtime Library Exception, version 3.1</quote>
62       as follows (or see the file COPYING.RUNTIME):
63     </para>
64
65     <literallayout class="normal">
66 GCC RUNTIME LIBRARY EXCEPTION
67
68 Version 3.1, 31 March 2009
69
70 Copyright (C) 2009 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">Free Software Foundation, Inc.</link>
71
72 Everyone is permitted to copy and distribute verbatim copies of this
73 license document, but changing it is not allowed.
74
75 This GCC Runtime Library Exception ("Exception") is an additional
76 permission under section 7 of the GNU General Public License, version
77 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
78 bears a notice placed by the copyright holder of the file stating that
79 the file is governed by GPLv3 along with this Exception.
80
81 When you use GCC to compile a program, GCC may combine portions of
82 certain GCC header files and runtime libraries with the compiled
83 program. The purpose of this Exception is to allow compilation of
84 non-GPL (including proprietary) programs to use, in this way, the
85 header files and runtime libraries covered by this Exception.
86
87 0. Definitions.
88
89 A file is an "Independent Module" if it either requires the Runtime
90 Library for execution after a Compilation Process, or makes use of an
91 interface provided by the Runtime Library, but is not otherwise based
92 on the Runtime Library.
93
94 "GCC" means a version of the GNU Compiler Collection, with or without
95 modifications, governed by version 3 (or a specified later version) of
96 the GNU General Public License (GPL) with the option of using any
97 subsequent versions published by the FSF.
98
99 "GPL-compatible Software" is software whose conditions of propagation,
100 modification and use would permit combination with GCC in accord with
101 the license of GCC.
102
103 "Target Code" refers to output from any compiler for a real or virtual
104 target processor architecture, in executable form or suitable for
105 input to an assembler, loader, linker and/or execution
106 phase. Notwithstanding that, Target Code does not include data in any
107 format that is used as a compiler intermediate representation, or used
108 for producing a compiler intermediate representation.
109
110 The "Compilation Process" transforms code entirely represented in
111 non-intermediate languages designed for human-written code, and/or in
112 Java Virtual Machine byte code, into Target Code. Thus, for example,
113 use of source code generators and preprocessors need not be considered
114 part of the Compilation Process, since the Compilation Process can be
115 understood as starting with the output of the generators or
116 preprocessors.
117
118 A Compilation Process is "Eligible" if it is done using GCC, alone or
119 with other GPL-compatible software, or if it is done without using any
120 work based on GCC. For example, using non-GPL-compatible Software to
121 optimize any GCC intermediate representations would not qualify as an
122 Eligible Compilation Process.
123
124 1. Grant of Additional Permission.
125
126 You have permission to propagate a work of Target Code formed by
127 combining the Runtime Library with Independent Modules, even if such
128 propagation would otherwise violate the terms of GPLv3, provided that
129 all Target Code was generated by Eligible Compilation Processes. You
130 may then convey such a combination under terms of your choice,
131 consistent with the licensing of the Independent Modules.
132
133 2. No Weakening of GCC Copyleft.
134
135 The availability of this Exception does not imply any general
136 presumption that third-party software is unaffected by the copyleft
137 requirements of the license of GCC.
138     </literallayout>
139
140     <para>
141       Hopefully that text is self-explanatory.  If it isn't, you need to speak
142       to your lawyer, or the Free Software Foundation.
143     </para>
144     </section>
145
146     <section xml:id="manual.intro.status.license.fdl" xreflabel="License FDL"><info><title>The Documentation: GPL, FDL</title></info>
147     
148
149     <para>
150       The documentation shipped with the library and made available over
151       the web, excluding the pages generated from source comments, are
152       copyrighted by the Free Software Foundation, and placed under the
153       <link linkend="appendix.gfdl-1.3"> GNU Free Documentation
154       License version 1.3</link>.  There are no Front-Cover Texts, no
155       Back-Cover Texts, and no Invariant Sections.
156     </para>
157
158     <para>
159       For documentation generated by doxygen or other automated tools
160       via processing source code comments and markup, the original source
161       code license applies to the generated files. Thus, the doxygen
162       documents are licensed <link linkend="appendix.gpl-3.0">GPL</link>.
163     </para>
164
165     <para>
166       If you plan on making copies of the documentation, please let us know.
167       We can probably offer suggestions.
168     </para>
169     </section>
170
171   </section>
172
173   <!-- Section 03 : Known Bugs -->
174   <section xml:id="manual.intro.status.bugs" xreflabel="Bugs"><info><title>Bugs</title></info>
175     <?dbhtml filename="bugs.html"?>
176     
177
178     <section xml:id="manual.intro.status.bugs.impl" xreflabel="Bugs impl"><info><title>Implementation Bugs</title></info>
179       
180     <para>
181       Information on known bugs, details on efforts to fix them, and
182       fixed bugs are all available as part of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs/">GCC bug tracking system</link>,
183       with the category set to <literal>libstdc++</literal>.
184     </para>
185     </section>
186
187     <section xml:id="manual.intro.status.bugs.iso" xreflabel="Bugs iso"><info><title>Standard Bugs</title></info>
188       
189       <para>
190         Everybody's got issues.  Even the C++ Standard Library.
191       </para>
192       <para>
193         The Library Working Group, or LWG, is the ISO subcommittee responsible
194         for making changes to the library.  They periodically publish an
195         Issues List containing problems and possible solutions.  As they reach
196         a consensus on proposed solutions, we often incorporate the solution.
197       </para>
198       <para>
199         Here are the issues which have resulted in code changes to the library.
200         The links are to the specific defect reports from a <emphasis>partial
201         copy</emphasis> of the Issues List.  You can read the full version online
202         at the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">ISO C++
203         Committee homepage</link>, linked to on the
204         <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/readings.html">GCC "Readings"
205         page</link>.  If
206         you spend a lot of time reading the issues, we recommend downloading
207         the ZIP file and reading them locally.
208       </para>
209       <para>
210         (NB: <emphasis>partial copy</emphasis> means that not all
211         links within the lwg-*.html pages will work.  Specifically,
212         links to defect reports that have not been accorded full DR
213         status will probably break.  Rather than trying to mirror the
214         entire issues list on our overworked web server, we recommend
215         you go to the LWG homepage instead.)
216       </para>
217       <para>
218         If a DR is not listed here, we may simply not have gotten to
219         it yet; feel free to submit a patch.  Search the include/bits
220         and src directories for appearances of
221         <constant>_GLIBCXX_RESOLVE_LIB_DEFECTS</constant> for examples
222         of style.  Note that we usually do not make changes to the
223         code until an issue has reached <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-active.html#DR">DR</link> status.
224       </para>
225
226       <variablelist>
227     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#5">5</link>:
228         <emphasis>string::compare specification questionable</emphasis>
229     </term>
230     <listitem><para>This should be two overloaded functions rather than a single function.
231     </para></listitem></varlistentry>
232
233     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#17">17</link>:
234         <emphasis>Bad bool parsing</emphasis>
235     </term>
236     <listitem><para>Apparently extracting Boolean values was messed up...
237     </para></listitem></varlistentry>
238
239     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#19">19</link>:
240         <emphasis>"Noconv" definition too vague</emphasis>
241     </term>
242     <listitem><para>If <code>codecvt::do_in</code> returns <code>noconv</code> there are
243         no changes to the values in <code>[to, to_limit)</code>.
244     </para></listitem></varlistentry>
245
246     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#22">22</link>:
247         <emphasis>Member open vs flags</emphasis>
248     </term>
249     <listitem><para>Re-opening a file stream does <emphasis>not</emphasis> clear the state flags.
250     </para></listitem></varlistentry>
251
252     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#23">23</link>:
253         <emphasis>Num_get overflow result</emphasis>
254     </term>
255     <listitem><para>Implement the proposed resolution.
256     </para></listitem></varlistentry>
257
258     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#25">25</link>:
259         <emphasis>String operator&lt;&lt; uses width() value wrong</emphasis>
260     </term>
261     <listitem><para>Padding issues.
262     </para></listitem></varlistentry>
263
264     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#48">48</link>:
265         <emphasis>Use of non-existent exception constructor</emphasis>
266     </term>
267     <listitem><para>An instance of <code>ios_base::failure</code> is constructed instead.
268     </para></listitem></varlistentry>
269
270     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#49">49</link>:
271         <emphasis>Underspecification of ios_base::sync_with_stdio</emphasis>
272     </term>
273     <listitem><para>The return type is the <emphasis>previous</emphasis> state of synchronization.
274     </para></listitem></varlistentry>
275
276     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#50">50</link>:
277         <emphasis>Copy constructor and assignment operator of ios_base</emphasis>
278     </term>
279     <listitem><para>These members functions are declared <code>private</code> and are
280         thus inaccessible.  Specifying the correct semantics of
281         "copying stream state" was deemed too complicated.
282     </para></listitem></varlistentry>
283
284     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#60">60</link>:
285         <emphasis>What is a formatted input function?</emphasis>
286     </term>
287     <listitem><para>This DR made many widespread changes to <code>basic_istream</code>
288         and <code>basic_ostream</code> all of which have been implemented.
289     </para></listitem></varlistentry>
290
291     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#63">63</link>:
292         <emphasis>Exception-handling policy for unformatted output</emphasis>
293     </term>
294     <listitem><para>Make the policy consistent with that of formatted input, unformatted
295         input, and formatted output.
296     </para></listitem></varlistentry>
297
298     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#68">68</link>:
299         <emphasis>Extractors for char* should store null at end</emphasis>
300     </term>
301     <listitem><para>And they do now.  An editing glitch in the last item in the list of
302         [27.6.1.2.3]/7.
303     </para></listitem></varlistentry>
304
305     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#74">74</link>:
306         <emphasis>Garbled text for codecvt::do_max_length</emphasis>
307     </term>
308     <listitem><para>The text of the standard was gibberish.  Typos gone rampant.
309     </para></listitem></varlistentry>
310
311     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#75">75</link>:
312         <emphasis>Contradiction in codecvt::length's argument types</emphasis>
313     </term>
314     <listitem><para>Change the first parameter to <code>stateT&amp;</code> and implement
315         the new effects paragraph.
316     </para></listitem></varlistentry>
317
318     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#83">83</link>:
319         <emphasis>string::npos vs. string::max_size()</emphasis>
320     </term>
321     <listitem><para>Safety checks on the size of the string should test against
322         <code>max_size()</code> rather than <code>npos</code>.
323     </para></listitem></varlistentry>
324
325     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#90">90</link>:
326         <emphasis>Incorrect description of operator&gt;&gt; for strings</emphasis>
327     </term>
328     <listitem><para>The effect contain <code>isspace(c,getloc())</code> which must be
329         replaced by <code>isspace(c,is.getloc())</code>.
330     </para></listitem></varlistentry>
331
332     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#91">91</link>:
333         <emphasis>Description of operator&gt;&gt; and getline() for string&lt;&gt;
334             might cause endless loop</emphasis>
335     </term>
336     <listitem><para>They behave as a formatted input function and as an unformatted
337         input function, respectively (except that <code>getline</code> is
338         not required to set <code>gcount</code>).
339     </para></listitem></varlistentry>
340
341     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#103">103</link>:
342         <emphasis>set::iterator is required to be modifiable, but this allows
343             modification of keys.</emphasis>
344     </term>
345     <listitem><para>For associative containers where the value type is the same as
346         the key type, both <code>iterator</code> and <code>const_iterator
347         </code> are constant iterators.
348     </para></listitem></varlistentry>
349
350     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#109">109</link>:
351         <emphasis>Missing binders for non-const sequence elements</emphasis>
352     </term>
353     <listitem><para>The <code>binder1st</code> and <code>binder2nd</code> didn't have an
354         <code>operator()</code> taking a non-const parameter.
355     </para></listitem></varlistentry>
356
357     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#110">110</link>:
358         <emphasis>istreambuf_iterator::equal not const</emphasis>
359     </term>
360     <listitem><para>This was not a const member function.  Note that the DR says to
361         replace the function with a const one; we have instead provided an
362         overloaded version with identical contents.
363     </para></listitem></varlistentry>
364
365     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#117">117</link>:
366         <emphasis>basic_ostream uses nonexistent num_put member functions</emphasis>
367     </term>
368     <listitem><para><code>num_put::put()</code> was overloaded on the wrong types.
369     </para></listitem></varlistentry>
370
371     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#118">118</link>:
372         <emphasis>basic_istream uses nonexistent num_get member functions</emphasis>
373     </term>
374     <listitem><para>Same as 117, but for <code>num_get::get()</code>.
375     </para></listitem></varlistentry>
376
377     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#129">129</link>:
378         <emphasis>Need error indication from seekp() and seekg()</emphasis>
379     </term>
380     <listitem><para>These functions set <code>failbit</code> on error now.
381     </para></listitem></varlistentry>
382
383     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#130">130</link>:
384         <emphasis>Return type of container::erase(iterator) differs for associative containers</emphasis>
385     </term>
386     <listitem><para>Make member <code>erase</code> return iterator for <code>set</code>, <code>multiset</code>, <code>map</code>, <code>multimap</code>.
387     </para></listitem></varlistentry>
388
389     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#136">136</link>:
390         <emphasis>seekp, seekg setting wrong streams?</emphasis>
391     </term>
392     <listitem><para><code>seekp</code> should only set the output stream, and
393         <code>seekg</code> should only set the input stream.
394     </para></listitem></varlistentry>
395
396 <!--<varlistentry><term><ulink url="../ext/lwg-defects.html#159">159</ulink>:
397         <emphasis>Strange use of underflow()</emphasis>
398     </term>
399     <listitem><para>In fstream.tcc, the basic_filebuf&lt;&gt;::showmanyc() function
400         should probably not be calling <code>underflow()</code>.
401     </para></listitem></varlistentry> -->
402
403     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#167">167</link>:
404         <emphasis>Improper use of traits_type::length()</emphasis>
405     </term>
406     <listitem><para><code>op&lt;&lt;</code> with a <code>const char*</code> was
407         calculating an incorrect number of characters to write.
408     </para></listitem></varlistentry>
409
410     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#169">169</link>:
411         <emphasis>Bad efficiency of overflow() mandated</emphasis>
412     </term>
413     <listitem><para>Grow efficiently the internal array object.
414     </para></listitem></varlistentry>
415
416     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#171">171</link>:
417         <emphasis>Strange seekpos() semantics due to joint position</emphasis>
418     </term>
419     <listitem><para>Quite complex to summarize...
420     </para></listitem></varlistentry>
421
422     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#181">181</link>:
423         <emphasis>make_pair() unintended behavior</emphasis>
424     </term>
425     <listitem><para>This function used to take its arguments as reference-to-const, now
426         it copies them (pass by value).
427     </para></listitem></varlistentry>
428
429     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#195">195</link>:
430         <emphasis>Should basic_istream::sentry's constructor ever set eofbit?</emphasis>
431     </term>
432     <listitem><para>Yes, it can, specifically if EOF is reached while skipping whitespace.
433     </para></listitem></varlistentry>
434
435     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#211">211</link>:
436         <emphasis>operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</emphasis>
437     </term>
438     <listitem><para>If nothing is extracted into the string, <code>op&gt;&gt;</code> now
439         sets <code>failbit</code> (which can cause an exception, etc., etc.).
440     </para></listitem></varlistentry>
441
442     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#214">214</link>:
443         <emphasis>set::find() missing const overload</emphasis>
444     </term>
445     <listitem><para>Both <code>set</code> and <code>multiset</code> were missing
446         overloaded find, lower_bound, upper_bound, and equal_range functions
447         for const instances.
448     </para></listitem></varlistentry>
449
450     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#231">231</link>:
451         <emphasis>Precision in iostream?</emphasis>
452     </term>
453     <listitem><para>For conversion from a floating-point type, <code>str.precision()</code>
454         is specified in the conversion specification.
455     </para></listitem></varlistentry>
456
457     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#233">233</link>:
458         <emphasis>Insertion hints in associative containers</emphasis>
459     </term>
460     <listitem><para>Implement N1780, first check before then check after, insert as close
461         to hint as possible.
462     </para></listitem></varlistentry>
463
464     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#235">235</link>:
465         <emphasis>No specification of default ctor for reverse_iterator</emphasis>
466     </term>
467     <listitem><para>The declaration of <code>reverse_iterator</code> lists a default constructor.
468         However, no specification is given what this constructor should do.
469     </para></listitem></varlistentry>
470
471     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#241">241</link>:
472         <emphasis>Does unique_copy() require CopyConstructible and Assignable?</emphasis>
473     </term>
474     <listitem><para>Add a helper for forward_iterator/output_iterator, fix the existing
475         one for input_iterator/output_iterator to not rely on Assignability.
476     </para></listitem></varlistentry>
477
478     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#243">243</link>:
479         <emphasis>get and getline when sentry reports failure</emphasis>
480     </term>
481     <listitem><para>Store a null character only if the character array has a non-zero size.
482     </para></listitem></varlistentry>
483
484     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#251">251</link>:
485         <emphasis>basic_stringbuf missing allocator_type</emphasis>
486     </term>
487     <listitem><para>This nested typedef was originally not specified.
488     </para></listitem></varlistentry>
489
490     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#253">253</link>:
491         <emphasis>valarray helper functions are almost entirely useless</emphasis>
492     </term>
493     <listitem><para>Make the copy constructor and copy-assignment operator declarations
494         public in gslice_array, indirect_array, mask_array, slice_array; provide
495         definitions.
496     </para></listitem></varlistentry>
497
498     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#265">265</link>:
499         <emphasis>std::pair::pair() effects overly restrictive</emphasis>
500     </term>
501     <listitem><para>The default ctor would build its members from copies of temporaries;
502         now it simply uses their respective default ctors.
503     </para></listitem></varlistentry>
504
505     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#266">266</link>:
506         <emphasis>bad_exception::~bad_exception() missing Effects clause</emphasis>
507     </term>
508     <listitem><para>The <code>bad_</code>* classes no longer have destructors (they
509         are trivial), since no description of them was ever given.
510     </para></listitem></varlistentry>
511
512     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#271">271</link>:
513         <emphasis>basic_iostream missing typedefs</emphasis>
514     </term>
515     <listitem><para>The typedefs it inherits from its base classes can't be used, since
516         (for example) <code>basic_iostream&lt;T&gt;::traits_type</code> is ambiguous.
517     </para></listitem></varlistentry>
518
519     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#275">275</link>:
520         <emphasis>Wrong type in num_get::get() overloads</emphasis>
521     </term>
522     <listitem><para>Similar to 118.
523     </para></listitem></varlistentry>
524
525     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#280">280</link>:
526         <emphasis>Comparison of reverse_iterator to const reverse_iterator</emphasis>
527     </term>
528     <listitem><para>Add global functions with two template parameters.
529         (NB: not added for now a templated assignment operator)
530     </para></listitem></varlistentry>
531
532     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#292">292</link>:
533         <emphasis>Effects of a.copyfmt (a)</emphasis>
534     </term>
535     <listitem><para>If <code>(this == &amp;rhs)</code> do nothing.
536     </para></listitem></varlistentry>
537
538     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#300">300</link>:
539         <emphasis>List::merge() specification incomplete</emphasis>
540     </term>
541     <listitem><para>If <code>(this == &amp;x)</code> do nothing.
542     </para></listitem></varlistentry>
543
544     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#303">303</link>:
545         <emphasis>Bitset input operator underspecified</emphasis>
546     </term>
547     <listitem><para>Basically, compare the input character to
548                     <code>is.widen(0)</code> and <code>is.widen(1)</code>.
549     </para></listitem></varlistentry>
550
551     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#305">305</link>:
552         <emphasis>Default behavior of codecvt&lt;wchar_t, char,
553                   mbstate_t&gt;::length()</emphasis>
554     </term>
555     <listitem><para>Do not specify what <code>codecvt&lt;wchar_t, char,
556                     mbstate_t&gt;::do_length</code> must return.
557     </para></listitem></varlistentry>
558
559     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#328">328</link>:
560         <emphasis>Bad sprintf format modifier in
561                   money_put&lt;&gt;::do_put()</emphasis>
562     </term>
563     <listitem><para>Change the format string to "%.0Lf".
564     </para></listitem></varlistentry>
565
566     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#365">365</link>:
567         <emphasis>Lack of const-qualification in clause 27</emphasis>
568     </term>
569     <listitem><para>Add const overloads of <code>is_open</code>.
570     </para></listitem></varlistentry>
571
572     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#387">387</link>:
573         <emphasis>std::complex over-encapsulated</emphasis>
574     </term>
575     <listitem><para>Add the <code>real(T)</code> and <code>imag(T)</code>
576                     members;  in C++11 mode, also adjust the existing
577                     <code>real()</code> and <code>imag()</code> members and
578                     free functions.
579     </para></listitem></varlistentry>
580
581     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#389">389</link>:
582         <emphasis>Const overload of valarray::operator[] returns
583                   by value</emphasis>
584     </term>
585     <listitem><para>Change it to return a <code>const T&amp;</code>.
586     </para></listitem></varlistentry>
587
588     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#396">396</link>:
589         <emphasis>what are characters zero and one</emphasis>
590     </term>
591     <listitem><para>Implement the proposed resolution.
592     </para></listitem></varlistentry>
593
594     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#402">402</link>:
595         <emphasis>Wrong new expression in [some_]allocator::construct</emphasis>
596     </term>
597     <listitem><para>Replace "new" with "::new".
598     </para></listitem></varlistentry>
599
600     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#408">408</link>:
601         <emphasis>
602         Is vector&lt;reverse_iterator&lt;char*&gt; &gt; forbidden?
603         </emphasis>
604     </term>
605     <listitem><para>Tweak the debug-mode checks in _Safe_iterator.
606     </para></listitem></varlistentry>
607
608     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#409">409</link>:
609         <emphasis>Closing an fstream should clear the error state</emphasis>
610     </term>
611     <listitem><para>Have <code>open</code> clear the error flags.
612     </para></listitem></varlistentry>
613
614     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#431">431</link>:
615         <emphasis>Swapping containers with unequal allocators</emphasis>
616     </term>
617     <listitem><para>Implement Option 3, as per N1599.
618     </para></listitem></varlistentry>
619
620     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#432">432</link>:
621         <emphasis>stringbuf::overflow() makes only one write position
622             available</emphasis>
623     </term>
624     <listitem><para>Implement the resolution, beyond DR 169.
625     </para></listitem></varlistentry>
626
627     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#434">434</link>:
628         <emphasis>bitset::to_string() hard to use</emphasis>
629     </term>
630     <listitem><para>Add three overloads, taking fewer template arguments.
631     </para></listitem></varlistentry>
632
633     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#438">438</link>:
634         <emphasis>Ambiguity in the "do the right thing" clause</emphasis>
635     </term>
636     <listitem><para>Implement the resolution, basically cast less.
637     </para></listitem></varlistentry>
638
639     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#453">453</link>:
640         <emphasis>basic_stringbuf::seekoff need not always fail for an empty stream</emphasis>
641     </term>
642     <listitem><para>Don't fail if the next pointer is null and newoff is zero.
643     </para></listitem></varlistentry>
644
645     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#455">455</link>:
646         <emphasis>cerr::tie() and wcerr::tie() are overspecified</emphasis>
647     </term>
648     <listitem><para>Initialize cerr tied to cout and wcerr tied to wcout.
649     </para></listitem></varlistentry>
650
651     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#464">464</link>:
652         <emphasis>Suggestion for new member functions in standard containers</emphasis>
653     </term>
654     <listitem><para>Add <code>data()</code> to <code>std::vector</code> and
655         <code>at(const key_type&amp;)</code> to <code>std::map</code>.
656     </para></listitem></varlistentry>
657
658     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#508">508</link>:
659         <emphasis>Bad parameters for ranlux64_base_01</emphasis>
660     </term>
661     <listitem><para>Fix the parameters.
662     </para></listitem></varlistentry>
663
664     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#512">512</link>:
665         <emphasis>Seeding subtract_with_carry_01 from a single unsigned long</emphasis>
666     </term>
667     <listitem><para>Construct a <code>linear_congruential</code> engine and seed with it.
668     </para></listitem></varlistentry>
669
670     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#526">526</link>:
671         <emphasis>Is it undefined if a function in the standard changes in
672             parameters?</emphasis>
673     </term>
674     <listitem><para>Use &amp;value.
675     </para></listitem></varlistentry>
676
677     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#538">538</link>:
678         <emphasis>241 again: Does unique_copy() require CopyConstructible
679             and Assignable?</emphasis>
680     </term>
681     <listitem><para>In case of input_iterator/output_iterator rely on Assignability of
682         input_iterator' value_type.
683     </para></listitem></varlistentry>
684
685     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#539">539</link>:
686         <emphasis>partial_sum and adjacent_difference should mention
687             requirements</emphasis>
688     </term>
689     <listitem><para>We were almost doing the right thing, just use std::move
690         in adjacent_difference.
691     </para></listitem></varlistentry>
692
693     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#541">541</link>:
694         <emphasis>shared_ptr template assignment and void</emphasis>
695     </term>
696     <listitem><para>Add an auto_ptr&lt;void&gt; specialization.
697     </para></listitem></varlistentry>
698
699     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#543">543</link>:
700         <emphasis>valarray slice default constructor</emphasis>
701     </term>
702     <listitem><para>Follow the straightforward proposed resolution.
703     </para></listitem></varlistentry>
704
705     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#550">550</link>:
706         <emphasis>What should the return type of pow(float,int) be?</emphasis>
707     </term>
708     <listitem><para>In C++11 mode, remove the pow(float,int), etc., signatures.
709     </para></listitem></varlistentry>
710
711     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#586">586</link>:
712         <emphasis>string inserter not a formatted function</emphasis>
713     </term>
714     <listitem><para>Change it to be a formatted output function (i.e. catch exceptions).
715     </para></listitem></varlistentry>
716
717     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#596">596</link>:
718         <emphasis>27.8.1.3 Table 112 omits "a+" and "a+b" modes</emphasis>
719     </term>
720     <listitem><para>Add the missing modes to fopen_mode.
721     </para></listitem></varlistentry>
722
723     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#630">630</link>:
724         <emphasis>arrays of valarray</emphasis>
725     </term>
726     <listitem><para>Implement the simple resolution.
727     </para></listitem></varlistentry>
728
729     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#660">660</link>:
730         <emphasis>Missing bitwise operations</emphasis>
731     </term>
732     <listitem><para>Add the missing operations.
733     </para></listitem></varlistentry>
734
735     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#691">691</link>:
736         <emphasis>const_local_iterator cbegin, cend missing from TR1</emphasis>
737     </term>
738     <listitem><para>In C++11 mode add cbegin(size_type) and cend(size_type)
739                     to the unordered containers.
740     </para></listitem></varlistentry>
741
742     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#693">693</link>:
743         <emphasis>std::bitset::all() missing</emphasis>
744     </term>
745     <listitem><para>Add it, consistently with the discussion.
746     </para></listitem></varlistentry>
747
748     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#695">695</link>:
749         <emphasis>ctype&lt;char&gt;::classic_table() not accessible</emphasis>
750     </term>
751     <listitem><para>Make the member functions table and classic_table public.
752     </para></listitem></varlistentry>
753
754     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#696">696</link>:
755         <emphasis>istream::operator&gt;&gt;(int&amp;) broken</emphasis>
756     </term>
757     <listitem><para>Implement the straightforward resolution.
758     </para></listitem></varlistentry>
759
760     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#761">761</link>:
761         <emphasis>unordered_map needs an at() member function</emphasis>
762     </term>
763     <listitem><para>In C++11 mode, add at() and at() const.
764     </para></listitem></varlistentry>
765
766     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#775">775</link>:
767         <emphasis>Tuple indexing should be unsigned?</emphasis>
768     </term>
769     <listitem><para>Implement the int -&gt; size_t replacements.
770     </para></listitem></varlistentry>
771
772     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#776">776</link>:
773         <emphasis>Undescribed assign function of std::array</emphasis>
774     </term>
775     <listitem><para>In C++11 mode, remove assign, add fill.
776     </para></listitem></varlistentry>
777
778     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#781">781</link>:
779         <emphasis>std::complex should add missing C99 functions</emphasis>
780     </term>
781     <listitem><para>In C++11 mode, add std::proj.
782     </para></listitem></varlistentry>
783
784     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#809">809</link>:
785         <emphasis>std::swap should be overloaded for array types</emphasis>
786     </term>
787     <listitem><para>Add the overload.
788     </para></listitem></varlistentry>
789
790     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#844">844</link>:
791         <emphasis>complex pow return type is ambiguous</emphasis>
792     </term>
793     <listitem><para>In C++11 mode, remove the pow(complex&lt;T&gt;, int) signature.
794     </para></listitem></varlistentry>
795
796     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#853">853</link>:
797         <emphasis>to_string needs updating with zero and one</emphasis>
798     </term>
799     <listitem><para>Update / add the signatures.
800     </para></listitem></varlistentry>
801
802     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#865">865</link>:
803         <emphasis>More algorithms that throw away information</emphasis>
804     </term>
805     <listitem><para>The traditional HP / SGI return type and value is blessed
806                     by the resolution of the DR.
807     </para></listitem></varlistentry>
808   </variablelist>
809
810  </section>
811   </section>
812 </chapter>
813
814
815 <!-- Chapter 02 : Setup -->
816 <chapter xml:id="manual.intro.setup" xreflabel="Setup"><info><title>Setup</title></info>
817   <?dbhtml filename="setup.html"?>
818   
819
820    <para>To transform libstdc++ sources into installed include files
821    and properly built binaries useful for linking to other software is
822    a multi-step process. Steps include getting the sources,
823    configuring and building the sources, testing, and installation.
824    </para>
825
826    <para>The general outline of commands is something like:
827    </para>
828
829    <programlisting>
830    <emphasis>get gcc sources</emphasis>
831    <emphasis>extract into gccsrcdir</emphasis>
832    mkdir <emphasis>gccbuilddir</emphasis>
833    cd <emphasis>gccbuilddir</emphasis>
834    <emphasis>gccsrcdir</emphasis>/configure --prefix=<emphasis>destdir</emphasis> --other-opts...
835    make
836    make check
837    make install
838    </programlisting>
839
840    <para>
841      Each step is described in more detail in the following sections.
842    </para>
843
844   <!-- Section 01 : Prerequisites -->
845   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="prerequisites.xml">
846   </xi:include>
847
848   <!-- Section 02 : Configure -->
849   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="configure.xml">
850   </xi:include>
851
852   <!-- Section 03 : Make -->
853 <section xml:id="manual.intro.setup.make" xreflabel="Make"><info><title>Make</title></info>
854   <?dbhtml filename="make.html"?>
855
856    <para>If you have never done this before, you should read the basic
857       <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/">GCC Installation
858       Instructions</link> first.  Read <emphasis>all of them</emphasis>.
859       <emphasis>Twice.</emphasis>
860    </para>
861
862 <para>Then type: <command>make</command>, and congratulations, you've
863 started to build.
864 </para>
865
866 </section>
867
868 </chapter>
869
870 <!-- Chapter 03 : Using -->
871 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="using.xml">
872 </xi:include>
873
874 </part>