This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Re: Latest gcc/cygwin - bug in %e format specifier?



> The latest net release of gcc seems to have a slight bug in the %e
> print format specifier. It prints garbage when you try to print a
> variable whose value is zero.

Try this and let me know if it works for you.  If it does, I'll work
on getting it into newlib.

2000-06-15  DJ Delorie  <dj@cygnus.com>

	* libc/stdio/vfprintf.c: pad 0.0 correctly with %e
 
Index: newlib/libc/stdio/vfprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vfprintf.c,v
retrieving revision 1.3
diff -p -3 -r1.3 vfprintf.c
*** vfprintf.c	2000/04/17 17:10:16	1.3
--- vfprintf.c	2000/06/15 20:04:53
*************** number:			if ((dprec = prec) >= 0)
*** 824,830 ****
  					ox[0] = *cp++;
  					ox[1] = '.';
  					PRINT(ox, 2);
!                                        if (_double || (flags & ALT) == 0) {
  						PRINT(cp, ndig-1);
  					} else	/* 0.[0..] */
  						/* __dtoa irregularity */
--- 824,830 ----
  					ox[0] = *cp++;
  					ox[1] = '.';
  					PRINT(ox, 2);
!                                        if (_double) {
  						PRINT(cp, ndig-1);
  					} else	/* 0.[0..] */
  						/* __dtoa irregularity */

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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