This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in egcs/libio/iostream.cc


Hi-

I just stumbled upon this bug in iostream.cc: it looks like the "pad"
field of "struct printf_info" is not set correctly if glibc2 is being
used.  The fix is quite simple:


Index: egcs/libio/iostream.cc
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libio/iostream.cc,v
retrieving revision 1.6
diff -c -p -r1.6 iostream.cc
*** iostream.cc	1997/10/03 17:14:02	1.6
--- iostream.cc	1998/01/30 00:05:38
*************** ostream& ostream::operator<<(double n)
*** 628,637 ****
  				      left: (flags() & ios::left) != 0,
  				      showsign: (flags() & ios::showpos) != 0,
  				      group: 0,
- 				      pad: fill()
  #if defined __GLIBC__ && __GLIBC__ >= 2
! 				      , extra: 0
  #endif
  	  };
  	  const void *ptr = (const void *) &n;
  	  if (__printf_fp (rdbuf(), &info, &ptr) < 0)
--- 628,637 ----
  				      left: (flags() & ios::left) != 0,
  				      showsign: (flags() & ios::showpos) != 0,
  				      group: 0,
  #if defined __GLIBC__ && __GLIBC__ >= 2
! 				      extra: 0,
  #endif
+ 				      pad: fill()
  	  };
  	  const void *ptr = (const void *) &n;
  	  if (__printf_fp (rdbuf(), &info, &ptr) < 0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]