Maybe serious bug in libio [egcs-1.0 i386-linux]

Ard Kuijpers ard@wfw.wtb.tue.nl
Tue Dec 9 03:59:00 GMT 1997


I think I've found a bug in the libio implementation on i386-linux. 
The bug reveals itself with the following piece of code:

#include <iostream.h>
#include <iomanip.h>
int main()
{
    cout << setfill('.');
    cout << "'..3' != '" << setw(3) << double(3) << "'\n";
    return 0;
}

Compiled with egcs-1.0 on i386-redhat-linux this prints:

'..3' != '  3'

instead of the expected

'..3' != '..3'

If this is really a bug, it is a serious show stopper for all
formatted output. This bug not present on mips-sgi-irix5.3. I cannot
check other systems.

My questions:

1) Can anyone with a working egcs-1.0 i*86-(redhat)-linux-* confirm
   this behaviour?
2) Who's to blame; gcc, libio, optimization, ... ? As far as I can see
   it's the ostream& operator<<(double) that is causing the problems.

My system:
* i586, RH5.0, 
* egcs-1.0
  ./configure --host=i386-redhat-linux --enable-haifa \
  --enable-threads=posix --prefix=/usr --gxx-include-dir=/usr/include/g++ \
  --enable-shared --norecursion
* binutils-2.8.1.0.15

Regards,

Ard
****************************************************************************
Ard Kuijpers                                       
Faculty of Mechanical Engineering                  e-mail:ard@wfw.wtb.tue.nl
Eindhoven University of Technology                     phone: +31 40 2472811
P.O. Box 513,  5600 MB Eindhoven,  The Netherlands       fax: +31 40 2461418
****************************************************************************
"...Do what makes your heart hurt less..." _follow_your_heart_  THE PALADINS 
****************************************************************************






More information about the Gcc-bugs mailing list