From 222bb619fbdc3775767cde2d500c92d58ce1d499 Mon Sep 17 00:00:00 2001
From: Phil Edwards
Added February 2001: Mark Wilden pointed out that the + standard std::getline() function can be used with standard + istringstreams to perform + tokenizing as well. Build an istringstream from the input text, + and then use std::getline with varying delimiters (the three-argument + signature) to extract tokens into a string. +
Return to top of page or to the FAQ.
@@ -324,7 +331,7 @@ Comments and suggestions are welcome, and may be sent to Phil Edwards or Gabriel Dos Reis. -An article entitled "The Standard C++ Locale" was published in - Dr. Dobb's Journal and can be found - here +
An article entitled "The Standard C++ Locale" was + published in Dr. Dobb's Journal and can be found + here.
Return to top of page or to the FAQ. @@ -67,7 +67,7 @@
Notes made during the implementation of locales can be found - here. + here.
Return to top of page or to the FAQ. @@ -76,7 +76,7 @@
Notes made during the implementation of codecvt can be found - here. + here.
The following is the abstract from the implementation notes: @@ -104,7 +104,7 @@ functionality are given.
Notes made during the implementation of ctype can be found - here. + here.
Return to top of page or to the FAQ. @@ -114,7 +114,7 @@ functionality are given.
A very common question on newsgroups and mailing lists is, "How
- do I do <foo> to a character string?" where <foo> is
+ do I do <foo> to a character string?" where <foo> is
a task such as changing all the letters to uppercase, to lowercase,
testing for digits, etc. A skilled and conscientious programmer
will follow the question with another, "And how do I make the
@@ -227,7 +227,7 @@ functionality are given.
Comments and suggestions are welcome, and may be sent to
Phil Edwards or
Gabriel Dos Reis.
-
$Id: howto.html,v 1.8 2000/12/03 23:47:47 jsm28 Exp $
+
$Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
Sorry. Them's the breaks.
This isn't going to try and be a complete tutorial on reading and - writing binary files (because "binary" covers a lot of - ground), but we will try and clear up a couple of misconceptions - and common errors. + writing binary files (because "binary" + covers a lot of ground), but we will try and clear + up a couple of misconceptions and common errors.
First, ios::binary has exactly one defined effect, no more and no less. Normal text mode has to be concerned with the newline @@ -224,7 +225,7 @@
Third, using the get() and put()/write() member functions still aren't guaranteed to help you. These are "unformatted" I/O functions, but still character-based. - (This may or may not be what you want.) + (This may or may not be what you want, see below.)
Notice how all the problems here are due to the inappropriate use of formatting functions and classes to perform something @@ -383,6 +384,31 @@ Try it yourself!
+Towards the beginning of February 2001, the subject of + "binary" I/O was brought up in a couple of places at the + same time. One notable place was Usenet, where James Kanze and + Dietmar Kühl separately posted articles on why attempting + generic binary I/O was not a good idea. (Here are copies of + Kanze's article and + Kühl's article.) +
+Briefly, the problems of byte ordering and type sizes mean that + the unformatted functions like ostream::put() and + istream::get() cannot safely be used to communicate + between arbitrary programs, or across a network, or from one + invocation of a program to another invocation of the same program + on a different platform, etc. +
+The entire Usenet thread is instructive, and took place under the + subject heading "binary iostreams" on both comp.std.c++ + and comp.lang.c++.moderated in parallel. Also in that thread, + Dietmar Kühl mentioned that he had written a pair of stream + classes that would read and write XDR, which is a good step towards + a portable binary format. +
+ @@ -391,7 +417,7 @@ Comments and suggestions are welcome, and may be sent to Phil Edwards or Gabriel Dos Reis. -Adds support for named libstdc++ include directory. For instance, the following puts all the libstdc++ headers into a directory @@ -193,7 +192,7 @@ options
-$Id: configopts.html,v 1.4 2001/01/21 09:36:09 pme Exp $ +$Id: configopts.html,v 1.5 2001/01/30 09:18:50 bkoz Exp $
diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html index be50063b8a1..fcc0c0dcdce 100644 --- a/libstdc++-v3/docs/html/install.html +++ b/libstdc++-v3/docs/html/install.html @@ -7,7 +7,7 @@If you don't have bash, and want to run 'make check' to test your build, you'll need to get bash 2.x. Also recommended is GNU Make, since it is the only 'make' that will parse these - makefiles correctly. + makefiles correctly. We are moving to DejaGNU, so you'll + probably want to get that.
As of June 19, 2000, libstdc++ attempts to use tricky and @@ -151,10 +152,11 @@
...with a gcc-2.9[67] snapshot
Unpack the gccsrcdir and go into that directory. For instance, gcc-2.95.2 is a valid gccsrcdir. - Once in gccsrcdir, you'll need to rename the libstdc++-v3 - directory which comes with that snapshot: + Once in gccsrcdir, you'll need to rename or delete + the libstdc++-v3 directory which comes with that snapshot:
- mv libstdc++-v3 libstdc++-v3-previous+ mv libstdc++-v3 libstdc++-v3-previous [OR] + rm -r libstdc++-v3
Next, unpack the libstdc++-v3 library tarball into the gccsrcdir directory; it will create a @@ -173,9 +175,11 @@
...with CVS gcc
Check out or download the gcc sources: the resulting source directory is gccsrcdir. Once in gccsrcdir, - you'll need to rename the libstdc++-v3 directory which comes - with that snapshot: - mv libstdc++-v3 libstdc++-v3-previous + you'll need to rename or delete the libstdc++-v3 directory + which comes with that snapshot: +
+ mv libstdc++-v3 libstdc++-v3-previous [OR] + rm -r libstdc++-v3
Next, unpack the libstdc++-v3 library tarball into this gccsrcdir directory; it will create a @@ -208,13 +212,7 @@
cd gccbuilddir - gccsrcdir/configure --prefix=destdir --enable-libstdcxx-v3- - -
Adding --enable-libstdcxx-v3 automatically selects libstdc++-v3 - as the C++ library to be used alongside the C++ compiler being built, - and also enables -fhonor-std by default. This option is not available - with gcc-2.95.2. + gccsrcdir/configure --prefix=destdir --other-opts...
@@ -239,10 +237,6 @@ This will configure and build the C++ library in the gccbuilddir/cpu-vendor-OS/libstdc++ directory. -If the build fails with a "warning: can't inline call" - message when compiling stringMAIN.cc, see the - resolution at the end of this document. -
If you are rebuilding from a previous build [attempt], some information is kept in a cache file. This is stored in gccbuilddir/cpu-vendor-OS/ if you are building with @@ -258,7 +252,7 @@ or
make install-gcc - make install-target-libstdc++-rule+ make install-target-libstdc++-v3 @@ -271,7 +265,7 @@ include/g++-v3/ bits/ ext/ - cpu-vendor-OS/include/g++-v3/ + CPU-vendor-OS/include/g++-v3/ bits/ ext/ @@ -326,35 +320,6 @@ -
When building the .8 snapshot with g++ 2.95.2, compilation may halt - with this warning message. The "problem" is the -Werror - flag being passed to the compiler, which says to treat warnings as - errors. (This plus a high warning level makes us track down bugs - quickly.) The compiler can't inline a certain call, prints - a warning, and dies. -
-The workaround is to edit either libsrcdir/src/Makefile.in - (before configuring) or bld-libstdc++/src/Makefile - (after configuring). There's one line that reads -
- WERROR = -Werror- Delete the flag itself, so that the line reads -
- WERROR =- Then the compiler will still print a warning, but it won't die. - -
For the curious, this "problem" is actually a symptom - of something else. The compiler in CVS could inline more than what - 2.95.2 does, and the libstdc++ changes were made with that - compiler. One of the libstdc++ maintainers explains this -here. -
-This has been patched in current CVS sources. -
- -