gcc-2.96-69's iostream implementation fills with nulls instead of a real character when a specific width is selected. E.g.: > cat bug22.c #include <iostream> int main(int, char**) { std::cout << 0.5 << endl; std::cout.fill(' '); std::cout.width(6); std::cout << 0.5 << endl; } > g++ -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.0) > g++ bug22.c -o bug22 > ./bug22 0.5 ^@^@^@0.5 > Here I've rendered the nulls (0x00) the way Emacs does (^@), so that they will survive email. The same thing happens if the explicit setting of the fill character is omitted; in either case GCC 2.95 produces a space and 2.96 produces nulls. The behavior is particularly troublesome when the output is then converted into a string using strstream, since the resulting string will be empty due to the bogus nulls.
Have you upgraded libstdc++ as well? This was fixed in libstdc++-2.96-60 or before (I don't remember exact release).
D'oh! Yes, that fixes it; I didn't see that libstdc++ and cpp were also upgraded when gcc was. So it works fine in the current release, libstdc++-2.96-69. Sorry about that!