Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: Chris Faylor Date: Mon, 10 Jul 2000 19:54:31 -0400 To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Net version 1.1.0: gcc 2.95.2-2 compiler bug Message-ID: <20000710195431.B19726@cygnus.com> Reply-To: cygwin AT sourceware DOT cygnus DOT com Mail-Followup-To: cygwin AT sourceware DOT cygnus DOT com References: <200007102342 DOT NAA03673 AT kulia DOT ifa DOT hawaii DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200007102342.NAA03673@kulia.ifa.hawaii.edu>; from heasley@hoku.ifa.hawaii.edu on Mon, Jul 10, 2000 at 01:42:35PM -1000 On Mon, Jul 10, 2000 at 01:42:35PM -1000, Jim Heasley wrote: >In porting some astronomical data handling software from linux/unix to >Cygwin (the latest nework release, 1.1.0 I believe), I discovered an >error in how gcc 2.95.2-2 generates output of a floating or double >variable set to 0.0 when formatted with a %E format. I didn't get any >hits on this problem in the FAQ or mail lists. The following little >test program illustrates the problem: To investigate this problem, please check out the 'newlib' part of the cygwin package. That's where things like printf are implemented. cgf >main() >{ > float value = 0.0; > double dvalue = 0.0; > printf("%11.0f %15.6f %13.5E\n",value,value,value); > printf("%11.0f %15.6f %21.14E\n",dvalue,dvalue,dvalue); > dvalue = value = 3.0; > printf("%11.0f %15.6f %13.5E\n",value,value,value); > printf("%11.0f %15.6f %21.14E\n",dvalue,dvalue,dvalue); >} > >Under linux/unix, this little program produces the following >output: > > 0 0.000000 0.00000E+00 > 0 0.000000 0.00000000000000E+00 > 3 3.000000 3.00000E+00 > 3 3.000000 3.00000000000000E+00 > >But the following is produced by the Cygwin gcc 2.95.2-2: > > 0 0.000000 0. > 0 0.000000 0. > 3 3.000000 3.00000E+00 > 3 3.000000 3.00000000000000E+00 > >When the output is sent to the terminal screen, the results for 0.0 with >the E format come out as 0. followed by some "strange" characters and >then E+00. Saving stdout to a file and then moving from Cygwin to linux, >I find there are a bunch of control characters after the leading 0. and >preceeding the E+00. > >Sorry, I don't know enough about compilers to even take a wack a solving >this problem, but would very much appreciate a patch for the sources >or a working binary with the patch incorporated if someone could kindly >generate one. > >Thanks, > >Jim Heasley >Professor of Astronomy > >Institute for Astronomy heasley AT hoku DOT ifa DOT hawaii DOT edu >University of Hawaii phone: 808-956-6826 >2680 Woodlawn Drive fax: 808-956-9580 >Honolulu, HI 96822 > >-- >Want to unsubscribe from this list? >Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- cgf AT cygnus DOT com Cygnus Solutions, a Red Hat company http://sourceware.cygnus.com/ http://www.redhat.com/ -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com