Commit 037cfe71 by Phil Edwards

user.cfg.in: Also document deprecated entries.

2002-03-06  Phil Edwards  <pme@gcc.gnu.org>

	* docs/doxygen/user.cfg.in:  Also document deprecated entries.
	* docs/html/Makefile:  Example rule to rebuild porting-howto.html.
	* docs/html/17_intro/howto.html:  "gcc"->"GCC" changes, when
	referring to the collection as a whole.  New section on which macros
	can be redefined by the user.
	* docs/html/19_diagnostics/howto.html:  Update note for concepts.
	* docs/html/20_util/howto.html:  Update link to SGI.
	* docs/html/faq/index.html:  Update snapshot versions.  New entry
	on why g++ (but not gcc) must currently predefine certain macros.
	* docs/html/faq/index.txt:  Regenerated.

	* include/bits/basic_string.h (basic_string::_S_construct):  Fix
	names in declaration.
	(basic_string::compare):  These are no longer optional.
	* include/bits/ostream.tcc:  Tweak closing brace placement.
	* include/bits/stl_algo.h:  Lots of initial doxygen comment hooks.
	* include/std/std_sstream.h:  Fix typo in comment.
	* include/bits/locale_facets.tcc:  Remove unneeded header inclusion.
	* src/locale.cc:  Likewise.

