Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 9 May 2001 14:01:44 -0400 (EDT)
From: R Clint Whaley <rwhaley@cs.utk.edu>
Message-Id: <200105091801.OAA10216@enterprise.cs.utk.edu>
To: cygwin@cygwin.com
Subject: error in scanf handling of doubles
Cc: atlas@cs.utk.edu, ruheejih@calvados.zrz.tu-berlin.de

Hi,

I'm using Win2000 on a P4, using cygwin 1.3.1, gcc 2.95.3-4, downloaded
and installed today.  This version of cygwin does not perform correctly
with any of the scanf functions applied to floats.  Here is an example
routine demonstrating the error:

>#include <stdio.h>
>#include <assert.h>
>main(int nargs, char **args)
>{
>   char *str="-1106.743501";
>   double mf0, mf1;
>   if (nargs > 1) str = args[1];
>   assert(sscanf(str, "%lf", &mf1) == 1);
>   fprintf(stderr, "mf = '%s', %lf\n", str, mf1);
>   exit(0);
>}

Here is a compile and run on any other machine:
>drteeth.cs.utk.edu. gcc -o xerr showerr.c 
>drteeth.cs.utk.edu. ./xerr 
>mf = '-1106.743501', -1106.743501
>drteeth.cs.utk.edu. ./xerr 7.7
>mf = '7.7', 7.700000

Here it is on the cygwin1.3.1 box:
>$ ./xerr 
>mf = '-1106.743501', 1.000000
>$ ./xerr 7.7
>mf = '7.7', 77.000000

This worked under version 1.1.8 on the same machine/setup.  Can you confirm
the problem, so it's not just my install?

Any help much appreciated,
Clint

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

