delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/09/14:16:52

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019