From-SVN: r50376
parent d95336cf
2002-03-06 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/user.cfg.in: Also document deprecated entries.
* docs/html/Makefile: Example rule to rebuild porting-howto.html.
* docs/html/17_intro/howto.html: "gcc"->"GCC" changes, when
referring to the collection as a whole. New section on which macros
can be redefined by the user.
* docs/html/19_diagnostics/howto.html: Update note for concepts.
* docs/html/20_util/howto.html: Update link to SGI.
* docs/html/faq/index.html: Update snapshot versions. New entry
on why g++ (but not gcc) must currently predefine certain macros.
* docs/html/faq/index.txt: Regenerated.
* include/bits/basic_string.h (basic_string::_S_construct): Fix
names in declaration.
(basic_string::compare): These are no longer optional.
* include/bits/ostream.tcc: Tweak closing brace placement.
* include/bits/stl_algo.h: Lots of initial doxygen comment hooks.
* include/std/std_sstream.h: Fix typo in comment.
* include/bits/locale_facets.tcc: Remove unneeded header inclusion.
* src/locale.cc: Likewise.
2002-03-06 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/5734
* include/bits/stl_vector.h (vector::push_back()): Guard with
_GLIBCPP_DEPRECATED.
......
......@@ -703,7 +703,7 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED =
PREDEFINED = _GLIBCPP_DEPRECATED
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
......
......@@ -29,6 +29,7 @@
<li><a href="#4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a>
<li><a href="porting-howto.html">Porting HOWTO</a>
<li><a href="#5">Behavior specific to libstdc++-v3</a>
<li><a href="#6">Preprocessor macros controlling the library</a>
</ul>
<hr>
......@@ -54,20 +55,20 @@
<h2><a name="3">The Standard C++ library and multithreading</a></h2>
<p>This section discusses issues surrounding the proper compilation
of multithreaded applications which use the Standard C++
library. This information is gcc-specific since the C++
library. This information is GCC-specific since the C++
standard does not address matters of multithreaded applications.
Unless explicitly prefaced, all information in this section is
current as of the gcc 3.0 release and all later point releases.
current as of the GCC 3.0 release and all later point releases.
</p>
<p>Earlier gcc releases had a somewhat different approach to
threading configuration and proper compilation. Before gcc 3.0,
<p>Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
command-line options and macros (both of which were somewhat
thread-implementation and port-specific). There were no
guarantees related to being able to link code compiled with one
set of options and macro setting with another set. For gcc 3.0,
set of options and macro setting with another set. For GCC 3.0,
configuration of the threading model used with libraries and
user-code is performed when gcc is configured and built using
user-code is performed when GCC is configured and built using
the --enable-threads and --disable-threads options. The ABI is
stable for symbol name-mangling and limited functional
compatibility exists between code compiled under different
......@@ -83,9 +84,9 @@
with another thread model useful on the platform. Other mixes
may or may not work but are not considered supported. (Thus, if
you distribute a shared C++ library in binary form only, it may
be best to compile it with a gcc configured with
be best to compile it with a GCC configured with
--enable-threads for maximal interchangeability and usefulness
with a user population that may have built gcc with either
with a user population that may have built GCC with either
--enable-threads or --disable-threads.)
</p>
<p>When you link a multithreaded application, you will probably
......@@ -267,6 +268,71 @@
<a href="../faq/index.html">to the FAQ</a>.
</p>
<hr>
<h2><a name="6">Preprocessor macros controlling the library</a></h2>
<p>Some of the semantics of the libstdc++-v3 implementation are
controlled by preprocessor macros, both during build/installation and
during compilation of user code. Many of these choices are made when
the library is built and installed (actually, during
<a href="../configopts.html">the configuration step</a>, with the
various --enable/--disable choices being translated to #define/#undef).
</p>
<p>All library macros begin with <code>_GLIBCPP_</code>. The fact that
these symbols start with a leading underscore should give you a clue
that (by default) they aren't meant to be changed by the user. :-)
</p>
<p>These macros are all gathered in the file <code>c++config.h</code>,
which is generated during installation. <strong>You must assume that
these macros cannot be redefined by your own code</strong>, unless we
document otherwise here. Some of the choices control code which has
already been compiled (i.e., libstdc++.a/.so). If you explicitly
#define or #undef these macros, the <em>headers</em> may see different
code paths, but the <em>libraries</em> which you link against will not.
If you want to experiment with different values, you must change the
config headers before building/installing the library.
</p>
<p>Below are macros which, for 3.1 and later, you may change yourself,
in your own code with #define/#undef or with -D/-U compiler flags.
The default state of the symbol is listed. &quot;Configurable&quot;
(or &quot;Not configurable&quot;) means that the symbol is initially
chosen (or not) based on --enable/--disable options at configure time.
<dl>
<dt><code>_GLIBCPP_DEPRECATED</code></dt>
<dd>Undefined by default. Not configurable. Turning this on enables
older ARM-style iostreams code, and other anachronisms. This may be
useful in updating old C++ programs which no longer meet the
requirements of the language.
</dd>
<!--
Can this actually be turned off and still produce a working lib? Must
check. -pme
No, it can't. Hmmm. -pme
<dt><code>_GLIBCPP_RESOLVE_LIB_DEFECTS</code></dt>
<dd>Defined by default. Not configurable. The library follows
corrections and updates from the ISO committee, see
<a href="../faq/index.html#5_2">here</a> and
<a href="../ext/howto.html#5">here</a> for more on this feature.
If you have code which depends on the first version of the standard,
you might try undefining this macro.
</dd>
-->
<dt><code>_GLIBCPP_CONCEPT_CHECKS</code></dt>
<dd>Undefined by default. Configurable. When defined, performs
compile-time checking on certain template instantiations to detect
violations of the requirements of the standard. This is described
in more detail <a href="../19_diagnostics/howto.html#3">here</a>.
</dd>
<!--
<dt><code></code></dt>
<dd>
</dd>
-->
</dl>
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
</p>
<!-- ####################################################### -->
......
......@@ -102,6 +102,8 @@
<p>For GCC 3.0 and 3.1 they are off by default. They can be enabled at
configure time with
<a href="../configopts.html"><code>--enable-concept-checks</code></a>.
For 3.1 you can instead #define _GLIBCPP_CONCEPT_CHECKS to enable them
on a per-translation-unit basis.
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
......
......@@ -134,8 +134,8 @@
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as part of their STL, in
<a href="http://www.sgi.com/Technology/STL/functors.html">their
http://www.sgi.com/Technology/STL/functors.html</a>.
<a href="http://www.sgi.com/tech/stl/functors.html">their
http://www.sgi.com/tech/stl/functors.html</a>.
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
......
......@@ -2,7 +2,7 @@
MAKEINFO=makeinfo
INC=../../../gcc/doc/include
all: faq/index.txt 17_intro/porting.html
all: faq/index.txt 17_intro/porting.html 17_intro/porting-howto.html
faq/index.txt: faq/index.html
......@@ -11,3 +11,7 @@ faq/index.txt: faq/index.html
17_intro/porting.html: 17_intro/porting.texi
${MAKEINFO} -I ${INC} --html --no-split $< -o $@
# known to work under RH; this can be cleaned up later if needed
17_intro/porting-howto.html: 17_intro/porting-howto.xml
xltproc -o $@ /usr/share/xml/docbook/xsl-stylesheets-1.48-2/html/docbook.xsl $<
......@@ -59,6 +59,8 @@
<li><a href="#3_2">[removed]</a>
<li><a href="#3_3">[removed]</a>
<li><a href="#3_4">I can't use 'long long' on Solaris</a>
<li><a href="#3_5"><code>_XOPEN_SOURCE</code> /
<code>_GNU_SOURCE</code> / etc is always defined</a>
</ol>
<li><a href="#4_0">Known Bugs and Non-Bugs</a>
......@@ -109,7 +111,7 @@
library reaches stable plateaus, it is captured in a snapshot
and released. The current release is
<a href="http://gcc.gnu.org/libstdc++/download.html">the
thirteenth snapshot</a>. For those who want to see exactly how
fourteenth snapshot</a>. For those who want to see exactly how
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 below).
......@@ -165,7 +167,7 @@
<hr>
<h2><a name="1_4">1.4 How do I get libstdc++?</a></h2>
<p>The thirteenth (and latest) snapshot of libstdc++-v3 is
<p>The fourteenth (and latest) snapshot of libstdc++-v3 is
<a href="http://gcc.gnu.org/libstdc++/download.html">available via
ftp</a>.
</p>
......@@ -429,6 +431,44 @@ which is no longer available, thanks deja...-->
</p>
<hr>
<h2><a name="3_5">3.5 <code>_XOPEN_SOURCE</code> / <code>_GNU_SOURCE</code>
/ etc is always defined</a></h2>
<p>On Solaris, g++ (but not gcc) always defines the preprocessor
macro <code>_XOPEN_SOURCE</code>. On GNU/Linux, the same happens
with <code>_GNU_SOURCE</code>. (This is not an exhaustive list;
other macros and other platforms are also affected.)
</p>
<p>These macros are typically used in C library headers, guarding new
versions of functions from their older versions. The C++ standard
library includes the C standard library, but it requires the C90
version, which for backwards-compatability reasons is often not the
default for many vendors.
</p>
<p>More to the point, the C++ standard requires behavior which is only
available on certain platforms after certain symbols are defined.
Usually the issue involves I/O-related typedefs. In order to
ensure correctness, the compiler simply predefines those symbols.
</p>
<p>Note that it's not enough to #define them only when the library is
being built (during installation). Since we don't have an 'export'
keyword, much of the library exists as headers, which means that
the symbols must also be defined as your programs are parsed and
compiled.
</p>
<p>To see which symbols are defined, look for CPLUSPLUS_CPP_SPEC in
the gcc config headers for your target (and try changing them to
see what happens when building complicated code). You can also run
<code>&quot;g++ -E -dM - &lt; /dev/null&quot;</code> to display
a list of predefined macros for any particular installation.
</p>
<p>This has been discussed on the mailing lists
<a href="http://gcc.gnu.org/cgi-bin/htsearch?method=and&format=builtin-long&sort=score&words=_XOPEN_SOURCE+Solaris">quite a bit</a>.
</p>
<p>This method is something of a wart. We'd like to find a cleaner
solution, but nobody yet has contributed the time.
</p>
<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
......@@ -462,39 +502,13 @@ which is no longer available, thanks deja...-->
<!-- Yeah, I meant that "verbatim clip" thing literally... :-) -->
<pre>
New in 3.0.96:
New in 3.0.97:
---
- 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
New in 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.
- more named locale bug fixes
- support for symbol versioning when using GNU ld &gt;= 2.12
- wide-io
- tuning for executable size
</pre>
......
......@@ -731,7 +731,7 @@ namespace std
// string::iterator, _CharT*, etc.
template<class _FwdIter>
static _CharT*
_S_construct(_FwdIter __end, _FwdIter __beg, const _Alloc& __a,
_S_construct(_FwdIter __beg, _FwdIter __end, const _Alloc& __a,
forward_iterator_tag);
static _CharT*
......@@ -879,15 +879,14 @@ namespace std
int
compare(const _CharT* __s) const;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 5. String::compare specification questionable
// _GLIBCPP_RESOLVE_LIB_DEFECTS
// 5. String::compare specification questionable
int
compare(size_type __pos, size_type __n1, const _CharT* __s) const;
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
#endif
};
......
......@@ -41,7 +41,6 @@
#include <cmath> // For ceil
#include <cctype> // For isspace
#include <limits> // For numeric_limits
#include <memory> // For auto_ptr
#include <bits/streambuf_iterator.h>
#include <vector>
#include <typeinfo> // For bad_cast.
......
......@@ -464,8 +464,8 @@ namespace std
// 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(ios_base::failbit);
}
#endif
}
return *this;
}
......
......@@ -124,7 +124,7 @@ namespace std
// NB: Start ostringstream buffers at 512 bytes. This is an
// experimental value (pronounced "arbitrary" in some of the
// hipper english-speaking countries), and can be changed to
// suite particular needs.
// suit particular needs.
_M_buf_size_opt = 512;
_M_mode = __mode;
if (_M_mode & (ios_base::ate | ios_base::app))
......
......@@ -36,7 +36,6 @@
#include <istream>
#include <ostream>
#include <vector>
#include <memory> // for auto_ptr
#ifdef _GLIBCPP_USE_WCHAR_T
# include <cwctype> // for towupper, etc.
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment