diff options
author | Jonathan Wakely <jwakely.gcc@gmail.com> | 2007-11-17 01:11:43 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2007-11-17 01:11:43 +0000 |
commit | 04901f81ae1db89496354eb88df80376bf053919 (patch) | |
tree | cef09f87f32327e68a8544205e6d40df09eb45ff /libstdc++-v3/docs/html/debug.html | |
parent | 478b2b9cb3fc61cdc600175bef545ffd05b58ac1 (diff) | |
download | gcc-04901f81ae1db89496354eb88df80376bf053919.zip gcc-04901f81ae1db89496354eb88df80376bf053919.tar.gz gcc-04901f81ae1db89496354eb88df80376bf053919.tar.bz2 |
howto.html, [...]: Fix typos and anachronisms.
2007-11-17 Jonathan Wakely <jwakely.gcc@gmail.com>
* docs/html/17_intro/howto.html, docs/html/21_strings/howto.html,
docs/html/22_locale/codecvt.html, docs/html/23_containers/howto.html,
docs/html/27_io/howto.html, docs/html/ext/howto.html,
docs/html/debug.html, docs/html/install.html,
docs/html/faq/index.html: Fix typos and anachronisms.
From-SVN: r130255
Diffstat (limited to 'libstdc++-v3/docs/html/debug.html')
-rw-r--r-- | libstdc++-v3/docs/html/debug.html | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libstdc++-v3/docs/html/debug.html b/libstdc++-v3/docs/html/debug.html index 6e0369b..61c6a8b 100644 --- a/libstdc++-v3/docs/html/debug.html +++ b/libstdc++-v3/docs/html/debug.html @@ -306,7 +306,7 @@ containers have additional debug capability. <p>The following library components provide extra debugging capabilities in debug mode:</p> <ul> - <li><code>std::basic_string</code> (no safe iterators)</li> + <li><code>std::basic_string</code> (no safe iterators and see note below)</li> <li><code>std::bitset</code></li> <li><code>std::deque</code></li> <li><code>std::list</code></li> @@ -321,6 +321,23 @@ containers have additional debug capability. <li><code>std::unordered_multiset</code></li> </ul> +<p>N.B. although there are precondition checks for some string operations, +e.g. <code>operator[]</code>, +they will not always be run when using the <code>char</code> and +<code>wchar_t</code> specialisations (<code>std::string</code> and +<code>std::wstring</code>). This is because libstdc++ uses GCC's +<code>extern template</code> extension to provide explicit instantiations +of <code>std::string</code> and <code>std::wstring</code>, and those +explicit instantiations don't include the debug-mode checks. If the +containing functions are inlined then the checks will run, so compiling +with <code>-O1</code> might be enough to enable them. Alternatively +<code>-D_GLIBCXX_EXTERN_TEMPLATE=0</code> will suppress the declarations +of the explicit instantiations and cause the functions to be instantiated +with the debug-mode checks included, but this is unsupported and not +guaranteed to work. For full debug-mode support you can use the +<code>__gnu_debug::basic_string</code> debugging container directly, +which always works correctly. +</p> <h3 class="left"><a name="mem">Tips for memory leak hunting</a></h3> @@ -339,9 +356,9 @@ containers have additional debug capability. thing of great importance to keep in mind when debugging C++ code that uses <code>new</code> and <code>delete</code>: there are different kinds of allocation schemes that can be used by - <code> std::allocator </code>. For implementation details, see this - <a href="ext/howto.html#3"> document</a> and look specifically for - <code>GLIBCXX_FORCE_NEW</code>. + <code> std::allocator </code>. For implementation details, see the + <a href="ext/mt_allocator.html">mt allocator</a> documentation and + look specifically for <code>GLIBCXX_FORCE_NEW</code>. </p> <p>In a nutshell, the default allocator used by <code> |