| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Date: | Thu, 6 Jan 2005 16:07:11 +0000 |
| From: | Roger Leigh <roger DOT leigh AT epictechnology DOT co DOT uk> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Bug: atof() can't parse "NaN" |
| Message-ID: | <20050106160711.GA5621@epictechnology.co.uk> |
| Mime-Version: | 1.0 |
| X-GPG-Key: | 0x25BFB848 |
| X-Debian: | testing/unstable |
| X-OS-Uptime: | 16:03:00 up 20 min, 3 users, load average: 0.07, 0.10, 0.09 |
| User-Agent: | Mutt/1.5.6+20040907i |
Hi folks,
While fixing up glib-2.6.0 to build, I found a failure in the
floating-point tests. This is seemingly because atof() is bust.
This is a trivial example:
/* for NAN and INFINITY */
#define _ISOC99_SOURCE
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ieeefp.h>
int
main ()
{
double our_nan;
#ifdef NAN
our_nan = NAN;
#else
/* Do this before any call to setlocale. */
our_nan = atof ("NaN");
#endif
assert (isnan (our_nan));
return 0;
}
When I run this (current net release) the assert fails, and it
segfaults.
Regards,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |