The following code produces wrong output: --------- #include <iostream.h> int main() { int width=cout.precision()+7; cout<<width<<endl; for (int i=0;i<10;i++) { cout.width(width); cout<<double(i)<<" "; } cout<<endl; return 0; } --------- Output file contains null characters instead of spaces: --------- 13 ^@^@^@^@^@^@^@^@^@^@^@^@0 ^@^@^@^@^@^@^@^@^@^@^@^@1 ^@^@^@^@^@^@^@^@^@^@^@^@2 ^@^@^@^@^@^@^@^@^@^@^@^@3 ^@^@^@^@^@^@^@^@^@^@^@^@4 ^@^@^@^@^@^@^@^@^@^@^@^@5 ^@^@^@^@^@^@^@^@^@^@^@^@6 ^@^@^@^@^@^@^@^@^@^@^@^@7 ^@^@^@^@^@^@^@^@^@^@^@^@8 ^@^@^@^@^@^@^@^@^@^@^@^@9 Output with ints works ok. The same holds for gcc version 2.97 20001002 (experimental)
Thanks, I have fixed this, see http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00305.html The fix will appear in the next gcc errata.
*** Bug 19183 has been marked as a duplicate of this bug. ***
Should be fixed in gcc-2.96-60 in rawhide.
*** Bug 21199 has been marked as a duplicate of this bug. ***
Installing gcc-2.96-64.i386.rpm (and the other gcc packages of this version) from Rawhide did not fix this problem for me. ^@ is still used to space certain types of output.
Have you installed libstdc++-2.96-64.i386.rpm? Aren't the programs statically linked (in that case they would have to be relinked)?
My apologies -- upgrading libstdc++ did fix the problem.